From 367d7c9fb405dd142624d6724e8aceb1b9d16740 Mon Sep 17 00:00:00 2001 From: draxaris1010 Date: Tue, 11 Jun 2024 17:50:56 +0200 Subject: [PATCH] vinscant: it doesnt crash but its green GREEN WHY --- vinscant/main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vinscant/main.py b/vinscant/main.py index 7339072..0252e45 100644 --- a/vinscant/main.py +++ b/vinscant/main.py @@ -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: @@ -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)