On the Arduino I used the lc.setColumn command from the “LedControl.h” library to display text, logos or animations on a 8x11 display. I used e.g. lc.setColumn(chip,column,B10101010) to switch on led 1,3,5,7 on a single column and run through a loop to display all 11 columns which are stored as:
I tried to use the same set of logos on the Photon using the “LedControl-MAX7219-MAX7221.h” library but without success. The MAX7219 chips are working fine but my array with logos is causing “B00000000 was not declared in this scope errors”. When I enter the command setColumn(chip,column,B10101010) in the code I get the same error. If I use setColumn(chip,column,170) or setColumn(chip,column,0XAA) it is working fine but this makes it much more difficult to “draw” a logo compared to the led on/off way I could use on the Arduino.
Is there a way to store and use the data in the “B10101010” format or do I have to convert my matrices? I tried to understand the Photon library but I couldn’t figure out why it works on the Arduino and not on the Photon.
The code compiles using 0xb instead of B, however I don’t get the output as expected.
I did a quick test:
byte Test = 0xb11111111;
setColumn(0,3,Test);
This lights LED 4 and 8 instead of the expected 8 (when I use setColumn(0,3,255)).
I checked “Test” with Serial.println(Test,DEC) and got an output of 17. I then noticed that the columns are displayed upside-down as well. Led 1 and 5 would give 17…
I checked the upside-down thing with setLed(0,0,0,true) to find the first row and first column and that was indeed the other way around.
Glad you moved the ball forward a bit! I am not sure what is going on–can you provide a pointer to the library you are using? Is it in the web IDE?
There are some i2c problems on Photons right now that are being worked on by the team. It could also be related to 16-bit versus 32-bit int datatype difference between Arduino and Particle.
I copied the Particle library I found in the web IDE from Github and included the library files in the offline Particle Dev.
I have the feeling that the communication between the Photon and the MAX7219 is fine. All commands are working as expected except the 0xb11111111 format.
This could very well be. I'm also still puzzled by the output of 17 from the Serial.println(Test,DEC) when byte Test = 0xb11111111