I have spent a great deal of time writing software for the layout.
- a program for controlling track sections (one pic16f876 does two sections of track)
- a master program for communicating to the track and the nRF24L01+ radios in the throttles (a pic18f4620 with FTDI FT245RL USB interface)
- a laptop GUI program with touch screen for overall control and situation awareness
- a program in the wireless throttles (a pic18f2620)
I stayed with PIC microcontrollers throughout the hardware so that I only needed one development environment and programmer. The laptop code was done in Visual Studio. Everything is written in C/C++.
But then software development was my 35+ year career.

I started working on the track power design back in the early 80s. At that time I was going to do the PWM all in hardware. My Apple II just couldn't handle it.
It was put on hold mostly because of the need to wire-wrap a huge board with counters, latches, and DACs. Then about 10 years ago, I made my way into Microchip PIC microcontrollers and redesigned all of the electronics.
This is the heart of the railroad:

Edit - Missed the program in the throttles