|
Page 1 of 1
|
[ 2 posts ] |
|
| Author |
Message |
|
tupaco
Rookie
Joined: Sun May 04, 2008 3:22 am Posts: 2
|
 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 |
|
 |
|
tupaco
Rookie
Joined: Sun May 04, 2008 3:22 am Posts: 2
|
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 |
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 5 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
|
|