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 machine import Pin, PWM | |
import utime | |
Trig = Pin(27, Pin.OUT) | |
Echo = Pin(26, Pin.IN, Pin.PULL_DOWN) | |
Buzzer = PWM(Pin(18)) | |
def CheckDistance(): | |
SpeedOfSoundInCM = 0.034 |
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
/* Otto DIY Robot | |
by Suad Anwar | |
This sample code is for Otto DIY Robot using Maker Pi RP2040 board. | |
https://my.cytron.io/p-maker-pi-rp2040-simplifying-robotics-with-raspberry-pi-rp2040 | |
*/ | |
#include <Servo.h> | |
#define PIN_YL 12 //servo[0] left leg |
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
const int LED = 10; | |
long random_led; | |
long random_time; | |
int difer_time(); | |
void setup() { | |
pinMode(LED, OUTPUT); | |
} | |
int min_led = 200; |
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 time | |
import board | |
import pwmio | |
from adafruit_motor import servo | |
# create a PWMOut object on Pin GP27. | |
pwm = pwmio.PWMOut(board.GP27, duty_cycle=2 ** 15, frequency=50) | |
# Create a servo object, my_servo. | |
my_servo = servo.Servo(pwm) |
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
/* | |
Project: CUnlock the Soenoid Door Lock Using A Keypad and Maker Nano #ArduinoNano | |
Board: Arduino Nano (Maker Nano) | |
Connections: | |
Nano | Relay | |
GND – GND | |
5V – VCC | |
A0 – SIG | |
Nano | Keypad |
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 array, time | |
from machine import Pin | |
import rp2 | |
from rp2 import PIO, StateMachine, asm_pio | |
# Configure the number of WS2812 LEDs. | |
NUM_LEDS = 8 | |
@asm_pio(sideset_init=PIO.OUT_LOW, out_shiftdir=PIO.SHIFT_LEFT, | |
autopull=True, pull_thresh=24) |
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 machine | |
import utime | |
sensor_temp = machine.ADC(machine.ADC.CORE_TEMP) | |
conversion_factor = 3.3 / (65535) | |
file = open("temps.txt", "w") | |
while True: | |
reading = sensor_temp.read_u16() * conversion_factor | |
temperature = 27 - (reading - 0.706)/0.001721 |
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
#! /usr/bin/python | |
# import the necessary packages | |
from imutils.video import VideoStream | |
from imutils.video import FPS | |
import face_recognition | |
import imutils | |
import pickle | |
import time | |
import cv2 |
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 SENSOR 3 | |
#define PIEZO 8 | |
#define NOTE_G5 784 | |
#define NOTE_C6 1047 | |
int Sound[] = {NOTE_G5, NOTE_C6}; | |
int SoundNoteDurations[] = {12, 8}; | |
#define playSound() playMelody(Sound, SoundNoteDurations, 2) |
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
#! /usr/bin/python | |
# import the necessary packages | |
from imutils.video import VideoStream | |
from imutils.video import FPS | |
import face_recognition | |
import imutils | |
import pickle | |
import time | |
import cv2 |
NewerOlder