Skip to main content

ECU-3 caseECU-3 Schematic

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.

Attachments

Images (2)
  • ECU-3 case
  • ECU-3 Schematic
Files (1)
Original Post

To create the Arduino sketch for this new version I input my description to ChatGPT using the method described in the post:

  https://ogrforum.com/...ch-for-train-control

I first tried to describe in general terms what I wanted and chatGPT generated a general outline and left several "Insert your code here" spots. I then tried to describe in greater detail exactly what I wanted and chatGPT provided a finished Arduino sketch that didn't work. After several iterations to describe how I wanted this sketch to work. I ended up finishing the code myself for the programing part of the sketch. The new sketch is much simpler and smaller and does much more than the original sketch and uses the exact same hardware with no changes.

I wanted to learn how to describe the project to produce the working code so I then input the description that produced the non-working code and my working code and asked ChatGPT to make corrections to the description so that it would produce the working code. ChatGPT didn't seem to understand this request and produced my working code with embedded comments taken from my description. The input "Clear the serial input buffer (64 bytes)" to ChatGPT produced the Arduino command "Serial.flush();" which clears the output buffer not the input buffer.

After another non-train math problem error with ChatGpt where I received three different wrong answers for the same input I tried to explain these errors to ChatGPt. I hoped that I would be part of the learning process for AI. I asked ChatGPT "Do you learn only from training or also from queries?".

ChatGPT
As an AI language model, I don't learn or update myself based on individual queries. My learning process occurs during training, where I'm exposed to vast amounts of text data to understand and generate human-like text. However, my responses might appear to adapt to queries because I'm designed to generate responses based on patterns learned during training, including understanding and generating text relevant to the queries I receive.

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×
×