|
Re: Senior Programmer: advice on training new recruits
doyler-
Here are the exercises we worked through with our students. Start with the 2004 default code and replace user_routines.c with the attached file. Hook up joysticks to ports 1 & 2 and servos up to pwm 1-4. To run the different labs you'll have to change 'labNum' to the desired lab number.
To simplify everything for my students I created some new analog input & output variables ws_p1_y, ws_pwm01, etc that are signed integers. The range on these variables is the more intuitive -127 to 127 instead of 0 to 255. I also took care of overflow on the outputs so you can assign ws_pwm0x a value greater than 127 and it will get capped at 127.
Try to work through these exercises on your own and ask for help if you need any.
|