You Turn the Wheel

The guide to everything controls for 1675 members.

You Turn the Wheel

Objective

In this lab we will create a robot program that reads driver input and turns a wheel at a speed proportional to a joystick input.

Hardware

The hardware required for this lab is:

The setup should be as follows:

If you completed As the Wheel Turns, the only new element is the joystick or controller.

Software

What we need to do to accomplish the objective:

Create an TimedRobot template project

If you don’t have a project, see Lab 3 on how to create one. If you still have your Lab 3 project, you can use that.

Write Code to Read the Joystick

The first step is to read the input value from a joystick on the joystick or controller.

What method or methods should our code to do this go in? Think about it or discuss with your group.

What code will you need to add? Here are some tips:

QUESTION TIME!

Write Code to Command the Motor Controller

Think back to the post-lab questions in As the Wheel Turns (If you haven’t done it yet, go read it).

How can you command the motor controller using your joystick input?

Testing

When you test your code for the first time, always do it “on blocks”. No moving part of the robot should be touching the floor or anything else. For this lab you can leave the robot on blocks as we are only turning one wheel.

Post Lab Questions