Hello,
first let me wish to everybody a merry Christmas.
Now let me come to my project: Hippy helped me a lot with coding the barometer coding on a 08M2. it is almost working except the sensitivity which is somewhat erratic.
The code was written by Hippy but I simplified it just to read the pressure. Being interested to transmit down to ground the pressure variations (positive or negative) to assess if a model glider is ascending or descending,
The final code will read the pressure, store the value in a word, wait one second and loop back to compare the stored value with the new one. the result will generate a sound which frequency will depend on the difference of the two words. The information will be radio transmitted to ground.
The problem I am facing is the interpretation of the pressure readings.
Hippy helped me a lot with the barometer coding on a 08M2. it is almost working except the resolution which is not adequate on word Ph alone.
The code is:
The terminal output is:
The Word Ph is ok but the meaning of Word PI is difficult to understand (see the attached terminal picture)
Hippy can you or someone else help
first let me wish to everybody a merry Christmas.
Now let me come to my project: Hippy helped me a lot with coding the barometer coding on a 08M2. it is almost working except the sensitivity which is somewhat erratic.
The code was written by Hippy but I simplified it just to read the pressure. Being interested to transmit down to ground the pressure variations (positive or negative) to assess if a model glider is ascending or descending,
The final code will read the pressure, store the value in a word, wait one second and loop back to compare the stored value with the new one. the result will generate a sound which frequency will depend on the difference of the two words. The information will be radio transmitted to ground.
The problem I am facing is the interpretation of the pressure readings.
Hippy helped me a lot with the barometer coding on a 08M2. it is almost working except the resolution which is not adequate on word Ph alone.
The code is:
Code:
#Picaxe 08M2
#Terminal 4800
#No_Data
Symbol C0 = w1 : Symbol C0.msb = b3 : Symbol C0.lsb = b2
Symbol C1 = w2 : Symbol C1.msb = b5 : Symbol C1.lsb = b4
Symbol C2 = w3 : Symbol C2.msb = b7 : Symbol C2.lsb = b6
Symbol C3 = w4 : Symbol C3.msb = b9 : Symbol C3.lsb = b8
Symbol C4 = w5 : Symbol C4.msb = b11 : Symbol C4.lsb = b10
Symbol C5 = w6 : Symbol C5.msb = b13 : Symbol C5.lsb = b12
Symbol C6 = w7 : Symbol C6.msb = b15 : Symbol C6.lsb = b14
Symbol C7 = w8 : Symbol C7.msb = b17 : Symbol C7.lsb = b16
Symbol Pl = w9 : Symbol Pl.msb = b19 : Symbol Pl.lsb = b18
Symbol Ph = w10 : Symbol Ph.msb = b21 : Symbol Ph.lsb = b20
'Symbol Tl = w11 : Symbol Tl.msb = b23 : Symbol Tl.lsb = b22
'Symbol Th = w12 : Symbol Th.msb = b25 : Symbol Th.lsb = b24
Symbol CMD_RESET = $1E
Symbol CMD_D1_256 = $40
Symbol CMD_D1_512 = $42
Symbol CMD_D1_1024 = $44
Symbol CMD_D1_2048 = $46
Symbol CMD_D1_4096 = $48
'Symbol CMD_D2_256 = $50
'Symbol CMD_D2_512 = $52
'Symbol CMD_D2_1024 = $54
'Symbol CMD_D2_2048 = $56
'Symbol CMD_D2_4096 = $58
Symbol CMD_ADC = $00
Symbol CMD_PROM_0 = $A0
Symbol CMD_PROM_1 = $A2
Symbol CMD_PROM_2 = $A4
Symbol CMD_PROM_3 = $A6
Symbol CMD_PROM_4 = $A8
Symbol CMD_PROM_5 = $AA
Symbol CMD_PROM_6 = $AC
Symbol CMD_PROM_7 = $AE
PowerOnReset:
HI2cSetup I2CMASTER, %11101110, I2CSLOW, I2CBYTE
HI2cOut ( CMD_RESET )
Pause 10
HI2cOut ( CMD_PROM_0 ) : HI2cIn ( C0.msb, C0.lsb )
HI2cOut ( CMD_PROM_1 ) : HI2cIn ( C1.msb, C1.lsb )
HI2cOut ( CMD_PROM_2 ) : HI2cIn ( C2.msb, C2.lsb )
HI2cOut ( CMD_PROM_3 ) : HI2cIn ( C3.msb, C3.lsb )
HI2cOut ( CMD_PROM_4 ) : HI2cIn ( C4.msb, C4.lsb )
HI2cOut ( CMD_PROM_5 ) : HI2cIn ( C5.msb, C5.lsb )
HI2cOut ( CMD_PROM_6 ) : HI2cIn ( C6.msb, C6.lsb )
HI2cOut ( CMD_PROM_7 ) : HI2cIn ( C7.msb, C7.lsb )
MainLoop:
do
HI2cOut ( CMD_D1_4096 )
Pause 10
HI2cOut ( CMD_ADC )
Pause 10
HI2cIn ( Ph.msb, Ph.lsb, Pl.msb, Pl.lsb)
sertxd(#Ph," ",#Pl.msb," ",# Pl.lsb,cr,lf)
pause 100
Loop
The Word Ph is ok but the meaning of Word PI is difficult to understand (see the attached terminal picture)
Hippy can you or someone else help
Attachments
-
39.2 KB Views: 4