Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
ethersex:c6notizen [2016/03/28 19:47] – t33kanne | ethersex:c6notizen [Unknown date] (aktuell) – Externe Bearbeitung (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Zeile 108: | Zeile 108: | ||
</ | </ | ||
+ | ---- | ||
+ | |||
+ | < | ||
+ | C6_HEADER(`/ | ||
+ | int16_t Temperatur; | ||
+ | |||
+ | CONTROL_START | ||
+ | CLOCK_USED() | ||
+ | |||
+ | THREAD(read_temp) | ||
+ | Temperatur = ONEWIRE_GET(10a00599010800da); | ||
+ | ON abs(Temperatur)> | ||
+ | PIN_SET(LED2); | ||
+ | TTY_SELECT(heiz) | ||
+ | TTY_HOME() | ||
+ | TTY_WRITE(" | ||
+ | END | ||
+ | |||
+ | ON abs(Temperatur)< | ||
+ | PIN_CLEAR(LED2); | ||
+ | TTY_SELECT(heiz) | ||
+ | TTY_HOME() | ||
+ | TTY_WRITE(" | ||
+ | END | ||
+ | | ||
+ | THREAD_END(read_temp) | ||
+ | |||
+ | THREAD(temploop) | ||
+ | int16_t Temperatur = ONEWIRE_GET(10a00599010800da); | ||
+ | dnl max. L des erzeugten Strings: 5 (123.4 bzw. -12.3) | ||
+ | char temp_str[5]; | ||
+ | itoa_fixedpoint(Temperatur, | ||
+ | TTY_SELECT(temp) | ||
+ | TTY_HOME() | ||
+ | TTY_WRITE(`" | ||
+ | WAIT(5) | ||
+ | THREAD_END(temploop) | ||
+ | |||
+ | THREAD(update_clock) | ||
+ | TTY_SELECT(clock) | ||
+ | TTY_HOME() | ||
+ | TTY_WRITE_TIME() | ||
+ | WAIT(1) | ||
+ | THREAD_END(update_clock) | ||
+ | |||
+ | |||
+ | ON STARTUP DO | ||
+ | TTY_CLEAR() | ||
+ | TTY_CREATE_WINDOW(clock, | ||
+ | THREAD_START(update_clock) | ||
+ | |||
+ | TTY_CREATE_WINDOW(temp, | ||
+ | THREAD_START(temploop) | ||
+ | |||
+ | TTY_CREATE_WINDOW(heiz, | ||
+ | THREAD_START(read_temp); | ||
+ | END | ||
+ | |||
+ | CONTROL_END | ||
+ | </ |