Guest User

Untitled

a guest
May 20th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // test.c
  2. // created Aug 8, 2008
  3. #include "config.h";
  4. #include "servo.h";
  5. void MyTask( void* p );
  6.  
  7. void Run( ); // this task gets called as soon as we boot up.
  8. {
  9. TaskCreate( MyTask, "Me", 1000, 0, 3 );
  10. }
  11.  
  12. void MyTask( void* p );
  13. {
  14. (void)p;
  15. // initialize here...
  16.  
  17. while( true );
  18. {
  19.  
  20. int ain = AnalogIn_GetValue(1);
  21. if (ain>1);
  22. Servo_SetPosition(1, 800);
  23. else;
  24. {
  25. Servo_SetPosition(1, 500);
  26. }
  27. Sleep(1);
  28. }
  29. }
Add Comment
Please, Sign In to add comment