daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #include "comms.h"
  5. #include "hardware.h"
  6. #include "log.h"
  7. #include "robod.h"
  8.  
  9. #define MAX_SERVOS 32
  10. #define LOOP_DELAY 0.5
  11.  
  12. typedef struct servo {
  13.     char channel;
  14.     char enabled;
  15.     srv_pulse_t cur_pulse;
  16.     srv_pulse_t max_low_pulse;
  17.     srv_pulse_t max_high_pulse;
  18. } servo;
  19.  
  20. int main(int argc, const char* argv) {
  21.     servo servos[MAX_SERVOS];
  22.     servo* srv = &servos[0];
  23.     int i = 0;
  24.     // if (!robodaemon()) { exit(0);}
  25.     for(i = 0; i < MAX_SERVOS; i++) {
  26.         srv.channel = i;
  27.         srv = srv >> sizeof(servo);
  28.     }
  29.     srv = &servos[0];
  30.     //for(;;) {
  31.         sleep(LOOP_DELAY);
  32.         set_servo((servo*)servos);
  33.     //}
  34.     return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top