You are on page 1of 7

robotics 1 ESO

Controlling LEDs using pushbuttons.

Part II.

Marta llamas fernandez


activity 7
The yellow LED is on when BTN1 ​ AND ​BTN3 are
pressed atthe same time, otherwise the yellow LED is
off.

device type pin


yellow led digital ouput 10
BTN1 digital input 1
BTN3 digital input 3

diagram
code

activity 8
BTN2 ​OR ​BTN3 are pressed, the green LED is off,
otherwiseif on

device type pin


geen led digital ouput 9
BTN2 digital input 3
BTN3 digital input 4
diagram

code

activity 9
If BTN1 ​AND ​BTN3 are pressed at the same time, ​
OR ​BTN2is pressed, the red LED blinks every 0,4
seconds.
device type pin
green led digital input 9
BTN1 digital input 2
BTN2 digital input 4
BTN3 digital input 3

diagram
code

You might also like