This a redo of a previous project that I called the ECU-2 and uses the same hardware. The previous project is described in the following link:
https://ogrforum.com/...-control-transmitter
In the previous project I set up a frame work to construct the TMCC General Command Format. This worked quite well but required a change to the Arduino sketch (code) to change or add a function to a button. I did provide a way to change the ENG # from the CAB-1 for the whistle button. The engine number was set from the CAB-1 and was stored in the Arduino internal EPROM. I call this new version the ECU-3.
After making a TMCC serial monitor (another project)to display TMCC commands, I thought that it would be better to be able to change the function of a ECU-2 button without redoing the Arduino sketch. The ability to construct the TMCC General Command is built into the CAB-1/Base-1 so it is not necessary to construct these commands in the Arduino. Is only necessary to allow the CAB-1 to construct these commands and then to store them in the Arduino internal EPROM. The desired commands can then be output to the Base-1 when a button is pressed.
The operation of the ECU-3 is as follows. When the ECU-3 is powered up the green LED will come on indicating that it is ready to output any TMCC command that has been previously stored for each button. When a button is pressed the stored TMCC command will be output to the Base-1. This command will be output every 1/2 second while the button is pressed. Each time the command is output the ECU-3 green LED will flash and the green LED on the Base-1 will also flash.
To change the stored TMCC command for a button pressing the BLACK and ORANGE buttons at the same time puts the ECU-3 into the PROGRAM mode. The green LED will change to red indicating PROGRAM mode. The desired button to be programmed is selected by pressing the button. The red LED will begin flashing The new TMCC command is then entered from the CAB-1 and it is then stored for the selected button in the Arduino's EPROM. The red LED will then change to green. The next time this button is pressed the new stored TMCC command will be sent to the Base-1.
The working sketch for this project is attached,
The results from using ChatGPT will be posted to this thread when I finish writing it up.
Original Post