This blog is a record of what I do, what I think and what I read. If you are interested to know about my professional experience, you can refer to the other blog of mine.
http://admi2camac.blogspot.com/
Friday, 10 March 2023
TTB06: Using 'IF' statement (NO potentiometer)
from machine import Pin
import time
led=Pin(15,Pin.OUT)
while True:
CMD=input('What is your Command? (ON/OFF/TOGGLE) ')
if CMD=='ON':
led.value(1)
if CMD=='OFF':
led.value(0)
if CMD=='TOGGLE' :
led.toggle()
No comments:
Post a Comment