Skip to content
Snippets Groups Projects
Select Git revision
  • ee988b7d8ee2e24ffebf5ab30f8cb935c620ffac
  • master default protected
2 results

servos.hpp

Blame
  • user avatar
    Xoaquin Castrelo authored
    814c10e4
    History
    servos.hpp 514 B
    #ifndef SERVOS_H
    #define SERVOS_H
    
    #include <stdint.h>
    
    #define NUM_SERVOS 3
    
    /**
     * Initialises the servos.
     */
    void initServos();
    
    /**
     * Sets the angle of a servo.
     * 
     * @param servo     the index of the servo to control
     * @param arcMin    the angle of the servo in arc-minutes
     */
    void setServoAngle(uint8_t servo, int16_t arcMin);
    
    /**
     * Gets the angle of a servo.
     */
    int16_t getServoAngle(uint8_t servo);
    
    /**
     * Writes the servo values out to the servos.
     */
    void updateServos();
    
    #endif /* SERVOS_H */