|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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??
|
|
#2
|
||||
|
||||
|
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();
}
}
thank u for all |
|
#3
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| For anyone who doesn't get the camera code..... | Jake M | Programming | 8 | 16-01-2006 18:56 |
| Wierd gyro code problems...pls help | Salik Syed | Programming | 4 | 14-03-2004 01:29 |
| Can someone get me the code for... | HuskieRobotics | Programming | 4 | 11-03-2004 17:13 |
| Can anyone tell me the proper code for line sensors | thelastride | Programming | 1 | 14-02-2004 13:47 |
| Anyone know where I can get a sample.. | Jason_384 | General Forum | 4 | 30-01-2002 23:04 |