Go to Post What is this, presto change-o rules every week? - Racer26 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2008, 22:57
Jennymcf Jennymcf is offline
Registered User
FRC #2453
 
Join Date: Jan 2008
Location: Honolulu
Posts: 3
Jennymcf is an unknown quantity at this point
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);
}
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 17:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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