![]() |
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); } |
| All times are GMT -5. The time now is 00:49. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi