Master Sends message, board receive message, check message for errors. If no error, acknowledge message. If error, ask master controller to resend the message.
Agreed. Without seeing the whole plan, it's hard to tell what's best for something of this size and potential complexity.
For long lengths between buttons (my laser maze wire length using 18AWG speaker wire goes about 40 feet wire length between three industrial deadman buttons and a central Arduino UNO) I think I would daisy chain Nanos if I had a way to power them semi permanently. I've had good success offloading tasks from a central Arduino to accessory Nano and just poll a digital pin for a HIGH/LOW signal, then do the thing at that junction.
I just poll digital pins between Arduino waystations, if you will. With nothing else going on on say, Arduino Nano B that switches a 12V Auto LED with an MOS module, you'll not miss the signal of a digitalRead(lightBPin). Personally, I like the KISS rule.
I'm uber amateur and maybe it's not the most elegant way, I don't know. But I pulled enough hair out in some builds trying to get multi-devices working on one Arduino until it occurred to me that Arduinos don't cost very much and are very well suited to doing one thing, very well.
If you can earth-ground both ends of a wire, earth becomes the other wire .
When I started with Arduino the Main Site docs included the goal of making stand-alone MCU chips. People made in-field data collectors that ran 1 to 3 months on AA cells, fit in an Altoids tin.
ATmega and ATtiny chips need ground, power and 2 bypass caps to run if you repurpose the reset pin and use the internal clock source.
It would beed to be wired up to do anything yah, but even with a led13, reset button and crystal&caps there is not much build bulk required.
The semaphore signal in the project has a 110V LED that is always-on. The other signals will be fitted with 12V auto LEDs, of which the center LED on the position light signal is always-on. Again, we can convert the 110V LED to a 12V unit if we have to. I think hooking everything to a Mega with the proto shield would work. The museum can use a breadboard if needed.
I already have a Mega 2560 on-hand and will use that board with relay modules attached to the light-type signals and the stepper motor that's built into the semaphore. Some of my code requires using a variable that will be called by a specific segment of the code and then stop being used (like a java function). How do I implement this type of variable, given it's only a loop counter?
Think of levels in a video game. Say
byte level;
Check the state in your loop using switch case
switch (level){
case 1:
// do something
break;
case 2:
// do something else
break;
default:
// default thing to do
break;
}
What you want is a state machine and what you don't know you want is non-blocking task functions with built-in timers and state machines.
In C/C++ we call functions that return execution, not variables.
State is short for Process State, and it -can- be simple or tricky. State machines make a lot of coding easier.
You need to check the regs first .
There are currently 2 standards out there for Amusement Park Railroads:
The track Std F2960-15 and an operations standard F3054-15
The AP RR operations standard also incorporates the current amusement ride operations standard F770. (Meet all the requirements in F770 plus additional listed items directly related to AP railroads.)
You really should know the law and your responsibilities . It’s not clear what sort of railway this is , but think out the scenarios such as a signal saying “ no train” , someone crosses the track and gets hit.
Arduino stuff is not fail safe and you must ensure you build/use maintain equipment that , if appropriate , complies .
Maintenance of your equipment by others needs to be considered .
The Mega2560 is extreme overkill for the task. You should keep it for something bigger, it can support touch-screen. it can be used to program chips to put in proto-boards that trigger the relays.
Boards with socket headers are made for benchwork development and the 2560 with 52 IO pins, 4 UARTs, 8K Internal RAM with the ability to add External RAM or devices like TFT displays. Why waste that to do so little?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.