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
// provision the necessary pins in order to use it | |
// provision PIR pin as input and LedPin as output | |
GpioPinDigitalInput pir = gpio.provisionDigitalInputPin(RaspiPin.GPIO_29); | |
GpioPinDigitalOutput ledPin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_04); |
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
// monitor for Pin State changes | |
// if state is high, ON Led | |
pir.addListener(new GpioPinListenerDigital(){ | |
@Override | |
public void handleGpioPinDigitalStateChangeEvent(GpioPinDigitalStateChangeEvent event){ | |
System.out.println(event.getState()); | |
// turn led ON if pin attached to PIR sensor is high | |
if(event.getState().isHigh() ){ | |
ledPin.high(); |
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
void loop() | |
{ | |
Serial.println("steinacoz.com"); | |
if (Serial.available()) | |
{ | |
move(Serial.read() - '0'); | |
} | |
delay(1000); | |
} |
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
print(ser.readline()) | |
num = random.randint(1, 5) | |
print(num) | |
ser.write(bytes(str(num), 'utf-8')) | |
print(str(num)) | |
time.sleep(5) |
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
def ldr(): | |
ldrValue = adc.read_adc(0, gain=GAIN) | |
return ldrValue | |
while True: | |
try: | |
print('LDR raw value: ' + str(ldr())) | |
sleep(2) | |
except KeyboardInterrupt: | |
GPIO.cleanup() |
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 Adafruit_ADS1x15 | |
from time import sleep, strftime, time | |
import RPi.GPIO as GPIO | |
import numpy | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
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 'package:flutter/material.dart'; | |
import 'dart:async'; | |
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override |
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
/* Create a WiFi access point and provide a web server on it. */ | |
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
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
#windows starts | |
# all the windows are created here and are hidden immediately | |
app = App(title="Biometeric System", width=210, height=210,layout="grid") | |
admin_menu_window = Window(app, title="Admin Menu", width=210, height=210,layout="grid") | |
admin_menu_window.hide() | |
admin_mainmenu_pass_window = Window(app, title="Authenication yourself", width=210, height=210) | |
admin_mainmenu_pass_window.hide() |
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
#enroll window starts | |
def enroll(): | |
## Gets some sensor information | |
print('Currently used templates: ' + str(f.getTemplateCount()) +'/'+ str(f.getStorageCapacity())) | |
enroll_status_text1.value = 'Currently used templates: ' + str(f.getTemplateCount()) +'/'+ str(f.getStorageCapacity()) | |
## Tries to enroll new finger | |
try: | |
print('Waiting for finger...') | |
enroll_status_text2.value = 'Waiting for finger...' | |
## Wait that finger is read |