NXC
Version 1.2.1 r5
Main Page
Related Pages
Modules
Data Structures
Files
Examples
All
Data Structures
Files
Functions
Variables
Groups
Pages
ex_ReadSensorHTBarometric.nxc
This is an example of how to use the
ReadSensorHTBarometric
function.
task main()
{
SetSensorLowspeed
(
S3
);
int
temp;
unsigned
int
press;
while
(
true
)
{
ReadSensorHTBarometric
(
S3
, temp, press);
NumOut
(0,
LCD_LINE1
, temp);
TextOut
(40,
LCD_LINE1
,
" 1/10ths C"
);
NumOut
(0,
LCD_LINE2
, press);
float
tc = temp / 10.0;
TextOut
(0,
LCD_LINE3
,
FormatNum
(
"%5.2f C"
, tc));
TextOut
(0,
LCD_LINE4
,
FormatNum
(
"%5.2f F"
, tc*9/5+32));
TextOut
(0,
LCD_LINE5
,
FormatNum
(
"%3.3f inHg"
, press/1000.0));
Wait
(
MS_20
);
}
}
Generated by
1.8.2