Skip to content

Instantly share code, notes, and snippets.

#include <esp_now.h>
#include <WiFi.h>
//pins to control the robot
#define IN1 18
#define IN2 19
#define IN3 21
#define IN4 22
#define ENA 25 //enable M1
#define ENB 26 //enable M2
import cv2
import numpy as np
import serial
import time
import math
# Read the camera
cap = cv2.VideoCapture(0)
# Serial
import cv2
import numpy as np
import time
import math
# Read the camera
cap = cv2.VideoCapture(0)
# Define range of colors in HSV
lower = {'Blue':(40 , 170 , 115),'Green':(63 , 50 , 50),'Pink':(125 , 100 , 100)}
import cv2
import numpy as np
import time
import math
# Read the camera
cap = cv2.VideoCapture(0)
# Define range of colors in HSV
lower = {'Yellow':(15,90,95)}
import cv2
import numpy as np
import time
import math
# Read the camera
cap = cv2.VideoCapture(0)
# Define range of colors in HSV
lower = {'Yellow':(15,90,95)}
@GSE-UP
GSE-UP / photo.py
Last active September 11, 2019 16:51
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
# Capture frame-by-frame
ret, frame = cap.read()
# do what you want with frame
# and then save to file
cv2.imwrite('/home/marco/Soccer_Robot/colorfilters-master/image.jpg', frame)
import os #import the os library (used to clear the screen when necessary)
import RPi.GPIO as gpio #import library used to control the Raspnerry’s GPIO
import serial #import library responsible for the serial communication
import time #import library that makes it possible to use the delay function
import subprocess #import library responsible for play the songs
#start serial
ser = serial.Serial("/dev/ttyS0",9600) #define the device name and the baud rate
#clear screen
clear = lambda: os.system('clear')
#set pins for relay control
float sensor = A0;
void setup() {
pinMode(sensor,INPUT);
Serial.begin(9600);
}
void loop() {
Serial.flush();
float x=analogRead(sensor)*0.0048828125*16.67;
#include <SPI.h>
#include <DMD2.h>
#include <fonts/Arial_Black_16.h> //include the library of the fonts used on the LED display
#include <string.h>
//starts LED display with 3 columns and 1 line of matrix (1x1 matrix = 16x16 LEDs)
SoftDMD dmd(3,1);
DMD_TextBox box(dmd);
String save=""; //starts a string responsible to save the data
@GSE-UP
GSE-UP / LoRa_receiver.ino
Last active November 22, 2018 17:46
LoRa 32 WIFI Receiver
#include <SPI.h>
#include <LoRa.h>
#include <Wire.h> //responsible for i2c communication
#include "SSD1306Wire.h"
#define SS 18
#define RST 14
#define DI0 26
SSD1306Wire display(0x3c, 4, 15);