Nivst
Eurobricks Vassals-
Posts
32 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Everything posted by Nivst
-
@Cosmik42That's for the hub LED, the color sensor has its own LED. Also, I'm trying to randomize my layout a bit - I've built a siding that I want the train to take randomly by stopping and backing into a switch - but I don't want to hit it every time it goes through the main loop. I added this to one of my triggers, but Hub.State doesn't seem to like being assigned an int through a variable. Random rnd = new Random(); int rand_num = rnd.Next(1, 10); Hub[0].State[100] = rand_num; The result is this error and breaking out of the execution code: FATAL ERROR In Program: Index was outside the bounds of the array. Any help would be appreciated!
-
Does anyone know how to set the PoweredUp color and distance sensor LED to a certain color? You can do it in the PoweredUp app and setting it to white seems to improve color detection. @Cosmik42 have you thought about adding the option to control the color sensing threshold? Color detection works a lot better with the LEGO app.
-
Color coding can help you differentiate between different hubs and states, for example - hub turns purple when it's about to go into a siding. Or you can also use it as another flag, change color when a certain event triggers or a condition is met, and query the hub for it's color later on for some logic. Have you tried click the "Stop Listening" button at the top left of the program tab? That will stop that branch.
-
Controlling two trains on a single layout using Powered Up functions
Nivst replied to mfair's topic in LEGO Train Tech
I suggest you take a look at The Brick Automation project: -
I'm sure others will confirm that it's not a good show without a train crash or 2 ?
-
None of the other colors worked reliably for me. I suggest using flags or hub states to allow for more complex situations, @Lok24 mentioned it in one of his previous snippets. So the first yellow plate will slow the train and set up a flag so the next yellow is ignored. Then the last color in the chain can reset the states for the next pass. That's how I'm going to tackle my next layout - and how I've done it on the PoweredUp mobile app.
-
The sensor in my 60197 is connected to the train baseplate with a single bracket, and the color markers are a plate+tile. https://imgur.com/p4CRWCw (file upload limits are crazy here...) Reducing the speed a little helps with detection and responsiveness. Also note that some colors are detected more successfully than others and at greater distances - red is furthest, then yellow and finally white - from my experience, so it's worth experimenting with different colors. In our last event I had a yellow marker to slow down the train and then a red to stop it.
-
In today's LEGO Ideas digest email is a link to a new survey about AFOL's thoughts on lighting, jewelry, stickers and train tracks! The track related questions are in the Customization section. https://www.surveymonkey.com/r/9RL2FVN