a
Dependencies: Led-libary TextLCD mbed
Fork of Mbed-Mensch-8 by
Diff: main.cpp
- Revision:
- 27:15a37d3fb5c5
- Parent:
- 26:de10b06e7d4d
- Child:
- 28:94a949b0f03a
diff -r de10b06e7d4d -r 15a37d3fb5c5 main.cpp --- a/main.cpp Fri Apr 08 10:16:45 2016 +0000 +++ b/main.cpp Fri Apr 08 11:37:12 2016 +0000 @@ -80,6 +80,7 @@ char whichcolor; uint32_t changecolor[3]; char selctecolor = 0;//1..R ,2...G,3...B +char KI[4] = {0,0,0,0}; @@ -141,18 +142,19 @@ void accept(); void exit(); void print_menu(); +void print_zus(); void print_pos(); void print_default(); void posUpdate(); char ausfuehren(uint32_t postion); -//string test (""); +//string test (""); 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 // "1234567890123456789","1234567890123456789","1234567890123456789","1234567890123456789", ,"1234567890123456789","1234567890123456789","1234567890123456789", -const char* const text_ln0[] = { "MENU: ", "Spiel-Menu: ", "Anzeige-Menu: ", "Speicher-Menu: ", "ERROR ", "7.Zustand-Menu: ", "Farben-Menu: ", "Spiel-Menu: ", "Spielregeln-Menu: ", "Spielregeln-Menu: ", "Hell./Sp.Led-Menu: ", "Config-Menu: ", "Autplay-zeit ", "Autplay-Menu: ", "Wurfel-Menu: ", "Ofline/Com-Menu: ", "Enable/Manuell ", "Farben ", "Helligkeit Wert ", "Sp.Led-Verhalten ", "Farbverhalten ", "Farbverhalten def ", "Helligkeit Wert " }; -const char* const text_ln1[] = { "Spiel ", "7.Zustand ", "Farben ", "Spiel ", " ", "Disable ", " ", "Laden ", "Taktik 1 ", "Smeiszwang <I/0> ", "Wert: <wert> ", "Laden ", "normal ", "Zeit ", "Farbverhalten ", "New ", " ", "R: ", "100% ", "Verhalten 1 ", "fixe Farbe ", "Standart ", "100% " }; -const char* const text_ln2[] = { "Anzeige ", "Spielregeln ", "Hellichkeit/Sp.Led ", "Config. ", " ", "kleinstmoglich ", "SP: 1 2 3 4 ", "Speichern ", "Taktik 2 ", "Go Home first <I/0>", "Sp.Led-Verhalten ", "Speichern ", "x2 ", "Agro/Taktik ", "Farb def ", "Reset ", " ", "G: ", "75% ", "Verhalten 2 ", "Spieler Farbe ", "erlaubt ", "75% " }; -const char* const text_ln3[] = { "Speicher ", "Autoplay ", "Wurfel ", "Ofline/Com ", " ", "grostmoglich ", " ", "Reset ", "Taktik 3 ", "Ausfahrzwang <I/0> ", "Andert: <wert> fehl", "Reset ", "x4 ", "Enable/Manuell ", "Hellichkeit ", "Com ", " ", "B: ", "50% ", "Verhalten 3 ", "3 Farben ", "verboten ", "50% " }; -char textPos[] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x4, 0x9, 0xA, 0xB, 0x4, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x11, 0x17, 0x18, 0x19, 0x12, 0x1B, 0x1C, 0xC, 0x14, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x11, 0x27, 0x28, 0x29, 0x13, 0x2B, 0x10, 0x2D, 0x15, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x11, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x16, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x11, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x11, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F }; +const char* const text_ln0[] = { "MENU: ", "Spiel-Menu: ", "Anzeige-Menu: ", "Speicher-Menu: ", "ERROR ", "7.Zustand-Menu: ", "Farben-Menu: ", "Spiel-Menu: ", "Spielregeln-Menu: ", "Spielregeln-Menu: ", "Hell./Sp.Led-Menu: ", "Config-Menu: ", "Autplay-zeit ", "Autplay-Menu: ", "Wurfel-Menu: ", "Ofline/Com-Menu: ", "Enable/Manuell ", "Farben ", "Helligkeit Wert ", "Sp.Led-Verhalten ", "Farbverhalten ", "Farbverhalten def ", "Helligkeit Wert ","KI-Menu "}; +const char* const text_ln1[] = { "Spiel ", "7.Zustand ", "Farben ", "Spiel ", " ", "Disable ", " ", "Laden ", "Taktik 1 ", "Smeiszwang <I/0> ", "Wert: <wert> ", "Laden ", "normal ", "Zeit ", "Farbverhalten ", "New ", " ", "R: ", "100% ", "Verhalten 1 ", "fixe Farbe ", "Standart ", "100% "," "}; +const char* const text_ln2[] = { "Anzeige ", "Spielregeln ", "Hellichkeit/Sp.Led ", "Config. ", " ", "kleinstmoglich ", "SP: 1 2 3 4 ", "Speichern ", "Taktik 2 ", "Go Home first <I/0>", "Sp.Led-Verhalten ", "Speichern ", "x2 ", "Agro/Taktik ", "Farb def ", "Reset ", " ", "G: ", "75% ", "Verhalten 2 ", "Spieler Farbe ", "erlaubt ", "75% ","SP: 1 2 3 4 " }; +const char* const text_ln3[] = { "Speicher ", "Autoplay ", "Wurfel ", "Ofline/Com ", " ", "grostmoglich ", " ", "Reset ", "Taktik 3 ", "Ausfahrzwang <I/0> ", "Andert: <wert> fehl", "Reset ", "x4 ", "Enable/Manuell ", "Hellichkeit ", "Com ", " ", "B: ", "50% ", "Verhalten 3 ", "3 Farben ", "verboten ", "50% "," "}; +char textPos[] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x4, 0x9, 0xA, 0xB, 0x4, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x11, 0x17, 0x18, 0x19, 0x12, 0x1B, 0x1C, 0xC, 0x14, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x11, 0x27, 0x28, 0x29, 0x13, 0x2B, 0x10, 0x2D, 0x15, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x11, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x17, 0x16, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x11, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x11, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F }; char VHS = 0; char mSelected[256]; @@ -1284,6 +1286,10 @@ //Farbe -> R selctecolor = 1; break; + case 0x3d: + VHS = 1; + + break; case 0x56: out = 0; //Farbe -> R @@ -1296,7 +1302,48 @@ else mSelected[depth - 1]++; break; - + case 0x7d: //Ki enable p1 + out = 0; + VHS = 1; + if(KI[0]) + { + KI[0]=0; + }else{ + KI[0]=1; + } + break; + case 0xbd: + out = 0; + VHS = 1; + if(KI[1]) + { + KI[1]=0; + }else{ + KI[1]=1; + } + break; + + case 0xfd: + out = 0; + VHS = 1; + if(KI[2]) + { + KI[2]=0; + }else{ + KI[2]=1; + } + break; + case 0x13d: + out = 0; + VHS = 1; + if(KI[3]) + { + KI[3]=0; + }else{ + KI[3]=1; + } + break; + default: break; } @@ -1474,6 +1521,7 @@ lcd.locate(1, 3); lcd.printf(text_ln3[textPos[postion]]); port.printf("D%c%c%s\n", 28, 30, text_ln3[textPos[postion]]); + print_zus(); } void print_pos() @@ -1496,9 +1544,9 @@ port.printf("D%c%c \n", 27, 27); lcd.putc(' '); - lcd.locate(4 * mSelected[depth - 1], 3); + lcd.locate(4 * mSelected[depth - 1]+1, 3);//erst x dann y lcd.putc('^'); - port.printf("D%c%c^\n", 27 + 4 * mSelected[depth - 1], 27 + 3); + port.printf("D%c%c^\n", 27 + 4 * mSelected[depth - 1]+1, 27 + 3); } } else @@ -1538,4 +1586,46 @@ port.printf("D%c%c \n", 27, 28); port.printf("D%c%c \n", 27, 29); port.printf("D%c%c12345678901234567890\n", 27, 30); +} +void print_zus() +{ + switch(postion){ + case 0x3d: + lcd.locate(5,1);//erst x dann y + if(KI[0]) + { + lcd.putc('I'); + }else{ + lcd.putc('0'); + } + lcd.locate(9,1);//erst x dann y + if(KI[1]) + { + lcd.putc('I'); + }else{ + lcd.putc('0'); + } + lcd.locate(13,1);//erst x dann y + if(KI[2]) + { + lcd.putc('I'); + }else{ + lcd.putc('0'); + } + lcd.locate(17,1);//erst x dann y + if(KI[3]) + { + lcd.putc('I'); + }else{ + lcd.putc('0'); + } + break; + default: + break; + + + } + + + } \ No newline at end of file