Hardware Reference
In-Depth Information
Weather station for Chicago, IL
The weather data is obtained as follows:
result = pywapi.get_weather_from_noaa('KORD')
The temperature data is retrieved as follows:
temperature = int(float(result['temp_f']))
The retrieved data is written to the serial port:
temperature_string= "S"+str(temperature)
#print(temperature_string)
seport.write(bytes(temperature_string,'ascii'))
Based on the temperature data, the RGB strip, BlinkM control data,
and 8x8 matrix data are written to the Arduino:
if(temperature>40):
seport.write(bytes("G",'ascii'))
sleep(5)
seport.write(bytes("P4",'ascii'))
sleep(5)
seport.write(bytes("M1",'ascii'))
sleep(5)
 
Search WWH ::




Custom Search