ph1p / ikea-led-obegraensad

ESP32/Arduino hack for the ikea OBEGRÄNSAD led wall lamp
MIT License
596 stars 81 forks source link

Support for esp8266 (nodemcuv2) #20

Closed jekkos closed 1 year ago

jekkos commented 1 year ago

Some minor changes I had to do to make it compile for ESP8266 in platformio. I still need to flash + test it.

jekkos commented 1 year ago

Tested it on a nodemcuv2, and works but together with #30

ph1p commented 1 year ago

Thank you! :) Could you please rebase to the latest changes of main? After that I will check and merge it.

jekkos commented 1 year ago

Thanks for merging all open PRs, I rebased with main and reflashed my nodemcuv2. I had to add one more switch for the weather to compile, it works now again on my device.

jekkos commented 1 year ago

It seems that latest changes in main are now breaking esp8266. Some functionality is used for interrupts specific to esp32

  hw_timer_t *Screen_timer = timerBegin(0, 80, true);
  timerAttachInterrupt(Screen_timer, &onScreenTimer, true);
  timerAlarmWrite(Screen_timer, 200, true);
  timerAlarmEnable(Screen_timer);

Will try to figure out what is the equivalent for the older chip. @ph1p am I correct that wiring does not change when using SPI for screen updates? The code that sets the brightness now uses more efficient library that pushes the bits to the shift register (and with brightness value)?