Recently, SoundTraxx came out with a product called Blunami that allows one to control with DCC an HO model railroad locomotive via bluetooth using an iPhone app. Some folks realized that they could use the Blunami and the app to control a LEGO locomotive. So a few questions arise. First, are LEGO locomotives DCC? So then can a LEGO controller control a Blunami and hence a HO locomotive running DCC? If the LEGO locomotives are not DCC is there a document that describes how to write software to control the locomotive? The Blunami is either receiving DCC instructions or converting a different set of instructions into DCC that it then sends to the locomotive's "motherboard" which controls the motor.
Links on via YouTube on Blunami are here: https://www.youtube.com/watch?v=epGtjOZWMkc https://www.youtube.com/watch?v=x3Umian2P88
For clarity, Blunami decoders are circuit boards that can control an electric motor, lights, and provide a broad array of train sounds to a speaker. So if your Lego train has an electric motor in it, you can use Blunami to control your train. You can also control up to 6 independent lights. You will undoubtedly want to put a speaker in your train, because one of the primary strengths of a Blunami is the sounds it provides. The board can be controlled by the iOS Blunami app, and an Android version of the app is expected in June 2023.
You don't need to concern yourself with the DCC aspects of the Blunami. The Blunami can also be controlled by pulsed signals that travel through the rails (DCC) which is popular in model railroading. For Lego purposes, just use the free app and control the train wirelessly.