Page 1 of 1

Sensor and remote control at the same time?

PostPosted: Sat May 19, 2018 7:21 pm
by inzzza8
Hi everyone,

I have URC10 controller that is connected to PS2 controller and LCD display shields. I finished 2 separate codes for remote controlled and also sensor controlled robot. Is it possible to put them in the same project and choose between them using LCD display buttons?

So in ideal it should work like this: When starting the robot, LCD gives two options: Remote mode and Sensor mode. After choosing any of the modes, either remote controlled mode or sensor controlled mode starts and you can any time go back to the main menu to choose another option.

I wrote LCD display code in the .ino file created separate tabs for remote control and sensor control. In each of them, instead of void setup() and void loop() I changed to void setupRemote(), void setupSensor() and void loopRemote(), void loopSensor().

I havent gotten it to work yet, but am I on the right track? Could it work that way?

Re: Sensor and remote control at the same time?

PostPosted: Mon May 21, 2018 4:35 pm
by Idris
Hi inzzza8,

Yes you can "put them in the same project and choose between them using LCD display buttons". What you need to do is 'playing' with the coding.

You can use function to differentiate between remote and sensor task.

When I read this statement
I wrote LCD display code in the .ino file created separate tabs for remote control and sensor control. In each of them, instead of void setup() and void loop() I changed to void setupRemote(), void setupSensor() and void loopRemote(), void loopSensor().

I believe you're not familiar with function yet. So keep study and try. Please let us know any updates. :)

Anyway, good work!