I read Nick Gammon's threads 10892 and 11518 about 7 segment and SPI. I bought an 8 digit 7 segment display and loaded and ran the test sketch adjusted for 8 characters but my display is backwards.
To display 16/05/15, I actually have to display 51/50/61. How do I change this.
I tried to ask this in the Gammon Forum but got directed here instead!?
Before you select a digit do some math:
x=7-x.
If x was 7 it becomes 0
If it was 0 it becomes 7
Etc.
Edit: changed 8 to 7
Or
You could reverse you commons wires for the digits.
7 goes where 0 was
6 goes where 1 was
Etc.
Thanks for your responses LarryD
Cannot change wiring as it is a fixed hardware SPI setup on pins 10, 11, 13, GND and 5V.
I switched my brain on and decided to sendByte in reverse. Byte zero of "buf" to 8, byte 1 to 7.... etc. This seems the solution as I can setup and play with the values etc logically - just send in reverse.
Thanks for your replies
It's all in the code.
Larry - you missed the first sentence: "I bought an 8 digit 7 segment display".
Interfacing LED displays with the MAX7219 driver
#include <SPI.h>
#include <bitBangedSPI.h>
#include <MAX7219.h>
const byte chips = 1;
// 1 chip, bit banged SPI on pins 6, 7, 8
MAX7219 display (chips, 6, 7, 8); // Chips / LOAD / DIN / CLK
void setup ()
{
display.begin ();
display.sendString ("HELLO");
} // end of setup
void loop () { }