Skip to content

enginorama/DccAccessoryDecoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCC Accessory Decoder

ESP32 library for a DIY DCC Accessory Decoder

This project is based on DCCInspector-EX. Checkout the repository for more information.

Usage with platform io

You can add this library by adding it to you platformio.ini

lib_deps =
  https://github.com/enginorama/DccAccessoryDecoder

and follow the example.

#include <Arduino.h>
#include <DccAccessoryDecoder.h>

void onAccessoryPacket(unsigned int linearDecoderAddress, bool enabled) {
  digitalWrite(BUILTIN_LED, enabled ? 1 : 0);
  Serial.print("Change in Accessory ");
  Serial.print(linearDecoderAddress);
  Serial.print(" -> ");
  Serial.println(enabled);
}

void setup() {
  Serial.begin(115200);
  DccAccessoryDecoder.begin(19, onAccessoryPacket);
  Serial.println("Start sending turnout commands.");
}

void loop() {
  DccAccessoryDecoder.loop();
}

About

ESP32 library for a DIY DCC Accessory Decoder

Resources

License

Stars

Watchers

Forks

Contributors