Updated button example for new mp
This commit is contained in:
parent
681edd255b
commit
41365fd89e
|
@ -1,17 +1,17 @@
|
|||
import time
|
||||
|
||||
# Import pin constants from plasma
|
||||
from plasma import PIN_LED_R, PIN_LED_G, PIN_LED_B, PIN_USER_SW, PIN_BUTTON_A, PIN_BUTTON_B
|
||||
# Import plasma2040
|
||||
from plasma import plasma2040
|
||||
|
||||
# Import helpers for RGB LEDs and Buttons
|
||||
from pimoroni import RGBLED, Button
|
||||
|
||||
led = RGBLED(PIN_LED_R, PIN_LED_G, PIN_LED_B)
|
||||
led = RGBLED(plasma2040.LED_R, plasma2040.LED_G, plasma2040.LED_B)
|
||||
led.set_rgb(0, 0, 0)
|
||||
|
||||
user_sw = Button(PIN_USER_SW)
|
||||
button_a = Button(PIN_BUTTON_A)
|
||||
button_b = Button(PIN_BUTTON_B)
|
||||
user_sw = Button(plasma2040.USER_SW)
|
||||
button_a = Button(plasma2040.BUTTON_A)
|
||||
button_b = Button(plasma2040.BUTTON_B)
|
||||
|
||||
while True:
|
||||
if user_sw.read():
|
||||
|
|
Loading…
Reference in New Issue