Looking forward to an update on your progress with this - I've just started looking at using B4R to program a DCC project...
Thanks for your request = Let me give a brief status update on this project named Shunter63.
A first solution is working, means can control a single loco and two turnouts. The controller is an Arduino MEGA with Arduino Motor Shield. Controlled is via Node-RED (serial line) or B4A (Bluetooth classic). An LCD dispay shows the status of the loco and the turnouts.
Have put this project on hold as became rather complex and therfor decided to work further later this year.
Now and then I play a bit for fun and to think about new ideas.
Have not documented a lot yet, also wanted to checkout the newer version of the
CommandStation-EX v3.1.0 Production Release.
Also want some time to rethink solutions esp with the B4R library rDCCEX.
You can sent me a PM if want to know more.
Screenshot Arduino Mega Controller+Arduino Motor Shield+Bluetooth Classic+Buffer Stop+LCD2004+LED RED,BLUE,YELLOW
RED Led ON=Power is ON, BLUE LED ON=Train is running (at 30kmh).
Screenshot B4A Client
The DCC Cmd enables to issue DCC commands interactive. The DCC Log shows DCC command responses.
Status
B4R library rDCCEX - Partial wrapper for the CommandStation-Ex
Based on DCCEX version 3.0.0 Nov 2020.
Completed
B4R DCCEx Controller - Model railway DCC controller handling DCC-EX commands via serial line or bluetooth classic.
Completed.
B4X:
DCC-Commands are received (as text ending with CRLF) via Serial Line (USB) or Bluetooth Classic (Name SHUNTER63, MAC 98:D3:51:FD:A8:19, Pin 1234).
DCC-EX Command Examples (submitted without brackets < >):
- Power ON MAIN: 1 MAIN
- Drive loco ID 3 speed 10 direction right 1: t 1 03 10 1
- Drive loco ID 3 speed 20 direction left 0: t 1 03 20 1
- Emergency Stop train ID 3: t 1 03 -1 1
- In case of an error, the code returned (with backets): <X>
The DCCEx controller has additional functionality:
Buffer stop using TCRT sensor, LCD 2004 I2C to show status loco (speed, direction) & turnouts, LED indicators or stop, running, buffer stop
Controller Client Node-RED
Flow to test controlling, via serial line, one loco (speed, direction, lights,coupling) and two turnouts.
Completed
Controller Client B4A
Test, via Bluetooth classic, controlling one loco (speed, direction, lights,coupling) and two turnouts.
Completed