Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
243934d
soup-pad
souptik-samanta Oct 14, 2024
0439057
Add files via upload
souptik-samanta Oct 16, 2024
976ea98
Add files via upload
souptik-samanta Oct 17, 2024
7fe7c45
Merge branch 'hackclub:main' into main
souptik-samanta Oct 17, 2024
ce341cf
Add files via upload
souptik-samanta Oct 17, 2024
cdab2c5
Add files via upload
souptik-samanta Oct 20, 2024
5b56ff4
Merge branch 'hackclub:main' into main
souptik-samanta Oct 20, 2024
019554b
Add files via upload
souptik-samanta Oct 20, 2024
af9ad7b
del
souptik-samanta Oct 20, 2024
382438c
Add files via upload
souptik-samanta Oct 20, 2024
09ba2e0
Delete pcb directory
souptik-samanta Oct 20, 2024
077e942
Add files via upload
souptik-samanta Oct 20, 2024
7b4c2c8
Add files via upload
souptik-samanta Oct 20, 2024
88a0a8a
Add files via upload
souptik-samanta Oct 20, 2024
4b93461
Add files via upload
souptik-samanta Oct 20, 2024
c44ecf4
Add files via upload
souptik-samanta Oct 20, 2024
1f98f77
caddone
souptik-samanta Oct 20, 2024
2d8ba9b
prod. done
souptik-samanta Oct 20, 2024
f3e47c4
Add files via upload
souptik-samanta Oct 20, 2024
b29938f
BOM
souptik-samanta Oct 20, 2024
d97442d
DONE
souptik-samanta Oct 20, 2024
5129c55
Delete hackpads/Soup-Pad/production/case directory
souptik-samanta Oct 21, 2024
d8ffb8b
one last left
souptik-samanta Oct 21, 2024
d8ec510
done ig
souptik-samanta Oct 21, 2024
316894b
Merge branch 'hackclub:main' into main
souptik-samanta Oct 21, 2024
3d07d92
Delete hackpads/Soup-Pad/cad directory
souptik-samanta Oct 21, 2024
5732520
del
souptik-samanta Oct 21, 2024
1a0c872
CASE
souptik-samanta Oct 21, 2024
b043f84
Add files via upload
souptik-samanta Oct 21, 2024
fbc424e
DOne ig
souptik-samanta Oct 21, 2024
0aad15d
cad
souptik-samanta Oct 21, 2024
9e71a5d
case
souptik-samanta Oct 21, 2024
1b877da
Merge branch 'hackclub:main' into main
souptik-samanta Oct 21, 2024
4b7017a
finalll
souptik-samanta Oct 21, 2024
a38d5ad
Delete hackpads/Soup-Pad/firmware/kmk_firmware directory
souptik-samanta Oct 21, 2024
ae7cfcc
finall i am sure
souptik-samanta Oct 21, 2024
2f1bb9d
confirm final
souptik-samanta Oct 21, 2024
58fbff1
done
souptik-samanta Oct 21, 2024
f027ee3
done
souptik-samanta Oct 21, 2024
8838d00
done final
souptik-samanta Oct 21, 2024
1102432
Delete hackpads/Soup-Pad/cad directory
souptik-samanta Oct 21, 2024
3bc062a
cad
souptik-samanta Oct 21, 2024
1c0dbce
Create readme.md
souptik-samanta Oct 21, 2024
e031886
Update readme.md
souptik-samanta Oct 21, 2024
48326f0
Merge branch 'hackclub:main' into main
souptik-samanta Oct 22, 2024
9d3fc9c
Merge branch 'hackclub:main' into main
souptik-samanta Oct 22, 2024
1b6b544
Merge branch 'hackclub:main' into main
souptik-samanta Oct 22, 2024
d2ab84a
Delete hackpads/Soup-Pad/cad/assm.stl
souptik-samanta Oct 22, 2024
febecd0
Delete hackpads/Soup-Pad/cad/readme.md
souptik-samanta Oct 22, 2024
c1bc7d3
DOne FRfr
souptik-samanta Oct 22, 2024
af928dd
done fr
souptik-samanta Oct 22, 2024
fafd531
Delete hackpads/Soup-Pad/cad/keypad v12.step
souptik-samanta Oct 22, 2024
7c9b899
CAd
souptik-samanta Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,630 changes: 12,630 additions & 0 deletions hackpads/Soup-Pad/cad/3d print stl/case_bot.stl

Large diffs are not rendered by default.

Binary file added hackpads/Soup-Pad/cad/3d print stl/case_top 1.stl
Binary file not shown.
Binary file added hackpads/Soup-Pad/cad/3d print stl/name.stl
Binary file not shown.
Binary file added hackpads/Soup-Pad/cad/3d print stl/oled_mount.stl
Binary file not shown.
Binary file added hackpads/Soup-Pad/cad/assembly stl.zip
Binary file not shown.
Empty file.
117 changes: 117 additions & 0 deletions hackpads/Soup-Pad/firmware/code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.modules.neopixel import Neopixel
from lib.adafruit_hid.keyboard import Keyboard
from lib.adafruit_hid.keycode import Keycode
import board
import busio
import digitalio
import time
from adafruit_ssd1306 import SSD1306_I2C
from adafruit_dht import DHT11
from mcp23008 import MCP23008


keyboard = KMKKeyboard()


i2c = busio.I2C(scl=board.SCL, sda=board.SDA)
mcp = MCP23008(i2c)


rows = [mcp.get_pin(i) for i in range(4)] # GP0, GP1, GP2, GP3
cols = [mcp.get_pin(i) for i in range(4, 7)] # GP4, GP5, GP6


for row in rows:
row.switch_to_input(pull=mcp.Pull.UP)
for col in cols:
col.switch_to_input(pull=mcp.Pull.UP)


keyboard.row_pins = rows
keyboard.col_pins = cols
keyboard.diode_orientation = DiodeOrientation.COLUMNS


keyboard.keymap = [
[KC.N1, KC.N2, KC.N3], # First row also i will adjust them as needed later as it would e very much time consuming to adjust them now
[KC.N4, KC.N5, KC.N6], # Second row
[KC.N7, KC.N8, KC.N9], # Third row
[KC.KP_PLUS, KC.N0, KC.KP_MINUS], # Fourth row
]

pixel = Neopixel(pin=board.D0, num_pixels=12, colors=[(255, 0, 0)], brightness=0.2)
keyboard.modules.append(pixel)


encoder1_a = digitalio.DigitalInOut(board.D6)
encoder1_b = digitalio.DigitalInOut(board.D10)
encoder2_a = digitalio.DigitalInOut(board.D3)
encoder2_b = digitalio.DigitalInOut(board.D9)


encoder1_a.switch_to_input(pull=digitalio.Pull.UP)
encoder1_b.switch_to_input(pull=digitalio.Pull.UP)
encoder2_a.switch_to_input(pull=digitalio.Pull.UP)
encoder2_b.switch_to_input(pull=digitalio.Pull.UP)


oled = SSD1306_I2C(128, 64, i2c)


dht_sensor = DHT11(digitalio.DigitalInOut(board.D2)) # DHT11 sensor on D2 pin


encoder1_pos = 0
encoder2_pos = 0


def read_distance():

return 50 #its for now i will add the sensor code later


while True:
keyboard.process()


try:
temperature = dht_sensor.temperature
humidity = dht_sensor.humidity
except Exception as e:
temperature = None
humidity = None
print("Failed to read DHT11:", e)


if not encoder1_a.value:
if not encoder1_b.value:
encoder1_pos += 1
keyboard.send(KC.VOLD)
else:
encoder1_pos -= 1
keyboard.send(KC.VOLU)


if not encoder2_a.value:
if not encoder2_b.value:
encoder2_pos += 1
keyboard.send(KC.MPRV)
else:
encoder2_pos -= 1
keyboard.send(KC.MNXT)


distance = read_distance()
volume_level = max(0, min(100, 100 - distance)) # conveting distance to volume level

#oled
oled.fill(0)
oled.text("Temp: {}C".format(temperature), 0, 0)
oled.text("Hum: {}%".format(humidity), 0, 10)
oled.text("Distance: {}cm".format(distance), 0, 20)
oled.text("Volume: {}".format(volume_level), 0, 30)
oled.show()

time.sleep(0.01) #for rest lol
Empty file.
107 changes: 107 additions & 0 deletions hackpads/Soup-Pad/firmware/kmk/bootcfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
try:
from typing import Optional
except ImportError:
pass

import digitalio
import microcontroller
import usb_hid


def bootcfg(
sense: [microcontroller.Pin, digitalio.DigitalInOut],
source: Optional[microcontroller.Pin, digitalio.DigitalInOut] = None,
autoreload: bool = True,
boot_device: int = 0,
cdc_console: bool = True,
cdc_data: bool = False,
consumer_control: bool = True,
keyboard: bool = True,
midi: bool = True,
mouse: bool = True,
nkro: bool = False,
pan: bool = False,
storage: bool = True,
usb_id: Optional[tuple[str, str]] = None,
**kwargs,
) -> bool:

if len(kwargs):
print('unknown option', kwargs)

if isinstance(sense, microcontroller.Pin):
sense = digitalio.DigitalInOut(sense)
sense.direction = digitalio.Direction.INPUT
sense.pull = digitalio.Pull.UP

if isinstance(source, microcontroller.Pin):
source = digitalio.DigitalInOut(source)
source.direction = digitalio.Direction.OUTPUT
source.value = False

if not autoreload:
import supervisor

supervisor.runtime.autoreload = False

# configure HID devices
devices = []
if keyboard:
if nkro:
from kmk.hid_reports import nkro_keyboard

devices.append(nkro_keyboard.NKRO_KEYBOARD)
else:
devices.append(usb_hid.Device.KEYBOARD)
if mouse:
if pan:
from kmk.hid_reports import pointer

devices.append(pointer.POINTER)
else:
devices.append(usb_hid.Device.MOUSE)
if consumer_control:
devices.append(usb_hid.Device.CONSUMER_CONTROL)
if devices:
usb_hid.enable(devices, boot_device)
else:
usb_hid.disable()

# configure midi over usb
if not midi:
import usb_midi

usb_midi.disable()

# configure usb vendor and product id
if usb_id is not None:
import supervisor

if hasattr(supervisor, 'set_usb_identification'):
supervisor.set_usb_identification(*usb_id)

# configure data serial
if cdc_data:
import usb_cdc

usb_cdc.enable(data=True)

# sense pulled low -> Skip boot configuration that may disable debug or
# rescue facilities.
if not sense.value:
return False

# Entries for serial console (REPL) and storage are intentionally evaluated
# last to ensure the board is debuggable, mountable and rescueable, in case
# any of the previous code throws an exception.
if not cdc_console:
import usb_cdc

usb_cdc.enable(console=False)

if not storage:
import storage

storage.disable_usb_drive()

return True
54 changes: 54 additions & 0 deletions hackpads/Soup-Pad/firmware/kmk/extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
class InvalidExtensionEnvironment(Exception):
pass


class Extension:
_enabled = True

def enable(self, keyboard):
self._enabled = True

self.on_runtime_enable(keyboard)

def disable(self, keyboard):
self._enabled = False

self.on_runtime_disable(keyboard)

# The below methods should be implemented by subclasses

def on_runtime_enable(self, keyboard):
raise NotImplementedError

def on_runtime_disable(self, keyboard):
raise NotImplementedError

def during_bootup(self, keyboard):
raise NotImplementedError

def before_matrix_scan(self, keyboard):
'''
Return value will be injected as an extra matrix update
'''
raise NotImplementedError

def after_matrix_scan(self, keyboard):
'''
Return value will be replace matrix update if supplied
'''
raise NotImplementedError

def before_hid_send(self, keyboard):
raise NotImplementedError

def after_hid_send(self, keyboard):
raise NotImplementedError

def on_powersave_enable(self, keyboard):
raise NotImplementedError

def on_powersave_disable(self, keyboard):
raise NotImplementedError

def deinit(self, keyboard):
pass
Loading