My modifications/additions to the code

Dependencies:   ADXL345 ADXL345_I2C IMUfilter ITG3200 Servo fishgait mbed-rtos mbed pixy_cam

Fork of robotic_fish_ver_4_8 by jetfishteam

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers servoloop.h Source File

servoloop.h

00001 #pragma once
00002 #include "mbed.h"
00003 //class to aid with vision feedback
00004 //taken from 
00005 // https://github.com/charmedlabs/pixy/blob/master/arduino/libraries/Pixy/examples/pantilt/pantilt.ino
00006 #define RCS_MIN_POS     0L
00007 #define RCS_MAX_POS     1000L
00008 #define RCS_CENTER_POS  ((RCS_MAX_POS-RCS_MIN_POS)/2)
00009 class ServoLoop
00010 {
00011 public:
00012   ServoLoop(int32_t pgain, int32_t dgain);
00013 
00014   void update(int32_t error);
00015    
00016   int32_t m_pos;
00017   int32_t m_prevError;
00018   int32_t m_pgain;
00019   int32_t m_dgain;
00020 };