I put together another RPi board with a sht11 module attached, placed it in a make shift box to keep it minimally weather proof and placed the project box outside which has overhead protection from rain, snow, and other things. The intent is to keep it outside during the winter months to see if the items included will withstand the freezing temperatures. Plus I will try to implement some temp data logging procedures, I can see this program growing already.
The next step is to implement the temperature readings which will be followed by implementing an RPi NoIR camera to see what kind of night time pictures I can take, and what they really look like. Then I will add a proximity sensor to automate a picture snap when something gets within a reasonable distance. This part might lead to using FB threads, so this should be interesting.
Code: Select all
'FBmobile.bas
'
' UI program for Raspberry Pi terminal window.
' Oct 31, 2014
' Version 1.0
'
#inclib "bcm2835" ' Access RPi GPIO
#inclib "RPi_sht1x" ' Access RPI sht11 module
#include "bcm2835.bi"
#include "RPi_SHT1x.bi"
#include "vbcompat.bi" ' Time and date functions
' Declare global variables
dim as string Key,buffer,buffer1
' Declare Subs
declare sub menu()
' Declare Functions
'**********
' Main
print "FBmobile Program"
do
' Start collecting keypress
buffer = input$(1)
buffer1 = buffer1 + buffer
print "" & buffer; ' Print the keypress.
' If Esc then end program.
if buffer = chr$(27) then
goto Cend ' A way to get out of do ... loop
end if
' Check for EOL CR then strip away.
if buffer = chr$(13) then
buffer1 = rtrim(buffer1, chr$(13))
' Command IO selection
if buffer1 = "quit" then
exit do ' Exit and run code after to do ... loop
elseif buffer1 = "help" or buffer1 = "?" then
menu()
elseif buffer1 = "date" then
print Date
elseif buffer1 = "time" then
print Time
else
print "Unknown Command"
end if
buffer1 = ""
end if
loop
'**********
Cend:
print "Program stop"
end
'**********
' Functions and Subroutines
sub menu()
print "Menu - help, quit, time, date, "
print "quit ends program. "
end sub