Beruflich Dokumente
Kultur Dokumente
THE CIRCUIT:
Parts:
CIRC-01 Breadboard Sheet x1 330 Ohm Resistor Orange-Orange-Brown x1 2 Pin Header x4 5mm Yellow LED x1 Wire
Schematic
Arduino
pin 13
longer lead
+
LED
(light emitting diode)
resistor gnd
(330ohm) (orange-orange-brown)
(ground) (-)
The Internet
.:download:. breadboard layout sheet http://ardx.org/BBLS01S .:view:. assembly video http://ardx.org/VIDE01
08
CODE
CIRC-01
/'header to be included when i have finalised the look for all programs #sim axe401 #picaxe28x2 symbol ledpin = s.13 'for simulation - the board you are using 'the picaxe chip installed in the picaxe shield base 'led connected to pin s.13
'this line added after help with day 3 - see the discussion when i publish it dirS.13 = 1 'set s.13 as an output do high ledpin pause 1000 low ledpin pause 1000 loop 'turn on the led 'wait 1 second (1000 milli seconds) 'turn off the led wait 1 second repeat
NOT WORKING?
(3 things to try)
Program Not Uploading This happens sometimes, the most likely cause is a confused serial port, you can change this in file>options>
Still No Success?
A broken circuit is no fun, send us an e-mail and we will get back to you as soon as we can. help@oomlout.com
MAKING IT BETTER
Changing the pin: The LED is connected to pin S.13 but we can use any of the picaxe shield based pins. To change it take the wire plugged into pin S.13 and move it to a pin of your choice (from 0-13) (you can also use analog A0-A5) Then in the code change the lines: symbol ledpin = S.newpin and dirS.newpin Then upload the program: (F5) Change the blink time: Unhappy with one second on one second off? In the code change the lines: high ledpin pause time on //(seconds * 1000) low ledpin pause time off //(seconds * 1000) Control the brightness: Along with digital (on/off) control the Arduino can control some pins in an analog (brightness) fashion. (more details on this in later circuits). To play around with it. Change the LED to pin S.9: (also change the wire) symbol ledpin = S.9 and dirS.9 = 1 Add in the following code before the loop: pwmout ledpin,150,150 Replace the code inside the loop with: pwmduty ledpin, 50 this will be a not so bright led - change that value for 0 to 150 Fading: We will use another included example program. To open go to See the extra text file for this example Then upload to your board and watch as the LED fades in and then out.
http://ardx.org/CIRC01
09