Sensor and remote control at the same time?

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Sensor and remote control at the same time?

Postby inzzza8 » Sat May 19, 2018 7:21 pm

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?
inzzza8
Fledgling
 
Posts: 1
Joined: Sat May 19, 2018 6:49 pm

Re: Sensor and remote control at the same time?

Postby Idris » Mon May 21, 2018 4:35 pm

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!
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 384
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 5 guests

cron