It is quite an open source project.
I use to play with microcontrollers some years ago. They can do a lot.
A couple links below you should keep. A search will bring a lot more information about them.
https://www.arduino.cc/
https://en.wikipedia.org/wiki/Arduino
Rich
If you ever fall over in public, pick yourself up and say “sorry it’s been a while since I inhabited a body.” And just walk away.
ndbprr how does it interface to dcc? Thank you
how does it interface to dcc? Thank you
Do a search on YouTube for DCC++. The guy has several videos describing how he utilizes an Arduino and a Motor Shield as a DCC command station, including an automated routine that randomly selected trains and runs them over his layout, and even parks them and choices another train to go out. Pretty nifty stuff.
I use my Arduinos for some much simpler tasks, such as using opto-detectors to change signal lights. Much easier to program than a full automation routine.
one aspect of the Arduino environment I don't hear mentioned often is it's serial monitor that can be brought up from the IDE.
It just a simple ASCII serial interface. A Serial library allows strings and values to be sent across the interface and displayed on a window. Similarly, characters or strings can be sent to the Arduino which can be used to control a program using your own code to monitor and process the serial input.
recently, i was experimenting with using opto-detectors for position sensing on a turntable. After getting eratic results using a digital input, i switched to an analog input. I created a command to read and display the analog input.
it didn't take long to write some code to repeatedly read and collect analog data in a buffer that with a command could be dumped thru the serial display.
I was able to plot that data and see the sensitivity of the sensor and quickly wrote some code to stop the turntable bridge when it crossed the sensor.
while the Arduino is certainly well suited for DIY projects, it's also useful for instrumentation and measurement.
since Arduino code is C with many useful libraries, i've often developed code on my laptop that was easily ported to an Arduino application.
greg - Philadelphia & Reading / Reading
An Arduino is a family of microcontrollers and the programming environment developed for them - it's the whole system, where the development environment has commands to simplify writing programs - prime example is the most common thing, seeting a pin to be an input or an output. Arduino has pinMode to set a pin to be input or output, like pinMode(1,OUTPUT), pinMode(7,OUTPUT), and pinMODE(0,INPUT) - those three commands mad pins 1 nad 7 output, and pin 0 an input. If you didn;t have the Arduino IDE to work in, you would have to write code like DDRD = DDRD | B11111110.
Arduino is a complete ecosystem. It;s not any perticular board, nor is it even all one brand of microcontroller.
To interface to DCC you need some external components to electrically transform the DCC signal into voltages that do not exceed the microcontroller's limits (most are 5V, some are 3.3V), and you need software that can decode the NMRA packets. Such software is readily available for download. To that you then add your code to do something based on the received data, or send something based on some inputs.
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.