first commit
This commit is contained in:
80
src/main.cpp
Normal file
80
src/main.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
#include <FastLED.h>
|
||||
#include <MyClass.h>
|
||||
#include <BlinkInternLed.h>
|
||||
#include <LedMatrix.h>
|
||||
#include <font_5x7.h>
|
||||
|
||||
LedMatrix matrix;
|
||||
|
||||
void printCharMatrixSimple(char c)
|
||||
{
|
||||
const uint8_t *fontData = getFontChar(c);
|
||||
|
||||
Serial.println();
|
||||
Serial.print("'");
|
||||
Serial.print(c);
|
||||
Serial.println("':");
|
||||
|
||||
String mtrx = "";
|
||||
for (int row = 0; row < 7; row++)
|
||||
{
|
||||
uint8_t line = fontData[row];
|
||||
for (int col = 0; col < 5; col++)
|
||||
{
|
||||
if (line & (1 << (4 - col)))
|
||||
{
|
||||
mtrx += "•";
|
||||
Serial.print("#"); // Einfaches # für Pixel
|
||||
}
|
||||
else
|
||||
{
|
||||
mtrx += ".";
|
||||
Serial.print("."); // Punkt für leere Pixel
|
||||
}
|
||||
}
|
||||
mtrx += "\n\r";
|
||||
Serial.println();
|
||||
}
|
||||
Serial.println(mtrx);
|
||||
}
|
||||
|
||||
void playWithBlinkLed()
|
||||
{
|
||||
BlinkInternLed internLed = BlinkInternLed();
|
||||
String led_status = internLed.ledStatus();
|
||||
Serial.println("PinStatus: " + led_status);
|
||||
|
||||
internLed.on();
|
||||
delay(200);
|
||||
led_status = internLed.ledStatus();
|
||||
Serial.println("PinStatus: " + led_status);
|
||||
|
||||
internLed.off();
|
||||
delay(200);
|
||||
led_status = internLed.ledStatus();
|
||||
Serial.println("PinStatus: " + led_status);
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
matrix.setBrightness(255);
|
||||
|
||||
matrix.clear();
|
||||
matrix.show();
|
||||
|
||||
// Draw static "HELLO WORLD"
|
||||
matrix.drawText(1, 1, "Hello", CRGB::Red);
|
||||
matrix.drawText(35, 1, "World", CRGB::Blue);
|
||||
matrix.drawText(1, 20, "<°|`¶>", CRGB::Yellow);
|
||||
matrix.drawText(1, 30, "Bottom", CRGB::Yellow);
|
||||
matrix.show();
|
||||
|
||||
// printCharMatrixSimple('S');
|
||||
|
||||
// playWithBlinkLed();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
delay(1000);
|
||||
}
|
||||
Reference in New Issue
Block a user