Now we are going to make an external LED blink
First setup your Thing:
- Turn your Thing to “off”
- Removing the USB cable from your laptop
- Attaching your Thing to a ‘breadboard’ with elastic bands to hold it a little steady.
- Wire: Connect ‘5V’ to ‘+’ (red cable), ‘GND’ to ‘-’ (blue cable)
- Wire: ‘Pin14’ to ‘h5’
- Resistor (150 OHM, green and brown): ‘g5’ to ‘g11’
- LED: long leg ‘f11’, short leg ‘f17’
- Wire: ‘g17’ to ‘-’
Look at the picture above to see if you have wired it correctly
- Save your Blink as a new file calling it LEDblink.
- Above the function void setup() you need to add the following line: ‘const int ledPin = 14;’
- Now change everytime the code says ‘LED_BUILTIN’ with ‘ledPin’
- This change the LED blinking from the internal LED on the board called 5 to instead sending the same signal to 14. Which should be connected via a resistor to your LED.
- Re-connect usb
- Turn on power on Thing
- Verify LEDblink
- Upload LEDblink to the Thing
- See it blinking!!! Yahh
- Try to change how it blink
NOTICE: the Thing is not designed to be used on a breadboard, which means that if something does not work, try pushing the wires or the Thing a little – making sure that wires attached to the Thing is touching the sides of the pin hole.
A method is a function which can take parameters and do something
blinking_LED (X, Y, Z) – where X = LedPin; Y = delay time; Z = numbers of times to blink