Professional Documents
Culture Documents
Pythoncode
Pythoncode
import time
import urequests
PHONE_NO = "7829010171"
alpha = 1
period = 50
# Initialize variables
old_value = 0
old_refresh = 0
rev = 0
rand_number = 0
temp = 0
# Function to send SMS
global rand_number
url = "https://api.thingspeak.com/apps/thinghttp/send_request?
api_key=QF7VR5BU3EWZ6TDL&field1=" + str(bpm)
urequests.get(url)
print("https://maps.google.com/maps?=loc:12.730810,77.706870")
print("Sent\n")
print("")
def get_temp_celsius():
adc_val = PIN_LM35.read()
temp_c = millivolt / 50
return temp_c
def get_bpm():
beat = ADC(0).read()
old_value = value
old_refresh = refresh
return b
def isr(pin):
global rev
rev += 1
# Main loop
while True:
temp_celsius = get_temp_celsius()
time.sleep(2)
bpm = get_bpm()
print("")
YELLOW_LED.value(0)
time.sleep(0.1)
GREEN_LED.value(1)
time.sleep(0.1)
else:
YELLOW_LED.value(1)
time.sleep(0.1)
GREEN_LED.value(0)
time.sleep(0.1)
send_sms(PHONE_NO, bpm