import machine # importeert de machine module met o.a Pin class
import time
groen = machine.Pin(27,machine.Pin.OUT)
oranje = machine.Pin(26,machine.Pin.OUT)
rood = machine.Pin(25,machine.Pin.OUT)
# init
print("initialiseren")
groen.value(0)
oranje.value(0)
rood.value(1)
time.sleep(5)
while True:
# groen
print("groen")
rood.value(0)
groen.value(1) # value 1 of 0 ( 3V3 of 0V)
time.sleep(1)
# oranje
print("oranje")
groen.value(0)
oranje.value(1) # value 1 of 0 ( 3V3 of 0V)
time.sleep(1)
# rood
print("rood")
oranje.value(0)
rood.value(1)
time.sleep(1)
# dir(machine)
'''
['__class__', '__getattr__', '__name__', 'const', 'ADC', 'ADCBlock'
, 'DAC', 'DEEPSLEEP', 'DEEPSLEEP_RESET', 'EXT0_WAKE', 'EXT1_WAKE'
, 'HARD_RESET', 'I2C', 'I2S', 'PIN_WAKE', 'PWM', 'PWRON_RESET'
, 'Pin', 'RTC', 'SDCard', 'SLEEP', 'SOFT_RESET', 'SPI'
, 'Signal', 'SoftI2C', 'SoftSPI', 'TIMER_WAKE'
, 'TOUCHPAD_WAKE', 'Timer', 'TouchPad', 'UART'
, 'ULP_WAKE', 'WDT', 'WDT_RESET', '__dict__', '__file__'
, '_machine', 'bitstream', 'deepsleep', 'dht_readinto'
, 'disable_irq', 'enable_irq', 'freq', 'idle', 'lightsleep'
, 'mem16', 'mem32', 'mem8', 'reset', 'reset_cause', 'sleep'
, 'soft_reset', 'time_pulse_us', 'unique_id', 'wake_reason'
, 'Counter', 'Encoder']
'''
# dir(machine.Pin)
'''
'__class__', '__name__', 'value', 'DRIVE_0',
'DRIVE_1', 'DRIVE_2', 'DRIVE_3', 'IN', 'IRQ_FALLING',
'IRQ_RISING', 'OPEN_DRAIN', 'OUT', 'PULL_DOWN', 'PULL_UP',
'WAKE_HIGH', 'WAKE_LOW', '__bases__', '__dict__',
'board', 'init', 'irq', 'off', 'on', 'toggle'
'''Loading
esp32-devkit-c-v4
esp32-devkit-c-v4