File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1616
1717BOARD_TYPE = Board ().type
1818print ("Board type: " + BOARD_TYPE )
19-
19+ INVERT_LED = False
2020if BOARD_TYPE == Board .BoardType .PICO_W :
2121 led = Pin ("LED" , Pin .OUT )
2222elif BOARD_TYPE == Board .BoardType .PICO :
2323 led = Pin (25 , Pin .OUT )
2424elif BOARD_TYPE == Board .BoardType .ESP8266 :
2525 led = Pin (2 , Pin .OUT )
26+ INVERT_LED = True
2627elif BOARD_TYPE == Board .BoardType .ESP32 :
2728 led = Pin (2 , Pin .OUT )
29+ INVERT_LED = True
2830elif BOARD_TYPE == Board .BoardType .ESP32_C3 :
2931 led = Pin (8 , Pin .OUT )
32+ INVERT_LED = True
3033else :
3134 led = Pin (2 , Pin .OUT )
3235
@@ -113,12 +116,12 @@ async def main():
113116 await (server .blink_ip (led_pin = led , last_only = config .BLINK_LAST_ONLY ))
114117 while not shutdown :
115118 if status :
116- led .on ( )
119+ led .value ( not INVERT_LED )
117120 await asyncio .sleep (blink_on_time )
118- led .off ( )
121+ led .value ( INVERT_LED )
119122 await asyncio .sleep (blink_off_time )
120123 else :
121- led .off ( )
124+ led .value ( not INVERT_LED )
122125 await asyncio .sleep (0.2 )
123126
124127server = GurgleAppsWebserver (
You can’t perform that action at this time.
0 commit comments