Nivst
Eurobricks Vassals-
Posts
32 -
Joined
-
Last visited
About Nivst

Spam Prevention
-
What is favorite LEGO theme? (we need this info to prevent spam)
City
-
Which LEGO set did you recently purchase or build?
60197
Profile Information
-
Gender
Male
Extra
-
Country
Israel
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
@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.