aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeurig <don@suspectdevices.com>2021-06-19 16:52:45 -0700
committerfeurig <don@suspectdevices.com>2021-06-19 16:52:45 -0700
commitcce3b296372ef676b4c4a5a7f4374f16e6271368 (patch)
tree7da03cb7b8ef7a6fce686aba7ac52afe6d76b275
parentd3e47294d86420a99270ed9a8d06a0bce42ff8a3 (diff)
Rough in keyboard Scanner.
-rw-r--r--PiTerm.py35
-rw-r--r--README.md12
-rwxr-xr-ximages/IMG_3819.jpgbin0 -> 337172 bytes
-rw-r--r--images/adpkbdaw9523_bb.jpgbin0 -> 203781 bytes
-rw-r--r--images/adpkbdaw9523_schem.jpgbin0 -> 200001 bytes
5 files changed, 44 insertions, 3 deletions
diff --git a/PiTerm.py b/PiTerm.py
index 13653f0..5b908ed 100644
--- a/PiTerm.py
+++ b/PiTerm.py
@@ -1,13 +1,42 @@
+import board
+import busio
+import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
+import adafruit_aw9523
+
keymap=[]
keymap.append('*# ZXCVBNM/\001')
keymap.append('-LASDFGHJK\r\n')
keymap.append('0912345678\010\002')
keymap.append('POQWERTYUI\030\004')
-import busio
-import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
lcd_columns = 24
lcd_rows = 2
i2c = busio.I2C(board.SCL, board.SDA)
lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
-lcd.message = "Hello\nCircuitPython"
+lcd.message = "PiTerm 1986 v0.0\nOk >"
+
+aw = adafruit_aw9523.AW9523(i2c)
+row_pins = [aw.get_pin(8),aw.get_pin(9),aw.get_pin(10),aw.get_pin(11)]
+for pin in row_pins:
+ pin.switch_to_output(value=True)
+
+col_pins = [aw.get_pin(0),aw.get_pin(15),aw.get_pin(14),aw.get_pin(13),
+ aw.get_pin(12),aw.get_pin(7),aw.get_pin(6),aw.get_pin(5),
+ aw.get_pin(4),aw.get_pin(3),aw.get_pin(2),aw.get_pin(1)]
+
+for pin in col_pins:
+ pin.switch_to_input(value=True)
+
+
+old_row=0;
+for pin in row_pins:
+ pin.value=1
+
+while True:
+ for r in range(4):
+ row_pins[old_row].value=1
+ row_pins[r].value=0
+ old_row=r
+ for c in range(12):
+ if (col_pins[c].value==0):
+ print(keymap[r][c])
diff --git a/README.md b/README.md
index 4aaa8fc..9e3529c 100644
--- a/README.md
+++ b/README.md
@@ -94,6 +94,18 @@ Type "help", "copyright", "credits" or "license" for more information.
![](images/IMG_3809.jpg)
+It't a bit jenky...
+I would like to be able to easily remap the pins without rewriting the library but I am not there.
+
+But it works.
+
+![](images/IMG_3819.jpg)
+
+Now on to the keyboard.
+If it werent for the fact that there was a readymade lcd library for the mcp23017 I would have swapped the io expanders. The aw9523 has no internal pullup or pulldown resistors. Fortunately I have piles of 10k resistors and apparently I have time.
+
+![](images/adpkbdaw9523_schem.jpg)
+
diff --git a/images/IMG_3819.jpg b/images/IMG_3819.jpg
new file mode 100755
index 0000000..f9a97ec
--- /dev/null
+++ b/images/IMG_3819.jpg
Binary files differ
diff --git a/images/adpkbdaw9523_bb.jpg b/images/adpkbdaw9523_bb.jpg
new file mode 100644
index 0000000..62940f7
--- /dev/null
+++ b/images/adpkbdaw9523_bb.jpg
Binary files differ
diff --git a/images/adpkbdaw9523_schem.jpg b/images/adpkbdaw9523_schem.jpg
new file mode 100644
index 0000000..dfc6c13
--- /dev/null
+++ b/images/adpkbdaw9523_schem.jpg
Binary files differ