Instructions Circuit Diagram
- 83 -
Move the servomotor for YETI’s legs and feet.
#This program will make YETI jump for joy.
#include“YETI.h” //loaddenitionsandfunctions
#include “yetimove.c” //insert YETI’s servo functions
int main(void){ //main function entry
inti; //denevariable‘i’asaninteger
vInitYeti(); //initialize all microprocessor modules in
//the YETI
for(i=0 ;i<3 ;i++){ //do for-loop 3 times
vMoveBody(16,10); //move body to the left
vMoveBody(-16,10); //move body to the right
} //terminate for-loop (3 times)
vMoveBody(0,10); //move body to the centre position
return 0; //terminating the main function
} //end of the main function
#include “yetimove.c”
This include-line will insert the YETI servo functions.
vMoveBody(16,10);
Move YETI’s feet servomotor 16 steps to the left, reserving 10 milli-
seconds for each step.
vMoveBody(-16,10);
Move YETI’s feet servomotor 16 steps to the right, reserving 10
milliseconds for each step.
Youmaychoosesteppositionsbetween–58and+58.Thedelaytime
period will always be rounded up to the next higher multiple value of
milliseconds, resulting in a delay of 10 milliseconds/step for each para-
meter value between 1-10 milliseconds and a delay of 20 milliseconds/
step for each parameter value between 11-20 milliseconds