Neuling braucht Hilfe !!! Kategorie: Programmierung (von Konstantin - 5.12.2002 0:09) | |
| |
Hallo! Ich habe vor 2 Tagen eine LCD-Anzeige über I2C an CC2 angeschlossen und ein Prog. reinprogrammeirt. Es funzt, aber die Zahlen blinken bei jedem Sekundenwechsel und ab und zu verschwindet ganz. Was habe ich falsch gemacht? Und noch eine Frage: wie kann ich DAtum, Sek., Min., ändern? Hier ist was ich zusammen gestellt habe: const DOW_NAMES[] = "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"; //----------- thread main //----------- { string s1, s2, s3; s3="Die Uhr"; system.TIME t; int sec; // Synchronisation auf Sekundenwechsel sec = system.second(); wait system.second() != sec; // Zeitstring aufbauen s1 = ""; system.gettime(t); str.putintf(s1, t.hour, 2); str.putchar(s1, ':'); str.putintf(s1, t.minute, 2); str.putchar(s1, ':'); str.putintf(s1, t.second, 2); // Datumsstring aufbauen s2 = DOW_NAMES[system.dow()]; str.putchar(s2, ' '); str.putintf(s2, system.day(), 2); str.putchar(s2, '.'); str.putintf(s2, system.month(), 2); pcflcd.setpcf(8); pcflcd.init(); pcflcd.setLight(1); pcflcd.goto(1, 0); pcflcd.print(s3); // Strings am Display ausgeben pcflcd.goto(1, 12); pcflcd.printlength(s1, str.length(s1)); pcflcd.goto(2, 12); pcflcd.printlength(s2, str.length(s2)); // Doppelpunkte nach ca 1/2 Sekunde ausschalten (für Blinkeffekt) sleep 500; pcflcd.goto(1, 14); pcflcd.put(' '); pcflcd.goto(1, 17); pcflcd.put(' '); } Ich danke im Voraus | |
Antwort schreiben Antworten: ![]() ![]() ![]() ![]() |