#include <Arduino.h>
#include <FastLED.h>
#define DATA_PIN 22
const int width = 32; // links nach rechts = 0 : 31
const int height = 8; // oben nach unten = 0 : 7
const int NUM_LEDS = (width*height);
const uint8_t INT6x4[10][6] = {
{6,9,9,9,9,6}, // 0
{6,7,6,6,6,6}, // 1
{}, // 2
{}, // 3
{}, // 4
{}, // 5
{}, // 6
{}, // 7
{}, // 8
{} // 9
};
CRGB leds[NUM_LEDS];
int rundum = 0;
struct cursor {
int x = 0;
int y = 0;
} cursor;
bool set_cursor(int x,int y){
if (x > 0 && y > 0){
cursor.x = x;
cursor.y = y;
return true;
}
else return false;
}
int xValue (int h=0, int w=0){
return w+cursor.x+cursor.y*width+h*width;
}
void print_num(int c, int x=0, int y=0){
for (int h = 0;h<6;h++){
for (int w=0;w<4;w++){
Serial.println(w+x<width?w+x:w+x-width);
if (INT6x4[c][h]>>w&1)leds[(w+x)+y*width+h*width]=CRGB::White;
else leds[(w+x)+y*width+h*width]=CRGB::Black;
// if (INT6x4[c][h]>>w&1)leds[xValue(h,w)]=CRGB::White;
// else leds[xValue(h,w)]=CRGB::Black;
}
}
}
void setup() {
Serial.begin(9600);
Serial.println("Test:");
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}
void loop() {
print_num(1,4,1);
FastLED.show();
delay(500);
print_num(0,4,1);
FastLED.show();
delay(500);
print_num(1,30,1);
FastLED.show();
delay(500);
print_num(0,30,1);
FastLED.show();
delay(500);
// if (++rundum > width) rundum = 0;
FastLED.clear();
}