Skip to content

Instantly share code, notes, and snippets.

@xxlukas42
Created May 15, 2019 18:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxlukas42/fad2ca1bb96a6c9fd8b0101803265ff4 to your computer and use it in GitHub Desktop.
Save xxlukas42/fad2ca1bb96a6c9fd8b0101803265ff4 to your computer and use it in GitHub Desktop.
Blue LED matrix display 8x16 for your Arduino
/**
* \par Copyright (C), 2012-2016, MakeBlock
* @file Me_LEDMatrixTest.ino
* @author MakeBlock (modified by Petr Lukas)
* @version V1.0.0
* @date 2019/05/12
* @brief Description: this file is sample code for Me LED Matrix device.
*
* Function List:
* clearScreen() Remove content of display
* setBrightness(uint8_t Bright) Brigthness of LED display (0 to 8)
* drawBitmap(int8_t x, int8_t y, uint8_t Bitmap_Width, uint8_t *Bitmap)
* showClock(uint8_t hour, uint8_t minute, bool = PointOn)
* drawStr(int16_t X_position, int8_t Y_position, const char *str)
* showNum(float value,uint8_t = 3)
* setColorIndex(bool Color_Number) 1 = normal mode, 0 = reverse colors mode
*/
#include "MeOrion.h";
MeLEDMatrix ledMx(8,2);
void setup()
{}
void loop()
{
ledMx.setBrightness(1);
ledMx.setColorIndex(1);
// Simple lines
const unsigned char bitmap[] = {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01};
ledMx.drawBitmap(0,-7,16,bitmap);
delay(1000);
ledMx.drawBitmap(0,0,16,bitmap);
delay(1000);
// Simple scroll animation
for(int i = 0; i <= 15; i++){
for(int j = -7; j <= 0; j++){
ledMx.clearScreen();
const unsigned char bitmap[] = {0x01};
ledMx.drawBitmap(i,j,1,bitmap);
delay(50);
}
}
delay(1000);
// Clocks display test
bool point = true;
for(int i = 0; i <= 10; i++){
ledMx.showClock(12,34,point);
point = !point;
delay(500);
}
delay(2000);
// String display test
char *s = "ABC";
for(int i = 0; i <= 15; i++){
ledMx.drawStr(i,7,s);
delay(250);
}
delay(2000);
// Float display test
ledMx.showNum(3.14);
delay(2000);
// Brigthtness and color inversion test
ledMx.setColorIndex(0);
delay(500);
for(int i = 0; i <= 8; i++){
ledMx.setBrightness(i);
ledMx.showNum(i);
delay(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment