
|
INFO - FAQ - CC2-Forum - CCPro-Forum |
|
||
|
Hallo Klaus, Zum Transistor: Datenblätter lesen, gibt es z.B. bei Conrad od. Reichelt. Für Taster auch mal die Suchfunktion im Forum benutzen. Ein Codebeispiel: '************************************************************************************ '* C-CONTROL - BASIC / APPLICATION '* - Ports liegen mit 10KOhm an 5V, Taster schalten Ports nach GND '************************************************************************************ ' ' ----------------------------- definition ------------------------------------------ ' ' pin define taste_hoch port[15] define taste_runter port[16] define DA_Port DA[1] ' ' variable define DA_Wert byte ' ' constant define DA_Wert_min 1 define DA_Wert_max 254 ' ' ------------------------------- main program ------------------------------------- ' #main_program if (not taste_hoch) then gosub taste_hoch if (not taste_runter) then gosub taste_runter DA_Port = DA_Wert pause 5 goto main_program end ' '-------------------------------- taste_hoch --------------------------------------- ' #taste_hoch if DA_Wert > DA_Wert_max then return DA_Wert = DA_Wert + 1 return ' '-------------------------------- taste_runter ------------------------------------- ' #taste_runter if DA_Wert < DA_Wert_min then return DA_Wert = DA_Wert - 1 return ' '-------------------------------------end of program-------------------------------- Gruß Manfred Meine Homepage: http://www.malo-web.de |
| Antwort schreiben |