ich hoffe hier sind ein paar Pico C-Cracks vertreten, die mir weiterhelfen können. Ich habe mir ein Pico C-Programm geschrieben um meine Müllabholungen die ich aus dem Google-Kalender via VI auslese auszuwerten und mir zu sagen welcher Müll demnächst abgeholt wird. Leider funktioniert das Programm nur beim ersten mal und dann wird es nicht mehr aktualisiert. Ich vermute mal, dass die Input-Werte nicht aktualisiert werden, weil sie nicht in der Schleife enthalten sind. Wenn ich diese jedoch dort einbastle funktioniert das ganze nicht mehr. Also hier nun der Code um den es geht:
// write program here in PicoC int f1 = getinput (0); int f2 = getinput (1); int f3 = getinput (2); int f4 = getinput (3); int Papier = 0; int Haus = 0; int Gelb = 0; int Bio = 0; while(TRUE) { if (f1 < 0) {Papier = 6;} else {Papier = f1;} if (f2 < 0) {Haus = 6;} else {Haus = f2;} if (f3 < 0) {Gelb = 6;} else {Gelb = f3;} if (f4 < 0) {Bio = 6;} else {Bio = f4;} if ((Papier == -1) && (Haus == -1) && (Gelb == -1) && (Bio == -1)) {setoutput(0,0);} if ((Papier < Haus) && (Papier < Gelb) && (Papier < Bio)) {setoutput(0,1);} if ((Haus < Papier) && (Haus < Gelb) && (Haus < Bio)) {setoutput(0,2);} if ((Gelb < Papier) && (Gelb < Haus) && (Gelb < Bio)) {setoutput(0,3);} if ((Gelb == Bio) && (Gelb < Papier) && (Gelb < Haus)) {setoutput(0,3);} if ((Bio < Papier) && (Bio < Haus) && (Bio < Gelb)) {setoutput(0,4);} sleeps(60); }
Gruß Negropo
Kommentar