|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Accelerometer and Gyroscope freezing in EasyC
Hi,
We're having a weird problem with our accelerometer and gyroscope using EasyC. When using both the accelerometer and the gyroscope, we observe no output. When using only the accelerometer, it works fine. (Sort of. The terminal output is a little messed up.. missing new line characters) When using only the gyroscope, it works fine. When using the accelerometer and initializing the gyro without reading any data, we observe no output. Our code looks something like this (the syntax may not be totally precise because our robot laptop can't connect to our school's network): int xaxis; int yaxis; int gyro; InitAccelerometer(3); //analog input channel 3, 4 are the accelerometer StartAccelerometer(3); InitAccelerometer(4); StartAccelerometer(4); InitGyro(2); //analog input 2 is the gyro twist StartGyro(2); while(1){ xaxis=getAccelerometer(3); yaxis=getAccelerometer(4); gyro=getGyro(2); PrintToScreen("xaxis= %d\n", (int)xaxis); PrintToScreen("yaxis= %d\n", (int)yaxis); PrintToScreen("gyro= %d\n", (int)gyro); Wait(200); } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gyroscope Code | Kevin Watson | Programming | 65 | 01-03-2008 23:46 |
| Gyroscope saturation? | Tom Line | Programming | 32 | 14-01-2008 12:07 |
| Accelerometer and hall effect sensors | brownster | Programming | 1 | 13-02-2005 13:36 |