Skip to content

Commit

Permalink
vinscant: it doesnt crash but its green
Browse files Browse the repository at this point in the history
GREEN WHY
  • Loading branch information
draxaris1010 committed Jun 11, 2024
1 parent 2e7e3a7 commit 367d7c9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vinscant/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import mfrc522
import urequests as req
from machine import Pin, PWM, WDT
from machine import Pin, PWM, WDT, bitstream
import time
from neopixel import NeoPixel
import esp32


def get_key():
with open("key.txt", "r") as file:
return file.read().strip()
LEDDY_ADDRESS = "http://10.0.2.3"
def uidToString(uid):
mystring = ""
for i in uid:
Expand All @@ -20,8 +20,16 @@ def __init__(self, pin=Pin(18, Pin.OUT)):
self.neopixel = NeoPixel(pin, 1)

def setColor(self, r, g, b):
print("color change begin")
self.neopixel[0] = (r, g, b)
print("color change step 1")
# bitganging causes hang
# study the following file for more info
# https://github.com/micropython/micropython/blob/master/extmod/machine_bitstream.c
# TODO overwrite NeoPixel.write to use RMT directly
esp32.RMT.bitstream_channel(None)
self.neopixel.write()
print("color change done")

def turnOff(self):
self.setColor(0, 0, 0)
Expand Down

0 comments on commit 367d7c9

Please sign in to comment.