Translations:DCC/15/de
Aus Digital Modellbahn
#include <DCCPacketScheduler.h> | Einbinden der Library |
DCCPacketScheduler dcc; | Erzeugen der Klasse |
void setup() | |
---|---|
dcc.setup(uint8_t pin = 6, uint8_t format = ROCO); | Initialisierung der Library kein Railcom optional: Ausgabe PIN (Default = 6) Zubehör Adressverschiebung: format => 0 = ROCO; 4 = IB; |
dcc.setup(uint8_t pin, uint8_t pin2, bool EnRailCom, uint8_t format = ROCO); | Initialisierung der Library Railcom support aktivierbar invertierter zweiter DCC Ausgang wählbar |
dcc.setpower(bool state); | Zustand der Gleisspannung (ON/OFF) state => false = OFF; true = ON; Grundzustand ist state = OFF! |
void loop() | |
dcc.update(); | Gleisdaten verarbeiten Kein delay verwenden! |
other public functions | |
---|---|
byte getpower(void); | Rückgabe Gleisspannungszustand (OFF, ON, ESTOP, SERVICE) |
void eStop(void); | Halt für alle Lokomotiven Gleisspannungszustand = ESTOP |
Loksteuerung | |
bool setSpeed14(uint16_t address, uint8_t speed); | Lok mit 14 Fahrstufen steuern speed = DSSS SSSS (D = Dir; S = Geschw.) |
bool setSpeed28(uint16_t address, uint8_t speed); | Lok mit 28 Fahrstufen steuern speed = DSSS SSSS (D = Dir; S = Geschw.) |
bool setSpeed128(uint16_t address, uint8_t speed); | Lok mit 128 Fahrstufen steuern speed = DSSS SSSS (D = Dir; S = Geschw.) |
void getLocoStateFull(uint16_t adr, bool bc); | Abfrage aller Daten zur gewählten Adresse Antwort: notifyLokAll() |
byte getLocoDir(uint16_t adr); | Abfrage der Fahrtrichtung Antwort: true/false |
byte getLocoSpeed(uint16_t adr); | Abfrage der Geschwindigkeit mit Fahrtrichtung Antwort: DSSS SSSS |
Lok Funktionen (F0 bis F28) | |
void setLocoFunc(uint16_t address, uint8_t type, uint8_t fkt); | Schalten einer Lokfunktion type => 0 = AUS; 1 = EIN; 2 = UM; fkt => 0..28 = Funktion |
bool setFunctions0to4(uint16_t address, uint8_t functions); | Schalten der Lokfunktionen F0 bis F4 functions = 0 0 0 F0 F4 F3 F2 F1 |
bool setFunctions5to8(uint16_t address, uint8_t functions); | Schalten der Lokfunktionen F5 bis F8 functions = 0 0 0 0 F8 F7 F6 F5 |
bool setFunctions9to12(uint16_t address, uint8_t functions); | Schalten der Lokfunktionen F9 bis F12 functions = 0 0 0 0 F12 F11 F10 F9 |
bool setFunctions13to20(uint16_t address, uint8_t functions); | Schalten der Lokfunktionen F13 bis F20 functions = F20 F19 F18 F17 F16 F15 F14 F13 |
bool setFunctions21to28(uint16_t address, uint8_t functions); | Schalten der Lokfunktionen F21 bis F28 functions = F28 F27 F26 F25 F24 F23 F22 F21 |
byte getFunktion0to4(uint16_t address); | Abfrage Funktionszustand F0 bis F4 Antwort: 0 0 0 F0 F4 F3 F2 F1 |
byte getFunktion5to8(uint16_t address); | Abfrage Funktionszustand F5 bis F8 Antwort: 0 0 0 0 F8 F7 F6 F5 |
byte getFunktion9to12(uint16_t address); | Abfrage Funktionszustand F9 bis F12 Antwort: 0 0 0 0 F12 F11 F10 F9 |
byte getFunktion13to20(uint16_t address); | Abfrage Funktionszustand F13 bis F20 Antwort: F20 F19 F18 F17 F16 F15 F14 F13 |
byte getFunktion21to28(uint16_t address); | Abfrage Funktionszustand F21 bis F28 Antwort: F28 F27 F26 F25 F24 F23 F22 F21 |
Basic Accessory (Zubehör Befehle) | |
bool setBasicAccessoryPos(uint16_t address, bool state); | Schalten einer Weiche state => true = abzweig; false = gerade; |
bool setBasicAccessoryPos(uint16_t address, bool state, bool activ); | Schalten einer Weiche mit Spulenzustand state => true = abzweig; false = gerade; Drücken: activ = true; Loslassen: activ = false |
bool getBasicAccessoryInfo(uint16_t address); | Abfrage Weichenzustand Antwort: true = abzweig; false = gerade; |
CV Programmierung | |
bool opsProgDirectCV(uint16_t CV, uint8_t CV_data); | CV-Programmierung im "Direct-Mode" |
bool opsProgramCV(uint16_t address, uint16_t CV, uint8_t CV_data); | POM-CV-Programmierung Hinweis: Nicht getestet! |
bool opsDecoderReset(void); | Sendet Reset Paket zu allen Dekodern Automatisch bei opsProgCirectCV() und opsProgramCV() |
C++ call back functions | |
---|---|
void notifyLokAll(uint16_t Adr, uint8_t Steps, uint8_t Speed, uint8_t F0, uint8_t F1, uint8_t F2, uint8_t F3, bool bc) | Antwort auf Nachfrage getLocoStateFull() |
void notifyTrnt(uint16_t Adr, bool State) | Aufruf bei Änderung des Weichenzustand |
void notifyPowerOFF() | Information über Abschaltung der Gleisspannung nach erfolgter Programmierung. |