Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   can anyone help me to get gyro c++ code? (http://www.chiefdelphi.com/forums/showthread.php?t=73102)

alaa abo alheja 28-01-2009 05:24

can anyone help me to get gyro c++ code?
 
in this year my team Decide to use the gyro sensor,can anyone give us the c++ program of rhe gyro sensor with robotdrive 4 mottors??

alaa abo alheja 29-01-2009 09:26

Re: can anyone help me to get gyro c++ code?
 
here i have the c code of the gyro sensor, can anyone help me to make it work with 4 mottors?

Code:

float get_angular_velocity(){
    float omega_rad_per_sec, omega_deg_per_sec, u;
    u = (float) SensorRaw[S1];                  // sensor port 1 is used for CRS03-02
    omega_deg_per_sec =(u/1023*5 - 2.5)/0.02;    // angular velocity(deg/s)
    omega_rad_per_sec =omega_deg_per_sec/180*PI; // angular velocity(rad/s)
    return(omega_rad_per_sec);
}
 
task main()
{
    float omega;
    motor[motorA] = 100;    // power supply for voltage regulator
    while(1){
        omega =get_angular_velocity();
    }
}

plz all who can help give their help to me.
thank u for all

gokul 29-01-2009 13:14

Re: can anyone help me to get gyro c++ code?
 
Look for FRC Gyro Sample Program in Windriver.

File > New > Example > ....kernal module... >

Open that project and look at GyroSample.cpp as an example.

Hope this helps.


All times are GMT -5. The time now is 02:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi