Minor changes

This commit is contained in:
id101010
2015-06-07 13:41:07 +02:00
parent 802d3df373
commit 3d98ca93bc
2 changed files with 12 additions and 12 deletions

View File

@@ -28,10 +28,10 @@ void int_init(void){
// PID controller implementatoin for the y-axis
int16_t pixy_PID_Y(int16_t x, int16_t w)
{
float e;
static float esum;
static float eold;
float y;
float e = 0;
static float esum = 0;
static float eold = 0;
float y = 0;
e = (float)(x - w); // calculate the controller offset
@@ -51,10 +51,10 @@ int16_t pixy_PID_Y(int16_t x, int16_t w)
// PID controller implementation for the x-axis
int16_t pixy_PID_X(int16_t x, int16_t w)
{
float e;
static float esum;
static float eold;
float y;
float e = 0;
static float esum = 0;
static float eold = 0;
float y = 0;
e = (float)(x - w); // calculate the controller offset

View File

@@ -91,8 +91,8 @@ void tracking_our_start(void* tracking_config) {
int return_value;
servo_x = servo_y = 500; // set a default value of 500
pixy_rcs_set_position(0, servo_x); //
pixy_rcs_set_position(1, servo_y); //
pixy_rcs_set_position(0, servo_x); // set default
pixy_rcs_set_position(1, servo_y); // set default
return_value = pixy_command("runprog", INT8(0), END_OUT_ARGS, &response, END_IN_ARGS);
}