Hey, folks. Sorry about barging in and all. I've got quite the predicament on my hand. I'm trying to program a robotic car with two motors (left and right), and 3 sensors (2 limitswitches, 1 bumpswitch). Using only these, I am to design a car that moves forward and back for a set time, and keeps going in a loop UNTIL either the limitswitches or the bumpswitch is pressed. If the limitswitches press, it immediately moves in the opposite direction (the limitswitches are on either the front or back of the vehicle), and if the bumpswitch is pressed, the task ends altogether. Is there a specific code I'm missing?

Whenever I try adding a timer-based code (to make a loop), I run into problems. I also can't seem to get the limitswitches or bumpswitches to correlate with the tasks properly (yes, everything's plugged in and powered at the right places).

What code have you got so far? The more information you give, the more help you're likely to get.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

The number of times I've tried using timers and other limitswitches has been fail-tastic. I've gone back to using a single limitswitch, but right now, all it's doing is following the wait programs for the motors. It's ignoring anything else.

The number of times I've tried using timers and other limitswitches has been fail-tastic. I've gone back to using a single limitswitch, but right now, all it's doing is following the wait programs for the motors. It's ignoring anything else.

Ummm, it appears to me that this isn't RobotC code. Are you sure that your're using RobotC? This looks more like NXC to me.

Oh, BTW, when posting code, please put it in between the

Code:

[code][/code]

tags for better readablity

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum