Updated button example for new mp

This commit is contained in:
ZodiusInfuser 2021-08-19 15:50:16 +01:00
parent 681edd255b
commit 41365fd89e
1 changed files with 6 additions and 6 deletions

View File

@ -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():