Next we can connect an LED to the breadboard and then make a connection from the 5V pin of the Arduino to the Anode:Īnd then the Cathode to one of the GND pins of the Arduino: ![]() Notice the LED only illuminates when the polarity is correct: Lets illustrate this with a coin cell battery. The Anode should be connected to the positive side of the power supply and the shorter leg is the Cathode and should be connected to the negative side of the power supply. This can be seen by attaching a multimeter to the Arduino: When the voltage is HIGH, the pin will output 5 V (or just slightly less). Then we set the voltage to HIGH using the digitalWrite inbuilt function. An LED is an output device that converts electricity into light. In this case we use the inbuilt function pinMode to configure pin 13 as an OUTPUT. put your main code here, to run repeatedly: put your setup code here, to run once: The Arduino sketch has a setup function which we run once for example to configure pins and a loop function which runs repeatedly: void setup() We can test communication with the Arduino with an Arduino sketch. The Arduino has a test LED which is internally attached to Pin 13 and ground. Tutorial 01: The Arduino Blink Test Sketch
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |