View unanswered posts | View active topics It is currently Fri Apr 18, 2014 2:18 pm






Reply to topic  [ 2 posts ] 
compass sensor 
Author Message
Rookie

Joined: Sun May 04, 2008 3:22 am
Posts: 2
Post compass sensor
in the simple program ther is a fail call --> compass sensor .
can you explain me how the heading is calculated ?????
ther is the parameter nCycles ......did he help for the heading calculate ???

the program is :

[color=blue][b]#include "Compass Sensor Driver.c"

task main()
{
int nCompassHeading;
long nCycles = 0;


const tSensors kCompass = S1;




SensorType[kCompass] = sensorI2CCustomStd;
SensorSubType[kCompass] = subTypeHiTechnicCompass;
StartTask(taskCompassDeviceDriver);



nxtDisplayTextLine(3, "Compass Port: %d", kCompass);

while (true)
{
++nCycles;
nCompassHeading = SensorValue[kCompass];
nxtDisplayTextLine(5, "Heading: %d", (short) nCompassHeading);
nxtDisplayTextLine(7, "Cycles: %d", nCycles);
}
return;
}[/color]


Sun May 04, 2008 3:32 am
Profile
Rookie

Joined: Sun May 04, 2008 3:22 am
Posts: 2
Post 
in the simple program ther is a file call --> compass sensor .
can you explain me how the heading is calculated ?????
ther is the parameter nCycles ......did he help for calculate the heading ???

the program is :

#include "Compass Sensor Driver.c"

task main()
{
int nCompassHeading;
long nCycles = 0;


const tSensors kCompass = S1;




SensorType[kCompass] = sensorI2CCustomStd;
SensorSubType[kCompass] = subTypeHiTechnicCompass;
StartTask(taskCompassDeviceDriver);



nxtDisplayTextLine(3, "Compass Port: %d", kCompass);

while (true)
{
++nCycles;
nCompassHeading = SensorValue[kCompass];
nxtDisplayTextLine(5, "Heading: %d", (short) nCompassHeading);
nxtDisplayTextLine(7, "Cycles: %d", nCycles);
}
return;
}


Sun May 04, 2008 6:12 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.