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 cv2 | |
import numpy as np | |
img = cv2.imread("Cover.jpg") | |
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
template = cv2.imread("Raspberry Pi.jpg", 0) | |
w, h = template.shape[::-1] | |
count = 0 | |
res = cv2.matchTemplate(gray_img, template, cv2.TM_CCORR_NORMED ) | |
#methods = ['cv.TM_CCOEFF', 'cv.TM_CCOEFF_NORMED', 'cv.TM_CCORR','cv.TM_CCORR_NORMED', 'cv.TM_SQDIFF', 'cv.TM_SQDIFF_NORMED'] |
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
#include "Seeed_BMP280.h" | |
#include <Wire.h> | |
#include <Arduino.h> | |
#include <U8x8lib.h> | |
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); | |
BMP280 bmp280; | |
void setup() { | |
Serial.begin(9600); |
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
#include "DHT.h" | |
#include <Arduino.h> | |
#include <U8x8lib.h> | |
#define DHTPIN 3 | |
#define DHTTYPE DHT11 // DHT 11 | |
DHT dht(DHTPIN, DHTTYPE); | |
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); | |
#define LED 4 | |
#define PIEZO 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
import telepot | |
from picamera import PiCamera | |
import RPi.GPIO as GPIO | |
import time | |
from time import sleep | |
import datetime | |
from telepot.loop import MessageLoop | |
from subprocess import call | |
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
from gpiozero import MotionSensor | |
from picamera import PiCamera | |
import time | |
from time import sleep | |
pir = MotionSensor(4) | |
camera = PiCamera() | |
camera.rotation = 180 | |
while True: |
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
from gpiozero import MotionSensor | |
from picamera import PiCamera | |
import time | |
from time import sleep | |
pir = MotionSensor(4) | |
camera = PiCamera() | |
camera.rotation = 180 | |
while True: |
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
from picamera import PiCamera | |
from time import sleep | |
camera = PiCamera() | |
camera.rotation = 180 | |
camera.start_preview(fullscreen = False, window = (1300,10,640,480)) | |
camera.start_recording('/home/pi/Desktop/video.h264') | |
sleep(5) | |
camera.stop_recording() |
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
from picamera import PiCamera | |
from time import sleep | |
camera = PiCamera() | |
camera.rotation = 180 | |
camera.start_preview() | |
sleep(5) | |
camera.capture('/home/pi/Desktop/image.jpg') | |
camera.stop_preview() |
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
#define MQ2 A0 | |
#define GREEN_LED 4 | |
#define YELLOW_LED 5 | |
#define RED_LED 6 | |
#define PIEZO 8 | |
int sensorValue = 0; | |
void setup() | |
{ | |
Serial.begin(9600); // Initialize serial communications with the PC |
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
#pragma mark - Depend ESP8266Audio and ESP8266_Spiram libraries | |
#include <M5Stack.h> | |
#include <WiFi.h> | |
#include "AudioFileSourceSD.h" | |
#include "AudioFileSourceID3.h" | |
#include "AudioGeneratorMP3.h" | |
#include "AudioOutputI2S.h" | |
AudioGeneratorMP3 *mp3; | |
AudioFileSourceSD *file; |