Documente Academic
Documente Profesional
Documente Cultură
TABLE OF FIGURE
Figure 1 The Actual assembly model. .......................................................................................................... 5
Prepare the equipment
The equipment for the practice task includes:
Arduino UNO
Breadboard 830 Point
A USB cable
Jump leads (prototyping wires)
LED Light
Power line breadboard
A push- button
The evidences
1. Firstly, connecting pin 13 to an LED and resistor in series and then to GND.
2. Next, connect the switch as shown, with one leg connected to +5V, and the other leg of the switch
connected to Pin 2.
3. Finally, connect Pin 2 and that second leg of the switch to a resistor then to GND
void setup()
{
pinMode(inPin, INPUT);
pinMode(outPin, OUTPUT);
}
void loop()
{
reading = digitalRead(inPin);
// if the input just went from LOW and HIGH and we've waited long enough
// to ignore any noise on the circuit, toggle the output pin and remember
// the time
if (reading == HIGH && previous == LOW && millis() - time > debounce)
{
if (state == HIGH)
state = LOW;
else
state = HIGH;
time = millis();
}
digitalWrite(outPin, state);
previous = reading;
}