Skip to content

Instantly share code, notes, and snippets.

View iotguider's full-sized avatar

Iotguider iotguider

View GitHub Profile
@iotguider
iotguider / Serial_communication_of_ESP8266.ino
Last active December 15, 2018 15:35
Code of ESP8266 for Serial communication between ESP8266 and Arduino
#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() {
@iotguider
iotguider / Serial_communication_of_Arduino.ino
Created August 22, 2017 16:14
Code of Arduino for Serial communication between ESP8266 and Arduino
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);
@iotguider
iotguider / DS3231_Real_Time_Clock_Module_in_Arduino.ino
Created August 25, 2017 14:08
Code for interfacing DS3231 RTC Module in Arduino
#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
@iotguider
iotguider / Blinking_LED_with_Raspberry_Pi_using_python.py
Last active November 6, 2017 10:25
Code for Blinking LED with Raspberry Pi using python
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)
@iotguider
iotguider / LED_with_Pushbutton_in_Raspberry_Pi.py
Created September 4, 2017 11:05
Code for LED with Pushbutton in Raspberry Pi
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(23,GPIO.IN)
GPIO.setup(18,GPIO.OUT)
while True:
inputval = GPIO.input(23)
@iotguider
iotguider / Ultrasonic_Distance_Sensor_in_Raspberry_Pi.py
Last active September 7, 2017 09:16
Code for Ultrasonic Distance Sensor in Raspberry Pi
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)
@iotguider
iotguider / Interfacing_Light_Dependent_Resistor_(LDR)_in_Raspberry_Pi.py
Created September 10, 2017 09:31
Code for Interfacing Light Dependent Resistor (LDR) in Raspberry Pi
from gpiozero import LightSensor
ldr = LightSensor(4)
while True:
print(ldr.value)
@iotguider
iotguider / H-Bridge_Motor_Driver_in_Raspberry_Pi.py
Created September 13, 2017 09:11
Code for H-Bridge Motor Driver in Raspberry Pi using python
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BOARD)
input1 = 3
input2 = 5
enable = 8
GPIO.setup(input1,GPIO.OUT)
@iotguider
iotguider / Interfacing_16x2_character_LCD_in_Raspberry_Pi_using_python.py
Created September 16, 2017 11:11
Code for interfacing 16x2 character LCD in Raspberry Pi using python
import time
import Adafruit_CharLCD as LCD
# Raspberry Pi pin setup
rs = 25
en = 24
d4 = 23
d5 = 17
d6 = 18
d7 = 22
@iotguider
iotguider / DHT11_Temperature_and_Humidity_Sensor_with_Arduino.ino
Created October 4, 2017 11:11
Code for DHT11 Temperature and Humidity Sensor with Arduino
#include <dht.h>
dht DHT;
#define DHT11_DPIN 8
void setup(){
Serial.begin(9600);
}