Rev 15 | Rev 22 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15 | Rev 16 | ||
---|---|---|---|
Line 117... | Line 117... | ||
117 | display1.gotoxy (0, 40); |
117 | display1.gotoxy (0, 40); |
118 | display1.fontDigits (large_font, 4, 1, speedAVG * 10); |
118 | display1.fontDigits (large_font, 4, 1, speedAVG * 10); |
119 | 119 | ||
120 | struct bmp280_uncomp_data ucomp_data; |
120 | struct bmp280_uncomp_data ucomp_data; |
121 | 121 | ||
122 | if (HAL_GetTick () - lastTick > 5000) |
122 | if (HAL_GetTick () - lastTick > 100) |
123 | { |
123 | { |
124 | lastTick = HAL_GetTick (); |
124 | lastTick = HAL_GetTick (); |
125 | /* Reading the raw data from sensor */ |
125 | /* Reading the raw data from sensor */ |
126 | rslt = bmp280_get_uncomp_data (&ucomp_data, bmp); |
126 | rslt = bmp280_get_uncomp_data (&ucomp_data, bmp); |
127 | 127 | ||
Line 133... | Line 133... | ||
133 | 133 | ||
134 | rslt = bmp280_get_comp_pres_32bit (&pres32, ucomp_data.uncomp_press, |
134 | rslt = bmp280_get_comp_pres_32bit (&pres32, ucomp_data.uncomp_press, |
135 | bmp); |
135 | bmp); |
136 | 136 | ||
137 | #if defined USB_DEVICE |
137 | #if defined USB_DEVICE |
- | 138 | /* |
|
- | 139 | * $--XDR,a,x.x,a,c--c, ..... *hh<CR><LF> \\ |
|
138 | 140 | ||
- | 141 | Field Number: |
|
- | 142 | 1) Transducer Type |
|
- | 143 | 2) Measurement Data |
|
- | 144 | 3) Units of measurement |
|
- | 145 | 4) Name of transducer |
|
- | 146 | x) More of the same |
|
- | 147 | n) Checksum |
|
- | 148 | ||
- | 149 | Example: |
|
- | 150 | $IIXDR,C,19.52,C,TempAir*19 |
|
- | 151 | $IIXDR,P,1.02481,B,Barometer*29 |
|
- | 152 | ||
- | 153 | Currently, OpenCPN recognizes the following transducers: |
|
- | 154 | ||
- | 155 | Measured Value | Transducer Type | Measured Data | Unit of measure | Transducer Name |
|
- | 156 | ------------------------------------------------------------------------------------------------------ |
|
- | 157 | barometric | "P" pressure | 0.8..1.1 or 800..1100 | "B" bar | "Barometer" |
|
- | 158 | air temperature| "C" temperature | 2 decimals | "C" celsius | "TempAir" or "ENV_OUTAIR_T" |
|
- | 159 | pitch | "A" angle |-180..0 nose down 0..180 nose up | "D" degrees | "PTCH" or "PITCH" |
|
- | 160 | rolling | "A" angle |-180..0 L 0..180 R | "D" degrees | "ROLL" |
|
- | 161 | water temp | "C" temperature | 2 decimals | "C" celsius | "ENV_WATER_T" |
|
- | 162 | */ |
|
139 | // compile a logger message over USB |
163 | // compile a logger message over USB |
140 | char buffer[100]; |
164 | char buffer[200]; |
141 | int cnt = small_sprintf(buffer,"$TP,%ld,%ld",temp32,pres32); |
165 | int cnt = small_sprintf(buffer,"$MJXDR,C,%ld.%02ld,C,AirTemp,P,%01ld.%05ld,B,AirPres",temp32/100,temp32%100,pres32/100000,pres32%100000); |
142 | uint8_t sum=0; |
166 | uint8_t sum=0; |
143 | for(int i=1; i<cnt; i++) |
167 | for(int i=1; i<cnt; i++) |
144 | sum += buffer[i]; |
168 | sum += buffer[i]; |
145 | cnt+= small_sprintf(buffer+cnt,"*%02X\n",sum); |
169 | cnt+= small_sprintf(buffer+cnt,"*%02X\n",sum); |
146 | 170 |