#include #include #ifdef __AVR__ #include // Required for 16 MHz Adafruit Trinket #endif #define PIN 6 #define NUMPIXELS 18 Adafruit_NeoPixel Pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int LED_Ausgabe[8][4]= //Belegung Feld - LED { {0,1,6,7}, //A3 {1,2,7,8}, //A4 {2,3,8,9}, //A5 {4,5,12,13}, //B1 {5,6,13,14}, //B2 {6,7,14,15}, //B3 {7,8,15,16}, //B4 {8,9,16,17} //B5; }; int LED_Ausgabe_1[8][4]= //Belegung Feld - LED { {0,1,6,7}, //A3 {1,2,7,8}, //A4 {2,3,8,9}, //A5 {4,5,12,13}, //B1 {5,6,13,14}, //B2 {6,7,14,15}, //B3 {7,8,15,16}, //B4 {8,9,16,17} //B5; }; // Init ShiftIn instance with a single chip ShiftIn<1> shift; char Belegung[8]; int i=0; int b=0; int lang=0; int x=0; int j=0; int k=0; int s=0; void setup() { Serial.begin(9600); Pixels.begin(); Pixels.show(); // declare pins: pLoadPin, clockEnablePin, dataPin, clockPin shift.begin(8, 9, 11, 12); } void displayValues() { lang=shift.getDataWidth(); // print out all 8 buttons for(i = 0; i < shift.getDataWidth(); i++){ Serial.print( shift.state(i) );// get state of button i Belegung[i] = shift.state(i);} Serial.println(); } void loop() { if(shift.update()){ // read in all values. returns true if any button has changed displayValues(); // Clearing(); for (b=0; b<8; b++){Serial.print(Belegung[b],BIN);}Serial.println(); Serial.print(lang,DEC);Serial.println(); for (x=0;x