summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/busp/busp_servo.h
blob: 7cdf76e8c77ee472ee1b4961be8ba9b7442d73af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef busp_servo_h
#define busp_servo_h
// busp_servo.h
// buzz - Programme du robot Efrei Robotique I1-I2 2003
// Copyright (C) 2003 Nicolas Schodet

class BuspServo
{
    static const int m_address = 1;
    static const int m_nbServo = 8;
    static const int m_nbPositions = 9;
    int m_pos[m_nbServo];
    int m_ppos[m_nbPositions][m_nbServo];
  public:
    // Constructeur.
    BuspServo ();
    // Bouge le servo N en POS.
    void moveTo (int n, int pos);
    // Bouge le servo N de DIFF.
    void move (int n, int diff);
    // D�place les servos pour atteindre une position.
    void position (int p);
  private:
    // Fait le d�placement effectif.
    void set (int n, int pos);
};

#endif // busp_servo_h