Using multiple Mega controllers on a large model railway

Ideally, every Mega will run much the same code as @markd833 mentioned. The different things that they do will be data driven. That data can be displayed through serial, including a hard coded ID.

That's probably an aspirational goal though. As you program a Mega for each terminus, you'll start to see commonalities, but initially I expect that there will be a lot of terminus specific hard coding in each one.

Look at arrays, structs and arrays of structs. They're likely to be very useful, even if they seem tricky at first.

1 Like