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, ADC | |
from time import sleep | |
pot = ADC(Pin(28)) | |
servo = PWM(Pin(0)) | |
servo.freq(50) | |
def move_servo(degrees): | |
if degrees > 180: |
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 time | |
servo = PWM(Pin(0)) | |
servo.freq(50) | |
while True: | |
for position in range(1000, 9000, 50): | |
servo.duty_u16(position) | |
time.sleep(0.1) |
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
#INSTALL SELENIUM BEFORE RUNNING THIS CODE | |
#pip3 install selenium | |
import csv | |
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.common.by import By | |
import time | |
import getpass | |
from selenium.common.exceptions import NoSuchElementException |
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 LIBRARIES | |
from bs4 import BeautifulSoup | |
import requests | |
#REQUEST WEBPAGE AND STORE IT AS A VARIABLE | |
page_to_scrape = requests.get("http://quotes.toscrape.com") | |
#USE BEAUTIFULSOUP TO PARSE THE HTML AND STORE IT AS A VARIABLE | |
soup = BeautifulSoup(page_to_scrape.text, 'html.parser') |
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 stp 2 | |
#define dir 3 | |
char user_input; | |
int x; | |
int y; | |
int state; | |
void setup() { | |
pinMode(stp, OUTPUT); |
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/env python | |
import RPi.GPIO as GPIO | |
import pygame | |
import time | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(11, GPIO.IN) | |
pygame.mixer.init() |
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 <IRremote.h> | |
#include <IRremoteInt.h> | |
#include <Brain.h> | |
IRsend irsend; | |
Brain brain(Serial); | |
const int ledPin = 3; | |
long interval = 500; | |
long previousMillis = 0; | |
int ledState = LOW; | |
int medValue; |
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 <IRremote.h> | |
const int RECV_PIN = 11; | |
IRrecv irrecv(RECV_PIN); | |
decode_results results; | |
void setup() | |
{ |
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 the required dependencies | |
import picamera | |
from PIL import Image | |
from time import sleep | |
#Start a loop with the Pi camera | |
with picamera.PiCamera() as camera: | |
#Set the resolution, fps, and then start the preview | |
camera.resolution = (640, 480) | |
camera.framerate = 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
#include <Servo.h> | |
//declare constants for audio input | |
int Musicread = 0; | |
int Music; | |
//LED pin is only for testing | |
const int ledPin = 13; | |
//declare constants for servos |
NewerOlder