This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Needed modules will be imported and configured | |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
# Declaration of the input pin which is connected with the sensor | |
GPIO_PIN = 4 | |
GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask | |
from flask_restful import Resource, Api | |
from flask_cors import CORS | |
def measure_temp(): | |
temp = os.popen("vcgencmd measure_temp").readline() | |
return (temp.replace("temp=","")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Needed modules will be imported and configured | |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
# Declaration of the input pin which is connected with the sensor | |
GPIO_PIN = 18 | |
GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) |