I’m trying to write a code for an elevator that has 3 bump switch, 3 line followers on each floor, a motor and 3 LED lights to turn on when the elevator is on one of the floors. How can I do this? I’m not so good at coding.
Firstly, if you’re not good at coding, I wouldn’t recommend RobotC. If you have a V5 or EXP brain, I’d recommend using something simple like VexCode Blocks; if you have a Cortex then I can’t help you as much, but I’d recommend trying robotmesh blocks (defunct, but should be fine for the cortex)
With regards to the algorithm to solve the problem, I’m admittedly a bit confused by your explanation, so this following explanation might be correct, but you can move the elevator with the motor until one of the bump switches are pressed (which can correspond to a floor level), then detect which one is pressed then activate the corresponding LED light.
I assume this is perhaps for the PoE class, seems that someone posts about it every couple of years. search the forum, you will find other similar questions. Here’s an old one
Thank you so much. Yes it’s a POE Class but I need more help using with programming. Thinking of doing a course over the summer to assist with that. I will try this one and let you know how it works.
Some sage advice: There are almost always youtube videos about how to code something nowadays. Try searching youtube, or even google:
https://www.google.com/search?q=robotc+elevator+coding+youtube&rlz=1CDGOYI_enUS924US924&oq=robotc+elevator+coding+youtube&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigATIHCAMQIRigATIHCAQQIRigAdIBCDY0MjZqMGo3qAIZsAIB4gMEGAEgXw&hl=en-US&sourceid=chrome-mobile&ie=UTF-8