I was trying to use the 16x24 LED matrix from Adafruit with the Particle Photon. I tried uploading the default example from the Adafruit and I can’t seem to get the display to work even though the example seems to upload fine with no errors. The display works fine on my Arduino UNO. Does anyone know what steps I would need to get this library working? The link to the library is below:
Any help or tips on what I should do next would be appreciated. Thanks!
I confirmed that the code was in fact not being flashed when I was trying to upload it in Particle Dev. It was apparently running some old code that I previously loaded and I didn’t see any errors so I just assumed everything was working.
I am using a seperate 5v source to power both the Photon via the VIN pin and also the LED Matrix so I don’t believe that is the issue.
The display does not light up at all and does not appear to turn on.
I am able to flash other programs to the Photon now and when I attempted to load the basic example from the Adafruit library I now get the following error:
avr/io.h: No such file or directory
I’m not sure where to go from here or if this issue is just because the library I am using is not compatible.
@Proto, thanks for the detailed information. I am not familiar with that library. Maybe one of the guys that is, will have a suggestion (long weekend tho).
I just received the photon a few days ago so this is all new to me. I have limited experience with creating libraries and I’ve also have never tried to port one over to work with the photon before so I don’t know if I’ll be able to figure it out. To answer your questions:
I commented out the #if(ARDUINO >= 100) and replaced it with #include “application.h”. I’m not sure if this is all I need to do here.
I was attempting to use the basic demo.pde so I renamed the sketch as ht1632test.ino and placed it in a folder called ht1632test with the HT1632.cpp, HT1632.h and glcdfont.c files. (I can attempt to compile the code but I just encounter several different errors). I have not yet changed the values for DATA, WR and CS.
Upon more review, I noticed that this library has several bits of code that are AVR specific some of which I listed below:
–glcdfont.c
avr/io.h and avr/pgmspace.h with PROGMEM macro which would not be applicable for the photon
–HT1632.cpp
__BV macro
I’m not sure what the next step is but I’m sure I would have to update all of these. I am going to take another look tomorrow. Thanks so far for the help!
But at the moment it’s still solely focused on the Particle Core and not the Photon, you’ll get some idea tho’.
The conditional compiling directive for the Photon would be #if (PLATFORM_ID == 6) instead of #if defined(SPARK) (for the Core it’s now PLATFORM_ID == 0).
After having a look at the lib I’m convinced you can manage to port the lib with only the hints from the link above. There is no bare metal programming that would need some major rework of the original code.
But if you should still happen to have problems getting the hang of it, just ask, we’re there to help, when we see your effort.
Any error messages you get after porting would be good to post too.
One bit missing in the link above:
#define _BV(x) (1 << x)
Since you haven’t changed the pin assignment, how have you wired the display?
Although it’s discouraged to use the “number-only” pin referencing on Particle devices (rather use the labels printed on the board) it’ll still work when you wire up D2, D3, D4.
Thanks very much! That link was super helpful. I was just able to get the test program to work and everything looks good. I also ran the other two examples in the library and they are both working. This is great!