Added so much stuff I forgot again
This commit is contained in:
parent
d1f8f7294b
commit
d61fdb790a
BIN
Spring 2025/.DS_Store
vendored
BIN
Spring 2025/.DS_Store
vendored
Binary file not shown.
BIN
Spring 2025/ARTH 105/Haldrup Comparison Essay.docx
Normal file
BIN
Spring 2025/ARTH 105/Haldrup Comparison Essay.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ARTH 105/Haldrup Comparison Essay.pdf
Normal file
BIN
Spring 2025/ARTH 105/Haldrup Comparison Essay.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
Spring 2025/ENGR 490/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/1/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/1/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/10/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/1_haldrup_camera_connection.HEIC
Normal file
BIN
Spring 2025/ENGR 490/10/1_haldrup_camera_connection.HEIC
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/1_haldrup_camera_connection.jpg
Normal file
BIN
Spring 2025/ENGR 490/10/1_haldrup_camera_connection.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 MiB |
BIN
Spring 2025/ENGR 490/10/1_my_photo_photograph.jpg
Normal file
BIN
Spring 2025/ENGR 490/10/1_my_photo_photograph.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
BIN
Spring 2025/ENGR 490/10/2_my_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/10/2_my_video.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/3_haldrup_camera.mp4
Normal file
BIN
Spring 2025/ENGR 490/10/3_haldrup_camera.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/3_my_photo_camera.jpg
Normal file
BIN
Spring 2025/ENGR 490/10/3_my_photo_camera.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
Spring 2025/ENGR 490/10/4_haldrup_mini_project.mp4
Normal file
BIN
Spring 2025/ENGR 490/10/4_haldrup_mini_project.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/4_mini_project_photo.jpg
Normal file
BIN
Spring 2025/ENGR 490/10/4_mini_project_photo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
Spring 2025/ENGR 490/10/5_haldrup_rev_mini_project.mp4
Normal file
BIN
Spring 2025/ENGR 490/10/5_haldrup_rev_mini_project.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/5_rev_mini_capture12.jpg
Normal file
BIN
Spring 2025/ENGR 490/10/5_rev_mini_capture12.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
30
Spring 2025/ENGR 490/10/5_rev_mini_project.py
Normal file
30
Spring 2025/ENGR 490/10/5_rev_mini_project.py
Normal file
@ -0,0 +1,30 @@
|
||||
from picamera2 import Picamera2, Preview
|
||||
from gpiozero import DistanceSensor
|
||||
import time
|
||||
import os
|
||||
|
||||
user = os.getlogin()
|
||||
user_home = os.path.expanduser(f'~{user}')
|
||||
|
||||
camera = Picamera2()
|
||||
camera.start()
|
||||
|
||||
sensor = DistanceSensor(echo=24, trigger=23)
|
||||
|
||||
try:
|
||||
i = 1
|
||||
while (1):
|
||||
dis = sensor.distance * 100
|
||||
print('Distance: {:.2f} cm'.format(dis))
|
||||
if dis < 100:
|
||||
camera.capture_file(f'{user_home}/Assignments/10/rev_capture%s.jpg' % i)
|
||||
print('The number is %s' % i)
|
||||
time.sleep(3)
|
||||
i += 1
|
||||
else:
|
||||
print('waiting')
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
camera.stop_preview
|
||||
camera.stop
|
||||
pass
|
||||
BIN
Spring 2025/ENGR 490/10/Movs/haldrup_camera.MOV
Normal file
BIN
Spring 2025/ENGR 490/10/Movs/haldrup_camera.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/Movs/haldrup_mini_project.MOV
Normal file
BIN
Spring 2025/ENGR 490/10/Movs/haldrup_mini_project.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/10/Movs/haldrup_rev_mini_project.MOV
Normal file
BIN
Spring 2025/ENGR 490/10/Movs/haldrup_rev_mini_project.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/11/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/1_cv_picamera2_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/11/1_cv_picamera2_video.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/2_face_detection_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/11/2_face_detection_video.mp4
Normal file
Binary file not shown.
55
Spring 2025/ENGR 490/11/3_smile_eye_detection.py
Normal file
55
Spring 2025/ENGR 490/11/3_smile_eye_detection.py
Normal file
@ -0,0 +1,55 @@
|
||||
from picamera2 import Picamera2
|
||||
import cv2
|
||||
import os
|
||||
|
||||
|
||||
camera = Picamera2()
|
||||
|
||||
preview_config = camera.create_preview_configuration(main={'size': (640, 480)})
|
||||
|
||||
camera.configure(preview_config)
|
||||
camera.start()
|
||||
|
||||
if not os.path.exists("haarcascade_frontalface_default.xml"):
|
||||
import urllib.request
|
||||
url = "https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_default.xml"
|
||||
urllib.request.urlretrieve(url, "haarcascade_frontalface_default.xml")
|
||||
|
||||
if not os.path.exists("haarcascade_eye.xml"):
|
||||
import urllib.request
|
||||
url = "https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_eye.xml"
|
||||
urllib.request.urlretrieve(url, "haarcascade_eye.xml")
|
||||
|
||||
if not os.path.exists("haarcascade_smile.xml"):
|
||||
import urllib.request
|
||||
url = "https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_smile.xml"
|
||||
urllib.request.urlretrieve(url, "haarcascade_smile.xml")
|
||||
|
||||
|
||||
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
|
||||
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
|
||||
smile_cascade = cv2.CascadeClassifier('haarcascade_smile.xml')
|
||||
|
||||
|
||||
while(1):
|
||||
frame = camera.capture_array()
|
||||
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
||||
gray = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
|
||||
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
|
||||
eyes = eye_cascade.detectMultiScale(gray, 1.3, 5)
|
||||
smiles = smile_cascade.detectMultiScale(gray, 1.8, 20)
|
||||
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
|
||||
|
||||
for (x, y, w, h) in eyes:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
||||
|
||||
for (x, y, w, h) in smiles:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 0, 255), 2)
|
||||
|
||||
cv2.imshow("Real-Time Face Detection", frame)
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
cv2.destroyAllWindows()
|
||||
BIN
Spring 2025/ENGR 490/11/3_smile_eye_detection_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/11/3_smile_eye_detection_video.mp4
Normal file
Binary file not shown.
54
Spring 2025/ENGR 490/11/4_mobile_net_ssd.py
Normal file
54
Spring 2025/ENGR 490/11/4_mobile_net_ssd.py
Normal file
@ -0,0 +1,54 @@
|
||||
from picamera2 import Picamera2
|
||||
import cv2
|
||||
import numpy as np
|
||||
import os
|
||||
import urllib.request
|
||||
|
||||
if not os.path.exists("MobileNetSSD_deploy.prototxt"):
|
||||
urllib.request.urlretrieve(
|
||||
"https://raw.githubusercontent.com/chuanqi305/MobileNet-SSD/master/deploy.prototxt",
|
||||
"MobileNetSSD_deploy.prototxt"
|
||||
)
|
||||
|
||||
if not os.path.exists("MobileNetSSD_deploy.caffemodel"):
|
||||
urllib.request.urlretrieve(
|
||||
"https://github.com/chuanqi305/MobileNet-SSD/raw/master/mobilenet_iter_73000.caffemodel",
|
||||
"MobileNetSSD_deploy.caffemodel"
|
||||
)
|
||||
|
||||
net = cv2.dnn.readNetFromCaffe('MobileNetSSD_deploy.prototxt', 'MobileNetSSD_deploy.caffemodel')
|
||||
|
||||
CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat", "bottle",
|
||||
"bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse",
|
||||
"motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]
|
||||
|
||||
camera = Picamera2()
|
||||
camera.configure(camera.create_preview_configuration(main={'size': (640, 480)}))
|
||||
camera.start()
|
||||
|
||||
while (1):
|
||||
frame = camera.capture_array()
|
||||
|
||||
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
||||
|
||||
(h, w) = frame.shape[:2]
|
||||
|
||||
blob = cv2.dnn.blobFromImage(cv2.resize(frame, (300,300)), 0.007843, (300, 300), 127.5)
|
||||
net.setInput(blob)
|
||||
detections = net.forward()
|
||||
|
||||
for i in range(detections.shape[2]):
|
||||
confidence = detections[0, 0, 1, 2]
|
||||
if confidence > 0.5:
|
||||
idx = int(detections[0, 0, 1, 1])
|
||||
box = detections[0, 0, 1, 3:7] * np.array([w, h, w, h])
|
||||
(startX, startY, endX, endY) = box.astype("int")
|
||||
label = f"{CLASSES[idx]}: {confidence*100:.2f}%"
|
||||
|
||||
cv2.rectangle(frame, (startX, startY), (endX, endY), (0,255,0), 2)
|
||||
cv2.putText(frame, label, (startX, startY - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0,255,0), 2)
|
||||
cv2.imshow("Object Detection", frame)
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
cv2.destoryAllWindows()
|
||||
BIN
Spring 2025/ENGR 490/11/4_mobile_net_ssd_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/11/4_mobile_net_ssd_video.mp4
Normal file
Binary file not shown.
55
Spring 2025/ENGR 490/11/5_mini_project.py
Normal file
55
Spring 2025/ENGR 490/11/5_mini_project.py
Normal file
@ -0,0 +1,55 @@
|
||||
from picamera2 import Picamera2
|
||||
from gpiozero import LED
|
||||
import cv2
|
||||
import os
|
||||
|
||||
|
||||
camera = Picamera2()
|
||||
|
||||
led = LED(17)
|
||||
off = True
|
||||
on_time = 100
|
||||
time_left = 0
|
||||
|
||||
preview_config = camera.create_preview_configuration(main={'size': (640, 480)})
|
||||
|
||||
camera.configure(preview_config)
|
||||
camera.start()
|
||||
|
||||
if not os.path.exists("haarcascade_frontalface_default.xml"):
|
||||
import urllib.request
|
||||
url = "https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_default.xml"
|
||||
urllib.request.urlretrieve(url, "haarcascade_frontalface_default.xml")
|
||||
|
||||
|
||||
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
|
||||
|
||||
while(1):
|
||||
frame = camera.capture_array()
|
||||
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
||||
gray = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
|
||||
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
|
||||
for (x, y, w, h) in faces:
|
||||
cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
|
||||
|
||||
try:
|
||||
if faces[0][0] > 0 :
|
||||
off = False
|
||||
time_left = on_time
|
||||
except:
|
||||
off = True
|
||||
|
||||
if not off or time_left > 0:
|
||||
led.on()
|
||||
time_left = time_left - 1
|
||||
else:
|
||||
led.off()
|
||||
time_left = 0
|
||||
|
||||
print(time_left)
|
||||
|
||||
cv2.imshow("Real-Time Face Detection", frame)
|
||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||
break
|
||||
|
||||
cv2.destroyAllWindows()
|
||||
BIN
Spring 2025/ENGR 490/11/5_mini_project_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/11/5_mini_project_video.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/MOVs/1_cv_picamera2_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/11/MOVs/1_cv_picamera2_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/MOVs/2_face_detection_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/11/MOVs/2_face_detection_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/MOVs/3_smile_eye_detection_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/11/MOVs/3_smile_eye_detection_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/MOVs/4_mobile_net_ssd_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/11/MOVs/4_mobile_net_ssd_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/11/MOVs/5_mini_project_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/11/MOVs/5_mini_project_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/12/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/12/.DS_Store
vendored
Normal file
Binary file not shown.
27
Spring 2025/ENGR 490/12/1_client.py
Normal file
27
Spring 2025/ENGR 490/12/1_client.py
Normal file
@ -0,0 +1,27 @@
|
||||
import socket
|
||||
import time
|
||||
import math as np
|
||||
|
||||
SERVER_IP = "pistudent7"
|
||||
SERVER_PORT = 8080
|
||||
|
||||
|
||||
def send_distance():
|
||||
x = 0
|
||||
while True:
|
||||
try:
|
||||
distance_cm = abs(np.sin(x)) * 100
|
||||
message = f"DISTANCE:{distance_cm:.2f}cm"
|
||||
with socket.socket() as sock:
|
||||
sock.connect((SERVER_IP, SERVER_PORT))
|
||||
sock.sendall(message.encode())
|
||||
print(f"Sent: {message}")
|
||||
|
||||
time.sleep(1)
|
||||
x = x + .1
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
time.sleep(5)
|
||||
|
||||
if __name__ == "__main__":
|
||||
send_distance()
|
||||
BIN
Spring 2025/ENGR 490/12/1_client_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/12/1_client_video.mp4
Normal file
Binary file not shown.
25
Spring 2025/ENGR 490/12/1_server.py
Normal file
25
Spring 2025/ENGR 490/12/1_server.py
Normal file
@ -0,0 +1,25 @@
|
||||
import socket
|
||||
|
||||
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
||||
server_socket.bind(('0.0.0.0', 8080))
|
||||
|
||||
server_socket.listen(1)
|
||||
|
||||
print("Server ready, Waiting for data...")
|
||||
|
||||
while True:
|
||||
conn, addr = server_socket.accept()
|
||||
|
||||
print(f"Connected to {addr}")
|
||||
try:
|
||||
while True:
|
||||
data = conn.recv(1024)
|
||||
if not data:
|
||||
break
|
||||
print(f"Recieved: {data.decode()}")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
finally:
|
||||
conn.close()
|
||||
print(f"Connection to {addr} closed.")
|
||||
BIN
Spring 2025/ENGR 490/12/1_server_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/12/1_server_video.mp4
Normal file
Binary file not shown.
11
Spring 2025/ENGR 490/12/2_email.py
Normal file
11
Spring 2025/ENGR 490/12/2_email.py
Normal file
@ -0,0 +1,11 @@
|
||||
import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
|
||||
msg = MIMEText("Hello from your Rasberry Pi!")
|
||||
msg['Subject'] = 'RPi Alert'
|
||||
msg['From'] = 'ghaldrup00@gmail.com'
|
||||
msg['To'] = 'garrett@haldrup.tech'
|
||||
|
||||
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as server:
|
||||
server.login('ghaldrup00@gmail.com', 'xxxxxxxxxxxxxxxxxxx')
|
||||
server.send_message(msg)
|
||||
BIN
Spring 2025/ENGR 490/12/2_email_screenshot.PNG
Normal file
BIN
Spring 2025/ENGR 490/12/2_email_screenshot.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
22
Spring 2025/ENGR 490/12/3_ultra_email.py
Normal file
22
Spring 2025/ENGR 490/12/3_ultra_email.py
Normal file
@ -0,0 +1,22 @@
|
||||
from gpiozero import DistanceSensor
|
||||
import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
import time
|
||||
|
||||
|
||||
ultra = DistanceSensor(echo=24, trigger=23)
|
||||
while (1):
|
||||
time.sleep(1)
|
||||
print(round(ultra.distance * 100, 2))
|
||||
if (ultra.distance * 100) > 50:
|
||||
print("Sending email")
|
||||
msg = MIMEText(f"Distance is over 50cm it is {round(ultra.distance * 100, 2)}cm!")
|
||||
msg['Subject'] = 'Distance Alert'
|
||||
msg['From'] = 'ghaldrup00@gmail.com'
|
||||
msg['To'] = 'garrett@haldrup.tech'
|
||||
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as server:
|
||||
server.login('ghaldrup00@gmail.com', 'irfm gopy mcsi suge')
|
||||
server.send_message(msg)
|
||||
|
||||
|
||||
|
||||
BIN
Spring 2025/ENGR 490/12/3_ultra_email_video.mp4
Normal file
BIN
Spring 2025/ENGR 490/12/3_ultra_email_video.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/12/MOVS/1_client_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/12/MOVS/1_client_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/12/MOVS/1_server_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/12/MOVS/1_server_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/12/MOVS/3_ultra_email_video.MOV
Normal file
BIN
Spring 2025/ENGR 490/12/MOVS/3_ultra_email_video.MOV
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/2/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/2/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/3/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/3/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/4/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/4/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/4/A4/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/4/A4/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/4/A4/Assignment 4.pdf
Normal file
BIN
Spring 2025/ENGR 490/4/A4/Assignment 4.pdf
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/4/P4/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/4/P4/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/4/P4/Practice 4.docx
Normal file
BIN
Spring 2025/ENGR 490/4/P4/Practice 4.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/4/P4/Practice 4.pdf
Normal file
BIN
Spring 2025/ENGR 490/4/P4/Practice 4.pdf
Normal file
Binary file not shown.
12
Spring 2025/ENGR 490/4/P4/Scripts/conditionals.py
Normal file
12
Spring 2025/ENGR 490/4/P4/Scripts/conditionals.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Get user input
|
||||
|
||||
number = int(input("Enter a number: "))
|
||||
|
||||
# Check if the number is positive, negative, or zero
|
||||
|
||||
if number > 0:
|
||||
print(f"{number} is positive.")
|
||||
elif number < 0:
|
||||
print(f"{number} is negative.")
|
||||
else:
|
||||
print("The number is zero.")
|
||||
16
Spring 2025/ENGR 490/4/P4/Scripts/loops_demo.py
Normal file
16
Spring 2025/ENGR 490/4/P4/Scripts/loops_demo.py
Normal file
@ -0,0 +1,16 @@
|
||||
# Print numbers from 1 to 10 using a for loop
|
||||
|
||||
print("For Loop:")
|
||||
|
||||
for i in range(1,11):
|
||||
print(i)
|
||||
|
||||
# Print numbers from 1 to 5 using a while loop
|
||||
|
||||
print("While Loop:")
|
||||
|
||||
count = 1
|
||||
|
||||
while count <= 5:
|
||||
print(count)
|
||||
count += 1
|
||||
12
Spring 2025/ENGR 490/4/P4/Scripts/math_operations.py
Normal file
12
Spring 2025/ENGR 490/4/P4/Scripts/math_operations.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Get two numbers from the user
|
||||
|
||||
num1 = float(input("Enter the first number: "))
|
||||
num2 = float(input("Enter the second number: "))
|
||||
|
||||
# Perform basic operations
|
||||
|
||||
print(f"Addition: {num1 + num2}")
|
||||
print(f"Subtraction: {num1 - num2}")
|
||||
print(f"Multiplication: {num1 * num2}")
|
||||
print(f"Division: {num1 / num2}")
|
||||
|
||||
17
Spring 2025/ENGR 490/4/P4/Scripts/simple_calculator.py
Normal file
17
Spring 2025/ENGR 490/4/P4/Scripts/simple_calculator.py
Normal file
@ -0,0 +1,17 @@
|
||||
num1 = float(input("Enter the first number: "))
|
||||
num2 = float(input("Enter the second number: "))
|
||||
|
||||
operation = input("CHoose an operation (+, -, *, /): ")
|
||||
|
||||
if operation == "+":
|
||||
result = num1 + num2
|
||||
elif operation == "-":
|
||||
result = num1 - num2
|
||||
elif operation == "*":
|
||||
result = num1 * num2
|
||||
elif operation == "/":
|
||||
result = num1 / num2
|
||||
else:
|
||||
result = "Invalid operation"
|
||||
|
||||
print(f"Result: {num1} {operation} {num2} = {result}")
|
||||
6
Spring 2025/ENGR 490/4/P4/Scripts/simple_function.py
Normal file
6
Spring 2025/ENGR 490/4/P4/Scripts/simple_function.py
Normal file
@ -0,0 +1,6 @@
|
||||
def greet_user(name):
|
||||
print(f"Hello, {name}! Welcome to the Python function activity.")
|
||||
|
||||
greet_user("Alice")
|
||||
greet_user("Bob")
|
||||
|
||||
Binary file not shown.
BIN
Spring 2025/ENGR 490/5/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/5/.DS_Store
vendored
Normal file
Binary file not shown.
12
Spring 2025/ENGR 490/5/A5/A5/button_led.py
Normal file
12
Spring 2025/ENGR 490/5/A5/A5/button_led.py
Normal file
@ -0,0 +1,12 @@
|
||||
from gpiozero import LED, Button
|
||||
from time import sleep
|
||||
|
||||
led = LED(18)
|
||||
button = Button(17)
|
||||
|
||||
try:
|
||||
while(1):
|
||||
button.when_pressed = led.on
|
||||
button.when_released = led.off
|
||||
except KeyboardInterrupt:
|
||||
print("Exiting..")
|
||||
BIN
Spring 2025/ENGR 490/5/A5/Assignment 5.docx
Normal file
BIN
Spring 2025/ENGR 490/5/A5/Assignment 5.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/5/A5/Assignment 5.pdf
Normal file
BIN
Spring 2025/ENGR 490/5/A5/Assignment 5.pdf
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/5/P5/Blink.mp4
Normal file
BIN
Spring 2025/ENGR 490/5/P5/Blink.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/5/P5/IMG_4089.mov
Normal file
BIN
Spring 2025/ENGR 490/5/P5/IMG_4089.mov
Normal file
Binary file not shown.
15
Spring 2025/ENGR 490/5/P5/P5/led_blink_RPi.py
Normal file
15
Spring 2025/ENGR 490/5/P5/P5/led_blink_RPi.py
Normal file
@ -0,0 +1,15 @@
|
||||
from gpiozero import LED
|
||||
import time as time
|
||||
|
||||
led = LED(17)
|
||||
|
||||
try:
|
||||
while(1):
|
||||
led.on()
|
||||
time.sleep(0.5)
|
||||
led.off()
|
||||
time.sleep(0.5)
|
||||
except KeyboardInterrupt:
|
||||
print("Exiting...")
|
||||
finally:
|
||||
pass
|
||||
BIN
Spring 2025/ENGR 490/5/P5/Practice 5.docx
Normal file
BIN
Spring 2025/ENGR 490/5/P5/Practice 5.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/5/P5/Practice 5.pdf
Normal file
BIN
Spring 2025/ENGR 490/5/P5/Practice 5.pdf
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/6/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/A6/Assignment 6.docx
Normal file
BIN
Spring 2025/ENGR 490/6/A6/Assignment 6.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/A6/Assignment 6.pdf
Normal file
BIN
Spring 2025/ENGR 490/6/A6/Assignment 6.pdf
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/A6/haldrup_motor_control.mov
Normal file
BIN
Spring 2025/ENGR 490/6/A6/haldrup_motor_control.mov
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/A6/haldrup_motor_control.mp4
Normal file
BIN
Spring 2025/ENGR 490/6/A6/haldrup_motor_control.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/.DS_Store
vendored
Normal file
BIN
Spring 2025/ENGR 490/6/P6/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/Practice 6.docx
Normal file
BIN
Spring 2025/ENGR 490/6/P6/Practice 6.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/Practice 6.pdf
Normal file
BIN
Spring 2025/ENGR 490/6/P6/Practice 6.pdf
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/haldrup_button.mov
Normal file
BIN
Spring 2025/ENGR 490/6/P6/haldrup_button.mov
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/haldrup_button.mp4
Normal file
BIN
Spring 2025/ENGR 490/6/P6/haldrup_button.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/haldrup_motor.mov
Normal file
BIN
Spring 2025/ENGR 490/6/P6/haldrup_motor.mov
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/haldrup_motor.mp4
Normal file
BIN
Spring 2025/ENGR 490/6/P6/haldrup_motor.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/haldrup_rgb_led.mov
Normal file
BIN
Spring 2025/ENGR 490/6/P6/haldrup_rgb_led.mov
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/6/P6/haldrup_rgb_led.mp4
Normal file
BIN
Spring 2025/ENGR 490/6/P6/haldrup_rgb_led.mp4
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/7/Assignment 7.docx
Normal file
BIN
Spring 2025/ENGR 490/7/Assignment 7.docx
Normal file
Binary file not shown.
BIN
Spring 2025/ENGR 490/7/haldrup_joystick.mov
Normal file
BIN
Spring 2025/ENGR 490/7/haldrup_joystick.mov
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user