Scratch For Arduino - A Posteriori

1y ago
20 Views
2 Downloads
1.05 MB
39 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Jamie Paz
Transcription

Scratch for ArduinoProgramming, Electronics, and Giant Killer Robots** Giant Killer Robots may be omitted due to budget constraints.Slide 1

Before we start. We believe in open access to knowledge All our slides are shared online for free You can print it, share it, modify it, use it to runyour own coursesThis current set of slides can be found here(* You can also find the URL on your hand-out)Slide 2Slides available at: http://a9i.sg/huayi

About UsYONISpent 15 years developingsoftware for big banks, nowdeveloping the next generation ofMakers and Coders.CORTEx-Navy engineer managing bigengines, powerful generators, andeasily choked toilets. Codes and buildsstuff because he’s too cheap to buySlide 3Slides available at: http://a9i.sg/huayi

What is an Arduino?Short Answer:This is an Arduino.Slide 4

What is an Arduino? First we’ll need to know what is a “microcontroller”ATtiny 85ATmega 328Slide 5Slides available at: http://a9i.sg/huayi

What is an Arduino?Micro-controllers are.Like a miniature computers. Contains processor, RAM, storage, and more Can be programmed like a computerSame same.but differentUnlike a computer. Provides direct electrical connection to external devices Can’t run Minecraft or Fortnite.Slide 6Slides available at: http://a9i.sg/huayi

What is an Arduino?Micro-controllers can be a pain Require a special device to program.AVRISP (In-System Programmer)Slide 7Slides available at: http://a9i.sg/huayi

What is an Arduino?Micro-controllers can be a pain Require external parts to work (eg. voltageregulator, crystal oscillator, decouplingcapacitors)Voltage Regulator(.this is thesimple type)Crystal OscillatorCapacitorSlide 8Slides available at: http://a9i.sg/huayi

What is an Arduino?So what is an Arduino? Combines a micro-controller with all the othercomponents into a single device.and many moreusefulcomponentsSlide 9Slides available at: http://a9i.sg/huayi

What is S4A?This is an easy one. It’s a versionof Scratch that works with Arduino.All of you have already doneScratch right?Slide 10

What is S4A? Opensource modification of MIT’s Scratch Modified to communicate with Arduino boardsSlide 11Slides available at: http://a9i.sg/huayi

What is S4A?Why use S4A? Code is very similar to Arduino Block-based, so less likely to make mistakesSlide 12Slides available at: http://a9i.sg/huayi

What is S4A? Code runs in the computer and sendscommands to the ArduinoCommands(eg. digital write)Runs on ComputerReadings(eg. digital read)Slide 13Slides available at: http://a9i.sg/huayi

Getting Started(The fun part.)Slide 14

Physical ConnectionSome of the LEDon the Arduinoshould light upafter connectionThis end tocomputerThis end toArduinoSlide 15Slides available at: http://a9i.sg/huayi

Software Connection1) Look for this icon and run it2) You should have a screen like this.Slide 16Slides available at: http://a9i.sg/huayi

Software Connection3) Wait for it to connect to your ArduinoOnceconnected,it will nolonger show“Searching”Slide 17Slides available at: http://a9i.sg/huayi

First ProgramThese are key press “events” (found under “Control”).They run the script beneath them when their keys are pressed.(If greyed out, check that you’re connected in “Live” mode)These turn digital pin 13 on and off.Digital pin 13 is connected to a built-in LED, so youcan see its effect without having to connect anything.Test it out!Slide 18Slides available at: http://a9i.sg/huayi

Exercise 1aExternal LEDsSlide 19

Breadboard Helps to make electricalconnectionsMany components (eg.LEDs) can be pluggedin directlyUse dupont wires tomake connectionsHoles in thesame row areconnectedNo connectionacross centergapHoles by the sideare connectedvertically acrossentire boardDupont wiresThe colors doesn’tmatter; they all workthe sameSlide 20Slides available at: http://a9i.sg/huayi

LED Light Emitting Diode Longer leg connects to positive Shorter leg connects to ground(0V)Doesn’t work if connected inreverseShort legnegativeLong legpositiveSlide 21Slides available at: http://a9i.sg/huayi

Connecting an LEDImportant!!!Take note of whichleg of the LED islongerIn this example, thebottom leg islonger.Long leg : PositiveShort leg : GndSlide 22Slides available at: http://a9i.sg/huayi

Connecting an LEDConnect a wirefrom “GND” to theshorter LED leg.* My shorter leg ison top.Slide 23Slides available at: http://a9i.sg/huayi

Connecting an LEDAdd a 330 ohmresistor.Connect one endto the long LEDleg, and the otherend to an emptyrow.Slide 24Slides available at: http://a9i.sg/huayi

Connecting an LEDConnect the otherend of the resistorto the “5V” pinThe LED shouldlight upimmediately!5VSlide 25Slides available at: http://a9i.sg/huayi

Connecting an LEDThis is how theelectricity isflowing5VFrom 5V to Resistor to LED to GNDSlide 26Slides available at: http://a9i.sg/huayi

Connecting an LEDControlling theLEDTo control theLED, we need toconnect it to anoutput pin insteadof 5V. 5V Disconnect itfrom 5V.Connect it toPin 11.Slide 27Slides available at: http://a9i.sg/huayi

Challenges1) Modify your earlier program to control theexternal LED instead of the internal LED.2) Program the connected LED blink continuouslySlide 28Slides available at: http://a9i.sg/huayi

Why the resistor? Arduino pins provide 5V Different color LEDs require different voltages –Red, Yellow, Infra-red: 1.8V–Blue, White, UV:3.3V–Green:Depends. Try 1.8V first.Resistor helps to reduce the voltageWhat happens when you connect 5V to a RedLED without a resistor?Slide 29Slides available at: http://a9i.sg/huayi

Exercise 1bExternal InputsSlide 30

Push Button SwitchExternal ViewInternal ViewSlide 31Slides available at: http://a9i.sg/huayi

Connecting a SwitchMake these connectionsResistorValue isn’t as important asbefore. Recommend topick 1000 ohm, but mostother values will do aswell.Push button switchConnects the adjacentpins. Only need to useone side.Connected to 5VSlide 32Slides available at: http://a9i.sg/huayi

Connecting a Switch When switch is open Pin 2 is connectedto 0V via the resistorPin 2 not connectedto 5VVoltage of pin 2 0V False Low5VTo ArduinoPin 2What is thevoltage?Slide 33Slides available at: http://a9i.sg/huayi

Connecting a Switch When switch is closed Pin 2 is connectedto 0V via the resistorPin 2 is connectedto 5V directlyVoltage of pin 2 5V True High5VTo ArduinoPin 2What is thevoltage?Slide 34Slides available at: http://a9i.sg/huayi

Connecting a Switch This resistor is call a pull-down resistor,because it pulls the voltage down to 0V whenthe switch is openWe can also connect the resistor to 5V and theswitch to Gnd. This is call a pull-up resistor.Slide 35Slides available at: http://a9i.sg/huayi

Connecting a Switch Can we connect the switch to Gnd without aresistor?–NO! Without the resistor,we will have a shortcircuit when the switchis pressedWhenswitch ispressed5VPositive connecteddirectly to negative.Short circuit!Slide 36Slides available at: http://a9i.sg/huayi

Connecting a SwitchAdd this script to your “Device”Add this script to your “Sprite”Connected to 5VSlide 37Slides available at: http://a9i.sg/huayi

Challenges1) Make an LED blink rapidly for 2 seconds whenthe button is pressed2) Make an LED toggle between on and off whenthe button is pressedSlide 38Slides available at: http://a9i.sg/huayi

Copyright Created by A Posteriori LLPVisit http://aposteriori.com.sg/ for moretips and tutorialsThis work is licensed under a CreativeCommons Attribution-ShareAlike 4.0International License.Slide 39Slides available at: http://a9i.sg/huayi

Scratch for Arduino Programming, Electronics, and Giant Killer Robots* * Giant Killer Robots may be omitted due to budget constraints. . What is S4A? This is an easy one. It's a version of Scratch that works with Arduino. All of you have already done Scratch right?

Related Documents:

Arduino compatible components. Personal computer running Arduino software Arduino software is free to download and use from: www.arduino.cc Arduino board Such as: Arduino Uno Freetronics Eleven Genuino Uno or any Arduino compatible board that has a standard Arduino UNO header l

Scratch for Arduino Scratch for Arduino (S4A) is a Scratch modification that brings the easiness of programming with Scratch to the Arduino prototyping board. It provides new blocks for managing sensors and actuators connected to Arduino Board. ace . STEP 1 : Download S4A

117. Password access with arduino 118. Arduino Voltmeter Code 119. Easily control your iPod using Arduino 120. Candy Tossin Coffin using an Arduino 121. Arduino 7 segment Displays Digital Clock With Charlieplexing LEDs 122. Arduino controlled webcam panner 123. Binary/ Analog Clock 124. Universal Gripper

arduino-00 -win.zip Recommended Path c:\Program Files\ ( - version #) Step 3: Shortcut Icon Open c:\program files\arduino-00 Right Click Arduino.exe (send to Desktop (create shortcut)) \ ( - version #) Step 4: Plug In Your Arduino Plug your Arduino in: Using the included USB cable, plug your Arduino board into a free USB port. Wait for a box to .

Hence we given interesting top five easy to make Arduino projects with code and library link. Happy learning Arduino 1. Heart Rate Monitor AD8232 Interface Arduino 2. Fingerprint sensor-scanner with Arduino 3. Giving Voice Recognition Ability to Arduino 4. Soil Moisture Sensor and Arduino 5. How to Interface RFID with Arduino?

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

arduino’s analog pin 4 (SDA). And the pin labelled as SCL on the MPU 6050 to the arduino’s analog pin 5 (SCL). And that’s it, you have finished wiring up the Arduino MPU 6050. Step 2: Uploading the code and testing the Arduino MPU 6050 To test the Arduino MPU 6050, first download the arduino library for MPU 6050, developed by Jeff Rowberg.

An Introduction to Random Field Theory Matthew Brett , Will Penny †and Stefan Kiebel MRC Cognition and Brain Sciences Unit, Cambridge UK; † Functional Imaging Laboratory, Institute of Neurology, London, UK. March 4, 2003 1 Introduction This chapter is an introduction to the multiple comparison problem in func-