Commit Graph

7 Commits

Author SHA1 Message Date
2369db3657 Lots of debugging stuff: works, but sample rate is low enough that it's not super useful 2019-12-28 15:38:13 -08:00
858618f41c Explicitly set the ADC sample time
I think I need an op-amp for the piezo element. It seems like just
running 6" wires to it causes too much noise in the wires to be able to
detect the piezo element. Need an amplifier right next to the piezo
before sending it over any wire.

With 0b000 sample time, reading values of 0xd0 +/- 20
With 0b111 sample time, sometimes I read all the way between 0x000 and
0xfff. But it's not random noise -- it's oscillating like a sine wave at
maybe 1 hz. The noise is there when I connect long wires to the ADC
pins, but regardless of what's on the other end of the wire (piezo or no
piezo).

Could also be worth trying differential mode.
2019-12-28 00:07:16 -08:00
1b2a368ae0 Read values from the ADC and pipe them to the terminal
These values look realistic!
2019-09-28 20:46:13 -07:00
b9ff4e8bb4 Clock the ADC so that its startup sequence doesn't hang :-)
Have yet to attempt to read it though
2019-09-28 14:19:23 -07:00
f3075706d7 Flesh out ADC bringup (hangs!)
Currently hangs waiting for cal to complete, and then again waiting for
adrdy if we skip the cal.

Should check if _any_ of the writes go through.
2019-09-28 14:02:37 -07:00
5637649487 WIP analog input 2019-09-28 12:42:19 -07:00
74de03ea3c Reading from external input and setting the LEDs
Next: analog input
2019-09-15 18:17:33 -07:00