Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command readByte in LedimagePainter #26

Open
Beschuitbus opened this issue Nov 15, 2020 · 17 comments
Open

Command readByte in LedimagePainter #26

Beschuitbus opened this issue Nov 15, 2020 · 17 comments

Comments

@Beschuitbus
Copy link

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
Copy link
Owner

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
Copy link
Owner

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

@MartinNohr
Copy link
Owner

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
Copy link
Owner

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

@Beschuitbus
Copy link
Author

Beschuitbus commented Nov 16, 2020 via email

@MartinNohr
Copy link
Owner

MartinNohr commented Nov 17, 2020

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
Copy link
Owner

MartinNohr commented Nov 17, 2020

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
Copy link
Owner

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

@Beschuitbus
Copy link
Author

Beschuitbus commented Nov 18, 2020 via email

@Beschuitbus
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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

@MartinNohr
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

Fixed two LED strip handling.

@MartinNohr
Copy link
Owner

  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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants