This file contains hidden or 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
#include<SoftwareSerial.h> //Included SoftwareSerial Library | |
//Started SoftwareSerial at RX and TX pin of ESP8266/NodeMCU | |
SoftwareSerial s(3,1); | |
void setup() { | |
//Serial S Begin at 9600 Baud | |
s.begin(9600); | |
} | |
void loop() { |
This file contains hidden or 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
int data; //Initialized variable to store recieved data | |
void setup() { | |
//Serial Begin at 9600 Baud | |
Serial.begin(9600); | |
} | |
void loop() { | |
data = Serial.read(); //Read the serial data and store it | |
delay(1000); |
This file contains hidden or 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
#include <Wire.h> //include Wire.h library | |
#include "RTClib.h" //include Adafruit RTC library | |
RTC_DS3231 rtc; //Make a RTC DS3231 object | |
//Set the names of days | |
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; | |
void setup () { | |
Serial.begin(9600); //Begin the Serial at 9600 Baud |
This file contains hidden or 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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(17,GPIO.OUT) | |
while True: | |
GPIO.out(17, GPIO.HIGH) | |
time.sleep(1) | |
GPIO.out(17, GPIO.LOW) | |
time.sleep(1) |
This file contains hidden or 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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
TRIG = 4 | |
ECHO = 17 | |
print "Distance Measurement In Progress" | |
GPIO.setup(TRIG,GPIO.OUT) |
This file contains hidden or 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
from gpiozero import LightSensor | |
ldr = LightSensor(4) | |
while True: | |
print(ldr.value) |
This file contains hidden or 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 RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BOARD) | |
input1 = 3 | |
input2 = 5 | |
enable = 8 | |
GPIO.setup(input1,GPIO.OUT) |
This file contains hidden or 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 time | |
import Adafruit_CharLCD as LCD | |
# Raspberry Pi pin setup | |
rs = 25 | |
en = 24 | |
d4 = 23 | |
d5 = 17 | |
d6 = 18 | |
d7 = 22 |
This file contains hidden or 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
#include <dht.h> | |
dht DHT; | |
#define DHT11_DPIN 8 | |
void setup(){ | |
Serial.begin(9600); | |
} |