Initial commit
This commit is contained in:
BIN
Roboto/Roboto-Medium.ttf
Normal file
BIN
Roboto/Roboto-Medium.ttf
Normal file
Binary file not shown.
228572
box_bottom_0.15mm_PETG_MK3S_4h20m.gcode
Normal file
228572
box_bottom_0.15mm_PETG_MK3S_4h20m.gcode
Normal file
File diff suppressed because it is too large
Load Diff
72
control.py
Normal file
72
control.py
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
from neopixel import NeoPixel
|
||||||
|
from random import randrange
|
||||||
|
import time
|
||||||
|
import board
|
||||||
|
from gpiozero import LED
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Control script for 3D printer fan & LED control
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Raspi Zero W Pin assignment, in order from top to bottom on PCB
|
||||||
|
#
|
||||||
|
# On PCB | Cable color | Raspberry PIN
|
||||||
|
# --------------------------------------------
|
||||||
|
# 5V | not connected | ------
|
||||||
|
# LED | grey | GPIO 19 [PWM]
|
||||||
|
# GND | black | ------
|
||||||
|
# DHT22 | white | GPIO 26
|
||||||
|
# FAN1 | purple | GPIO 13
|
||||||
|
# FAN2 | blue | GPIO 6
|
||||||
|
#
|
||||||
|
|
||||||
|
SETTINGS = {
|
||||||
|
'fan1': board.D13,
|
||||||
|
'fan2': board.D6,
|
||||||
|
'dht': board.D26,
|
||||||
|
'led': board.D19,
|
||||||
|
}
|
||||||
|
|
||||||
|
fan1 = LED(SETTINGS['fan1'])
|
||||||
|
fan2 = LED(SETTINGS['fan2'])
|
||||||
|
|
||||||
|
|
||||||
|
def test_leds(sleep_time=0.1, num_leds_on_at_same_time=10, max_brightness=30):
|
||||||
|
num_leds = 120
|
||||||
|
strip = NeoPixel(SETTINGS['led'], n=num_leds, auto_write=False)
|
||||||
|
|
||||||
|
# switch all leds off
|
||||||
|
for i in range(num_leds):
|
||||||
|
strip[i] = (0, 0, 0)
|
||||||
|
strip.show()
|
||||||
|
|
||||||
|
for i in range(num_leds):
|
||||||
|
strip[i] = tuple(randrange(0, max_brightness) for j in range(3))
|
||||||
|
if i - num_leds_on_at_same_time >= 0:
|
||||||
|
strip[i-num_leds_on_at_same_time] = (0, 0, 0)
|
||||||
|
strip.show()
|
||||||
|
time.sleep(sleep_time)
|
||||||
|
|
||||||
|
# switch all leds off again
|
||||||
|
time.sleep(2)
|
||||||
|
for i in range(num_leds):
|
||||||
|
strip[i] = (0, 0, 0)
|
||||||
|
strip.show()
|
||||||
|
|
||||||
|
def board_test(fan_on_secs=4):
|
||||||
|
print("Testing fan1")
|
||||||
|
fan1.on()
|
||||||
|
time.sleep(fan_on_secs)
|
||||||
|
fan1.off()
|
||||||
|
|
||||||
|
|
||||||
|
print("Testing fan2")
|
||||||
|
time.sleep(fan_on_secs)
|
||||||
|
fan2.off()
|
||||||
|
|
||||||
|
print("Testing leds")
|
||||||
|
test_leds()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
board_test()
|
||||||
BIN
custom_pcb_img1.jpg
Normal file
BIN
custom_pcb_img1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
BIN
custom_pcb_img2.jpg
Normal file
BIN
custom_pcb_img2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
BIN
custom_pcb_schematic.jpg
Normal file
BIN
custom_pcb_schematic.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
electronics_box.FCStd
Normal file
BIN
electronics_box.FCStd
Normal file
Binary file not shown.
BIN
electronics_box_backup.FCStd
Normal file
BIN
electronics_box_backup.FCStd
Normal file
Binary file not shown.
BIN
electronics_box_backup_before_lid.FCStd
Normal file
BIN
electronics_box_backup_before_lid.FCStd
Normal file
Binary file not shown.
Reference in New Issue
Block a user