Skip to content

Commit

Permalink
Updated button example for new mp
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Aug 19, 2021
1 parent 681edd2 commit 41365fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions micropython/examples/plasma_2040/rgb-led-and-buttons.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down

0 comments on commit 41365fd

Please sign in to comment.