Using cron executing a bash script:
-every 12 minutes get the temperture(Python)
-Display the time, temperture, and location(curses)
-Blink the LED 20 times once every 5 seconds (C)
Using cron:
-Every 5 minutes send the temperture, location, and time to professor Donald's server (TCP-C)
-Blink the LED 40 times once a second(C)
-Professor Donald's return message will include a JSON string; display the returned "value" from Prof. Donald's
server in the middle of your screen(C and Curses?)
I am writing python code for getting temparature in every 12 minutes;
!/usr/bin/python/temp.py
import time
timeformat = time.strftime("Time_format: %H:%M, Date: %Y%m%d, ")
# Add the filename with the date for it will create new log daily
logname = time.strftime("")
filename = "".join(["/home/pi_programs/bredhult_temp.txt"])
# If already created, this will open the current log file, there is no need to create a new one
datafile = open(filename, "a")
textfile = open("/sys/bus/w1/devices/28-000006879f89/w1_slave")
# read the data and close the fil
text = textfile.read()
textfile.close()
# Split the data and extract the temperature value
temperature_data = text.split()[-1]
temperature = float(temperature_data[12:])
temperature = temperature / 1000
# write our newly formatted date, time and sensor value to our log file
datafile.write(timeformat + "Temp: " + str(temperature) + "\n")
datafile.close()
Using cron executing a bash script: -every 12 minutes get the temperture(Python) -Display the time, temperture,...