|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||||
|
|||||
|
[OCCRA]: Halo Drive 'Default' Code
All,
I wrote this for several VRC teams to allow them to do development and such without writing any code. It maps buttons to PWM ports, and Halo Drive using the same code OCCRA/VRC33 is currently using for the second year. It might be useful to other teams in similar situations, so I'll post it here. It's written for RobotC 3.51, you'll need that to compile (although it will probably compile in older versions, but upgrading is free anyway). PWM mapping is as follows:The IO mappings are as follows: PWM 2 => Left Drivetrain Halo Drive (Halo from Primary transmitter left Y and right X) PWM 3 => Right Drivetrain Halo Drive PWM 4 => Secondary transmitter left Y PWM 5 => Secondary transmitter right Y PWM 6 => Primary transmitter left buttons (up/down are forward/reverse) - Btn5 PWM 7 => Primary transmitter right buttons - Btn6 PWM 8 => Secondary transmitter left buttons - Btn5 PWM 9 => Secondary transmitter right buttons - Btn6 There are no limit switch inputs, or any sensors at all. The file itself includes a main task running at 40hz (25ms loop time) which runs always. It also includes the Halo Drive function usually located in cheesydrive.c, and some math functions (usually in kbmath.c) Just above the do_halo_drive() function is the cheesy/halo drive constants. They're #define s and you can tune them as you with. These constants are used as-is on many VEX prototypes and competition robots, we tune them more for the FRC robots. It's mainly driver preference, they essentially the turn gain. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|