PieterP:
Sounds like you still didn't read the link I keep referring to.
Sorry if it sounds that way. I don't know what else to say, except I have multiple times and doesn't change anything.
PieterP:
Sounds like you still didn't read the link I keep referring to.
Sorry if it sounds that way. I don't know what else to say, except I have multiple times and doesn't change anything.
adwsystems:
Sorry if it sounds that way. I don't know what else to say, except I have multiple times and doesn't change anything.
Then perhaps you should, as suggested, ask specific questions about the concepts that you don't understand.
adwsystems:
The code in the post says nothing of SPI
It's right here:
void sendRaw(uint8_t opcode, uint8_t value) {
ExtIO::digitalWrite(loadPin, LOW);
SPI.beginTransaction(settings);
SPI.transfer(opcode);
SPI.transfer(value);
ExtIO::digitalWrite(loadPin, HIGH);
SPI.endTransaction();
}
To make it easy for you, just use the LEDControl library. For your application it makes no difference which library you end up using as long as it supports 7 segment displays (so MaxMatrix and MD_MAX72xx are probably not relevant). You don't need a high performance library nor do you need fast update times. LedControl has also been around long enough that you will find lots of examples to study (or ignore).
If you want to learn how SPI works, then the code you have been given (in the post or linked to) will allow you to do so.
PieterP:
It's right here:void sendRaw(uint8_t opcode, uint8_t value) {
ExtIO::digitalWrite(loadPin, LOW);
SPI.beginTransaction(settings);
SPI.transfer(opcode);
SPI.transfer(value);
ExtIO::digitalWrite(loadPin, HIGH);
SPI.endTransaction();
}
But these 20 lines don't.
/**
* @brief Display a long integer number to the display.
* The number will be right-aligned.
*
* @param number
* The number to display.
* @param startDigit
* The digit (zero-based, counting from the right) to start
* printing the number.
* Digits: 7 6 5 4 3 2 1 0
* @param endDigit
* The last digit (zero-based, counting from the right) that can
* be printed.
* If the number is larger than `endDigit - startDigit`, the number
* is truncated on the left. If the number is smaller than
* `endDigit - startDigit`, the leftmost digits including
* `endDigit` are cleared.
* @return The number of digits that have been overwritten
* (`endDigit - startDigit`).
*/
uint8_t display(long number, uint8_t startDigit = 0, uint8_t endDigit = 7) {
long anumber = abs(number);
uint8_t i = startDigit + 1;
endDigit++;
do {
sendRaw(i++, anumber % 10);
anumber /= 10;
} while (anumber && i <= endDigit);
if (number < 0 && i <= endDigit)
sendRaw(i++, 0xA); // minus sign
while (i <= endDigit)
sendRaw(i++, 0xF); // clear unused digits within range
return endDigit - startDigit;
}
I didn't realize until the last post which 20 lines you were referring to, hence the code snippet comment.
gfvalvo:
Then perhaps you should, as suggested, ask specific questions about the concepts that you don't understand.
I have been asking. I have been trying to understand Crossroads post. The replies have ALL skipped (at least) a step. There hasn't been a single explanation, just the answer provided. Like having never driven a stick shift car and asking what the third pedal is and the response is "just push it in when you shift". That doesn't tell you what the pedal is, what it is for, or how to use it.
marco_c:
To make it easy for you, just use the LEDControl library. For your application it makes no difference which library you end up using as long as it supports 7 segment displays (so MaxMatrix and MD_MAX72xx are probably not relevant). You don't need a high performance library nor do you need fast update times. LedControl has also been around long enough that you will find lots of examples to study (or ignore).
Thank you. Finally an answer to the OP.
P.S. I like the "ignore" comment. Many examples are so poorly written they need to be ignored to keep ones sanity.