Doing two things at once?


I’ve seen the video where Codey Rocky drives along and reads colours as it drives. While it drives it turns the colours into tones.
How do I get Codey Rocky to drive and read the colour sensor at the same time?

I know how to do each of these things one at a time, but can’t see an example code of how to do them at the same time. Is it just one fast loop like this?


The time will cause delay.
You may try code like this:


Ok, but how do I get Cody to read the sensor and respond at the same time as driving?
As per this example with the colours and music:


You may try to refer to below code to program by yourself:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.