![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZVfr7N7ZGeuD3qOsy8GiCJXxohlpo4pnzbePEaAlyEch_Hv_F0HBsOz2amd2fGjHnqmMXs-DjEHBwBa9F3tMCsza-VYzx-uwUNKn4bwBuMs3Bc0NU8Rl9zAlRvAO66Y1qFuylXchdX9lS/s320/basic+arduino+setup+button+with+LED.jpg)
with my first Arduino attempt, i messed around with button and a LED, its suppose to control the button LED functions with the simple press of the button that is stated from the reading "Getting Started with Arduino." After that, i uploaded a sketch example from the arduino program to make the led blink or stay on by command; by reading that, the sketch stated how to manipulate the LED function by changing its digital write (the actions of the LED) from the when it turns on and off as it blinks. by changing its actions, i messed around with its Delay numbers later learning that the LED's blink at a thousandth of a second.
//example of what i was messing with to command the LEDS with in the script thats written in RED
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
The circuit:
* LED connected from digital pin 13 to ground.
* Note: On most Arduino boards, there is already an LED on the board
connected to pin 13, so you don't need any extra components for this example.
Created 1 June 2005
By David Cuartielles
http://arduino.cc/en/Tutorial/Blink
based on an orginal by H. Barragan for the Wiring i/o board
*/
int ledPin = 13; // LED connected to digital pin 13
// The setup() method runs once, when the sketch starts
void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop()
{
digitalWrite(ledPin, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(1000); // wait for a second
}
the lower the number the faster the LEDs respond in turning on and off. the higher the longer is takes it to respond.
![](file:///C:/Users/MIKEJO%7E1/AppData/Local/Temp/moz-screenshot-1.png)
![](file:///C:/Users/MIKEJO%7E1/AppData/Local/Temp/moz-screenshot.png)
No comments:
Post a Comment