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 <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 |
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 | |
import serial | |
import time | |
import math | |
# Read the camera | |
cap = cv2.VideoCapture(0) | |
# Serial |
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 | |
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)} |
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 | |
import time | |
import math | |
# Read the camera | |
cap = cv2.VideoCapture(0) | |
# Define range of colors in HSV | |
lower = {'Yellow':(15,90,95)} |
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 | |
import time | |
import math | |
# Read the camera | |
cap = cv2.VideoCapture(0) | |
# Define range of colors in HSV | |
lower = {'Yellow':(15,90,95)} |
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 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) |
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 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 |
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
float sensor = A0; | |
void setup() { | |
pinMode(sensor,INPUT); | |
Serial.begin(9600); | |
} | |
void loop() { | |
Serial.flush(); | |
float x=analogRead(sensor)*0.0048828125*16.67; |
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 <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 |
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 <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); |
NewerOlder