First we opened the Arduino software and plugged in the Arduino. After checking the settings, we uploaded a pre-made code for blinking. We noticed the orange light was blinking after uploading the code and the rate at which the blinking occurred changed as we changed the delay on the code.
Then we build a simple circuit with an LED, 220 ohm resistor and connected the positive end of the LED to pin 10 in the Arduino. After writing a simple code to have the LED turn on and off with a 1 second delay and uploading the code, the LED flashed as expected.
We then used the same technique to connect 4 LED's to the Arduino and control them. The process was almost identical as the single LED, we just had to write code for each LED changing only the pin numbers based on which pin they were connected to. We also had to define the pins. Once the code was uploaded to the Arduino and we adjusted the delay, we had the lights flashing in a pattern similar to the KITT car on Knight Rider.
Lab 7 finished!
No comments:
Post a Comment