Tuesday, May 19, 2015

Week Eight

It's week eight! Let's get down to business .... (To defeat the Huns).

In all seriousness, we really need to kick it into high gear for these last few weeks. #WhereDidTheTimeGo

Tuesday started off with a plan to solder and code, however we realized that prior to soldering the keys, and consequently having them permanently in the board, we needed to laser cut holes into the top frame acrylic for screws as well as additional space in the holes of keys which use capacitive sensing. Mercedes CAD-ed the holes and Amy went to the lab to have them cut. It seems soldering just has a way of never happening.

Meanwhile, Gabrielle coded an entire keyboard matrix. A psuedo code of the matrix can be found below.

Full Keyboard
Runs an entire keyboard through the Arduino Due
Rows: A0-A4, have diodes, negative, cycles thhrough one at a time
Collumns: 0-13, no diodes, positive

Choose pins used for rows and collumns of key matrix
Define keys
Set capsLock variable as "off" initially

Make collumns inputs and turn on the pullup resistor so they go high unless switch is pressed, connecting them to rows which are low outputs (ground):

STEP 1: CHECK FOR MODIFIER KEYS
  Turn each row to low one at a time to LOW to cycle through the rows of the matrix
  Check for whether each key in the row is pressed, a key is pressed if it reads as LOW and not pressed if it reads as HIGH
   If a non-modifier key is pressed, print out the character assigned to it
       If left or right shift is pressed, hold the key
       If left or right ctrl is pressed, hold the key
       If left or right alt is pressed, hold the key
       If CapsLock is pressed, add one to the capsLock variable

STEP 2: PRESS NON-MODIFIERS
 If a non-modifier is pressed, press the key and then release (modifier and) key
 If capsLock variable is even, CapsLock is "on", and it is pressed

Mercedes then worked on the LED matrix code so that it supports all the keys instead of just the six test LEDs. She also combined the new LED code with the key matrix code seen above. Both codes compile with out error, so we can only hope they keyboard will run when we finish construction.

This week we plan to completely solder the board so that we can soon test out the full codes.  However, we only got through the first four key matrix rows. (We may have over-estimated both our ability to solder and the quality of soldering irons to be used.) We have a long week ahead of us next week, but our current success can be seen below!


No comments:

Post a Comment