Hello,
I'd be grateful for help with Powered Up coding please.
I'm using the colour and distance sensor 88007 fitted to the underside of a train.
I've tested many different colour tiles using the report function and have settled on a small range of colours that return true readings.
Unfortunately I still get false readings from other blank parts of my track, with yellow and blue falsely triggering actions when the tile doesn't exist in that location.
I notice that the distance reading does seem reliable so a coloured tile placed on the track shows a 0 distance whereas the sleepers and track bed read 1 and 3/4 respectively.
What I'd like to do with the code is have an action triggered only when, for example, the sensor reads a 0 distance AND blue at the same time. The closest I've come to making this work is the ForkJoin flow block but the sensor can read a false colour elsewhere on the track, then detect the correct 0 distance (on a different coloured tile) before it moves to the next block.
Ideally the code would only progress once both colour and distance conditions are met simultaneously. If only one condition is met, the code should revert to a state where it looks for a new instance of the condition.
I've attached a basic example of my code.
Any help would be greatly appreciated