Lab 1: Digital Input and Output: Task 1: Blinking An Led
Lab 1: Digital Input and Output: Task 1: Blinking An Led
Lab 1: Digital Input and Output: Task 1: Blinking An Led
ARDUINO CODE
int led = 13; void loop(){
setup() digitalWrite(led, HIGH);
void setup(){ delay(250);
pinMode (led, OUTPUT); digitalWrite(led, LOW);
} delay(250);
}
TASK 2: BLINKING LEDS USING PUSHBUTTON
SCHEMATICS
ARDUINO CODE
int led=13; void loop() {
int pushbutton=3; int a=digitalRead(3);
if(a==1){
void setup() { digitalWrite(13,HIGH);
pinMode(led, OUTPUT); delay(250);
pinMode(pushbutton, INPUT); digitalWrite(13,LOW);
} delay(250);
}
else{
digitalWrite(13,LOW);}
}
TASK 3: BLINKING LEDS USING PUSHBUTTON WITH MULTIPLE MODES
SCHEMATICS
ARDUINO CODE
ARDUINO CODE
Write a code using a pushbutton and 5 LEDs to perform 4 types of LED pattern by pressing
the pushbutton which are
1. All ON
2. Running LED forward
3. Running LED backward
4. All OFF
The report need to be submitted during the following week before the class begin.
The report should consist of
1. Introduction
2. Schematics
3. Flowchart
4. Discussion
5. Conclusion
(page1: cover page, names, page2: into and schematics, page3: code flowchart, page 4:
discussion n conclusion)