Skip to content

Instantly share code, notes, and snippets.

@bartoszbielawski
Created March 11, 2020 15:05
Show Gist options
  • Save bartoszbielawski/143dee460015ef41cb8250072d506686 to your computer and use it in GitHub Desktop.
Save bartoszbielawski/143dee460015ef41cb8250072d506686 to your computer and use it in GitHub Desktop.
Custom 7seg
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
@Belamat
Copy link

Belamat commented Mar 11, 2020

//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

}

@bartoszbielawski
Copy link
Author

Please, let's keep it in the issue, for future users who may have the same problem :)

@Belamat
Copy link

Belamat commented Mar 11, 2020

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