Led matrix on orion board


#1

Hello.
I am programming an Orion board with several sensors (line follow and Distance bluetooth)
i Also have the LED matrix is available. how Can i program the LED with Mblock online or the APP on my phone? i cant find an extension for this.

Thanks


#2

I haven’t actually set up an Orion board with a Led Matrix display but I am assuming that if you go into the Web version of mBlock 5’s Arduino C editor then you can copy and paste in the following code and run it in upload mode:

#include <MeOrion.h>
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

MeLEDMatrix ledMtx_1(1);
unsigned char drawBuffer[16];
unsigned char *drawTemp;

void _delay(float seconds) {
long endTime = millis() + seconds * 1000;
while(millis() < endTime) _loop();
}
void setup() {
ledMtx_1.setColorIndex(1);
ledMtx_1.setBrightness(6);

drawTemp = new unsigned char[16]{0,0,60,126,126,60,0,0,0,0,60,126,126,60,0,0};
memcpy(drawBuffer, drawTemp, 16);
free(drawTemp);
_delay(1);
ledMtx_1.clearScreen();
ledMtx_1.drawBitmap(0, 0, 16, drawBuffer);

ledMtx_1.drawStr(0, 0 + 7, String(“Hendrie”).c_str());

}
void _loop() {
}
void loop() {
_loop();
}


#3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.