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 <EEPROM.h> | |
int a = 0; | |
int value; | |
void setup() | |
{ | |
Serial.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
#include <EEPROM.h> | |
String a = "iotguider"; | |
void setup() { | |
// put your setup code here, to run once: | |
for(int i=0;i<a.length();i++) | |
{ | |
EEPROM.write(i,a.charAt(i)); | |
} | |
} |
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 requests | |
import json | |
url="http://example.com/index.php" | |
r = requests.post('http://example.com/index.php', params={'q': 'raspberry pi request'}) | |
if r.status_code != 200: | |
print "Error:", r.status_code |
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 requests | |
import json | |
url="http://example.com/index.php" | |
r = requests.get('http://example.com/index.php', params={'q': 'raspberry pi request'}) | |
if r.status_code != 200: | |
print "Error:", r.status_code |
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 # calling for header file for GPIO’s of PI | |
import time # calling for time to provide delays in program | |
GPIO.setmode (GPIO.BCM) # programming the GPIO by BCM pin numbers. | |
GPIO.setup(17,GPIO.OUT) # initialize GPIO17 as an output | |
servo = GPIO.PWM(17,50) # GPIO17 as PWM output, with 50Hz frequency | |
servo.start(0) # generate PWM signal with 7.5% duty cycle | |
servo.ChangeDutyCycle(7.5) # change duty cycle for getting the servo position to 90º | |
time.sleep(1) # sleep for 1 second |
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 <Servo.h> | |
// Create a servo object | |
Servo servo; | |
void setup() { | |
Servo1.attach(8); //Attaches servo to digital pin 8 | |
} | |
void loop(){ | |
// Make servo go to 90 degrees |
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 <RtcDS3231.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
RtcDS3231<TwoWire> Rtc(Wire); | |
ESP8266WebServer server(80); | |
const char* ssid = "ESPWiFi"; | |
const char* password = "Password"; |
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 os | |
import sys | |
push_button = 23 | |
led = 18 | |
def setup(): | |
GPIO.setmode(GPIO.BCM) # Numbers GPIOs by physical location | |
GPIO.setup(led,GPIO.OUT) | |
GPIO.setup(button,GPIO.IN,pull_up_down=GPIO.PUD_DOWN) | |
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 Led = 13 ;// define LED Interface | |
int knockmodule = 2; // define the vibration sensor interface | |
int val; // define numeric variables val | |
void setup () | |
{ | |
pinMode (Led, OUTPUT) ; // define LED as output interface | |
pinMode (knockmodule, INPUT) ; // output interface defines vibration sensor | |
} |
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) | |
sensor = 17 | |
led = 27 | |
GPIO.setup(sensor, GPIO.IN, pull_up_down = GPIO.PUD_UP) | |
GPIO.setup(led, GPIO.OUT) | |