-
-
Save bartoszbielawski/143dee460015ef41cb8250072d506686 to your computer and use it in GitHub Desktop.
Custom 7seg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LEDMatrixDriver lmd(1, SS_PIN); | |
//other init (enabled, intensity...) | |
uint8_t* digits = lmd.getFrameBuffer(); | |
for (int i = 0; i < 8; i++) | |
{ | |
digits[i] = 1 << i; | |
}; | |
lmd.display(); | |
uint8_t digitMap[] = {...}; | |
digits[0] = digitMap[0]; //display zero at 0th position |
Please, let's keep it in the issue, for future users who may have the same problem :)
Pasted again in the issue (sorry im not used to github)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//couldnt get a character, probably doing something wrong (got many mixed ones //turned on and off)
#include <LEDMatrixDriver.hpp>
const int NO_OF_DRIVERS = 1;
LEDMatrixDriver lmd(1, A2);
void setup() {lmd.setEnabled(true);
lmd.setIntensity(2); // 0 = min, 15 = max
lmd.setScanLimit(7); // 0-7: Show 1-8 digits. Beware of currenct restrictions for 1-3 digits! See datasheet.
lmd.setDecode(0xFF); // Enable "BCD Type B" decoding for all digits.
// no setup needed
}
void loop() {
uint8_t* digits = lmd.getFrameBuffer();
for (int i = 0; i < 8; i++){
digits[i] = 1 << i;
}
lmd.display();
uint8_t digitMap[] = {B11110000};
digits[0] = digitMap[0]; //display zero at 0th position
}