Somehow this has to be simplified, I used a strict conversion of the existing C code. There were a lot of different steps that had to be dealt with to get to this point. The directory on the RPi holding all these files are very numerous and I hope I can remember all the different steps that occurred in order to produce these files.
If anybody wants to try this out on there own RPi, you will have to follow the posts in this thread and if something is not clear, ask a question. Just thinking, maybe I should try doing a wiringPi version...
Code: Select all
if bcm2835_init()=-1 then
print "error: init() fault!"
sleep : end
dim humi_val as ushort
dim temp_val as ushort
dim realh as single ' Float
dim realt as single ' Float
dim realf as single ' Float
SHT1x_InitPins() ' Initialise pins, hard coded
SHT1x_Measure_Start(SHT1xMeaT) ' Temp
SHT1x_Get_Measure_Value(@temp_val) ' Temp
SHT1x_Measure_Start(SHT1xMeaRh) ' Humidity
SHT1x_Get_Measure_Value(@humi_val) ' Humidity
realt = CSng(temp_val) ' Convert integer temp_val to float
realh = CSng(humi_val) ' Convert integer humi_val to float
' humidity, temperature
SHt1x_Calc(@realh, @realt) ' Calculate float values
realf = ((realt*1.8)+30.60) ' Calculate for F plus adjustment
print "Temp C: " & realt & "C"
print "Temp F: " & realf & "F"
print "Humid: " & realh
print "So far so good!"