

we check if a button is pressed and possibly go up or down Now, if we translate this into some pseudo code (which should be easily translated to RobotC) : enum elevator_status = The elevator is at a given floor and go from one floor to the other when it trigger a switch: Let's define what are the states of an elevator at a given moment: If (calldown = 1 & floorat = 1 & calldown = 0 || calldown = 1 & floorat = 1)Īlthough it shouldn't be a concern for this question, the 60 in the startMotor command is the speed of the motor, just to make it clearer. If (callup = 1 & floorat = 1 & calldown = 0 || callup = 1 & floorat = 1 & callup = 0) If (SensorValue = 1 & floorat = 1)Įlse if (callup = 1 & floorat = 1) When the shaft sticking out the motor mechanism moves up and down, it presses limit switches and causes it to return a value of 1. The motor (mainMotor) rotates the gear which causes the mechanism to travel upwards on the slide. ) are analog buttons and return a value of 0 if not pressed and 1 if pressed. Could I possibly do anything to make this any simpler? Or better? I have attached a picture of my design that I made in AutoCAD Inventor with labels.įor those not familiar with RobotC or VEX (it is VERY similar to C and C++): the limit switches (limit1, limit2. Your robot should move forward.I'm designing and programming an elevator-like robot for a high school project. Press the Play Button (labeled #3) and you should see a VEX IQ Field with 3 green cubes and a Clawbot robot.Ĭhange the view to Camera 2 and Hit Play.


That the Training Table is Basic Movement 1 (do this by clicking the Training Circle, also labeled #2).We want to log in locally as a Guest (for now):įrom the Home Screen we need to verify a two things:
#Robotc code examples download#
Hint: If you look at the highlighted menu item, on the right you’ll see F5, that’s the Keyboard Shortcut for Compile and Download Program.Īfter the program compiles it will bring up the Robot Virtual Worlds login window.

Set the Compiler Target to Robot Virtual Worlds.There’s a few steps we need to take care of: We’re going to be doing all of our programming inside the ROBOTC IDE and running are programs on virtual robots inside Robot Virtual Worlds. Chapter 1 - Getting Started Getting Started
