MartinNohr / LedImagePainter

New ESP32 version using rotary push button switch.
2 stars 1 forks source link

Command readByte in LedimagePainter #26

Open Beschuitbus opened 3 years ago

Beschuitbus commented 3 years ago

Hello, I'm using Arduino IDE and try to compilate the LedImagePainter.ino. But I get an error for the command readByte: readByte' was not declared in this scope

In which library can I find readByte?

MartinNohr commented 3 years ago

It isn't in a library, it is in the LedImagePainter.ino file. I haven't tried compiling with Arduino IDE, I use Microsoft Visual Studio, but it calls the same compiler so it should work. Did you select the correct processor? Heltec ESP32. int IRAM_ATTR readByte(bool clear) { The IRAM_ATTR is only available for ESP32 I think. If that is correct, send me more information, like which line the error occurs on and the complete error message. If I have time today I'll try and compile with Arduino IDE and see if it works.

MartinNohr commented 3 years ago

OK, I see what it is, MSVC handles forward references differently than Arduino IDE. I'll fix and check in a new version.

MartinNohr commented 3 years ago

OK, I fixed the code for the Arduino IDE. Remember to comment out a line for the original schematic. I made a mistake on the PCB layout. // SB with rotary switch, comment out for original schematic

define PCB_WITH_DIAL 1

Also remember to configure Arduino IDE for partition: Huge model or it won't compile.

MartinNohr commented 3 years ago

Is it working for you now? If so, I'll close this issue.

Beschuitbus commented 3 years ago

Hi Martin,

Thanks for your quick responce and soluction. I've compiled it with ArduinoIDE and it compiled without errors. I'm waiting for some parts (from china) before I can test it.

Again thanks for the good work.

Regards Cor

Op ma 16 nov. 2020 18:50 schreef MartinNohr notifications@github.com:

Is it working for you now? If so, I'll close this issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MartinNohr/LedImagePainter/issues/26#issuecomment-728222514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZ7AHOEZ7UKKYPK63UQAPLSQFRADANCNFSM4TWBVEBQ .

MartinNohr commented 3 years ago

Make sure you comment that line I mentioned or the pins for the switch will be wrong for the schematic. I accidentally changed them when I had the PCB made. I'm redoing the PCB and I will fix those pins again so they match the original schematic. If the switch isn't working then that is likely the problem. Or you could of course just change the wiring to match the code, but in the future I will be making it match the schematic. I only had 5 PCB's made and when they are gone the code will be changed so the default matches the schematic.

MartinNohr commented 3 years ago

Glad you got it to compile. Next wire it up and see if you can get it to work! Let me know if you have any problems. I would also greatly appreciate it if you have any suggestions for improvements. I am making a new version that will work on the TTGO with the color display. It has a higher resolution, and colors! Among other things I'll be able to display the bmp files on the display. The main advantage will be that the menus can be made nicer with the use of colors.

MartinNohr commented 3 years ago

Here's the pcb version. 20201117_081925 20201117_081936 20201115_101548

Beschuitbus commented 3 years ago

Thanks voor the warming, I had already comment that line. I' m stille waiting for the parts, expecting 5 dec. Then I can start testing. 3d printer is already running for some parts. I adapted a tripod mount to the handle and rotating handle.

Regatta Cor

Beschuitbus commented 3 years ago

Some question for the build:

  1. Where do I connect the data to both led strips? In the middle of the stick, separately on both strips (from output 17 and 25) or led1 at the bottom of the stick and at led2 in the middle of the stick?
  2. According to the schematic you do not use the 470 ohm resistor at the beginning of the data of the strips, which is advised to avoid spikes that can damage the first pixel (https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices)
  3. You also don't use a capacitor between the + and - terminals?
MartinNohr commented 3 years ago

You should add that 470 ohm resistor. I forgot, oops. I'll add them to the next version of my PCB. The data lines are both in the middle of the stick when using two. I reverse the data in software going to the bottom stick to deal with that. I originally ran the wire down to the bottom but that seemed silly and messy. Led1 is the bottom stick and Led2 is the upper one. There should probably be a capacitor across the +- of each strip. I watched the signals with my 'scope and never saw any real problems so I didn't bother. Still, it is probably a good idea. About the 470 ohm... since I used a PCB and the wires aren't exposed it probably isn't a big deal, there won't be any spikes coming from the logic level converter. But, you never know!

MartinNohr commented 3 years ago

Thanks for the question on where to hook up the data lines. I will make that clear in the documentation somewhere.

MartinNohr commented 3 years ago

BTW, the reason I used two control pins from the ESP32 is exactly because I wanted to avoid running the wire down the length of the strip. My original design just chained the two strips and used one control pin. I didn't like that long wire!

MartinNohr commented 3 years ago

I just noticed that I broke something in the code for the second LED strip. Oops! I'll fix it in the next couple of days.

MartinNohr commented 3 years ago

Fixed two LED strip handling.

MartinNohr commented 3 years ago
  1. According to the schematic you do not use the 470 ohm resistor at the beginning of the data of the strips, which is advised to avoid spikes that can damage the first pixel (https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices) I didn't worry about those "spikes" because of the way the connections are on the PCB. I don't think it is possible to get spikes from the level translator I'm using. So it should be safe.
MartinNohr commented 3 years ago

The TTGO version is now working. It uses the TTGO T-Display version. It has a lovely color screen. I added the ability to preview the BMP files on the screen. https://github.com/MartinNohr/MagicImageWand