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 vibration = 2; // define the vibration sensor interface | |
int val; // define numeric variables val | |
void setup () | |
{ | |
pinMode (Led, OUTPUT) ; // define LED as output interface | |
pinMode (vibration, 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
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
import time | |
#GPIO SETUP | |
sound = 17 | |
led = 27 | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(sound, GPIO.IN) | |
GPIO.setup(led,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 flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'Hello world' | |
@app.route('/<name>') | |
def hello(name): |
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 flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'Hello world' | |
@app.route('/iotguider') | |
def index(): |
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 flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'Hello world' | |
if __name__ == '__main__': | |
app.run(debug=True, host='0.0.0.0') |
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; | |
int soundPin=7; | |
boolean val =0; | |
void setup(){ | |
pinMode(led, OUTPUT); | |
pinMode(soundPin, INPUT); | |
Serial.begin (9600); | |
} | |
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) | |
# The input pin of the Sensor will be declared. Additional to that the pullup resistor will be activated | |
tiltpin = 27 | |
ledpin = 17 | |
GPIO.setup(tiltpin, GPIO.IN) | |
GPIO.setup(ledpin,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
const int LED = 13; | |
const int TiltSwitch = 2; | |
int val = 0; //Initialize value to zero. | |
void setup() { | |
pinMode (LED,OUTPUT); //Initialize LED pin. | |
pinMode (TiltSwitch,INPUT); //Initialize Tilt Switch pin. | |
Serial.begin(9600); | |
} | |
void loop() { | |
val = digitalRead(TiltSwitch); //Store sensor value in variable. |
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
void setup () { | |
// Initialize the digital pin as an output. | |
// Pin 11 has an LED connected on most Arduino boards: | |
pinMode (11, OUTPUT); | |
} | |
void loop () { | |
digitalWrite (11, HIGH); // set the LED on | |
delay (2000); // wait for a second | |
digitalWrite (11, LOW); // set the LED off |