Skip to content

Commit

Permalink
Fixing TODO about wiring naming
Browse files Browse the repository at this point in the history
I thought I had the naming wrong for the MCP3008's pins, but it turns out
that the MCP3008 spec and the Adafruit library just use different names for
the same pins. This replaces the TODO with an explanation of the
translation.
  • Loading branch information
mtlynch committed Jan 29, 2017
1 parent 270b1a8 commit c991f6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions greenpithumb/greenpithumb.py
Expand Up @@ -18,8 +18,12 @@ class SensorHarness(object):

def __init__(self, wiring_config):
local_clock = clock.LocalClock()
# TODO(mtlynch): Fix the wiring config pin names so they match the
# params to MCP3008's constructor.
# The MCP3008 spec and Adafruit library use different naming for the
# Raspberry Pi GPIO pins, so we translate as follows:
# * CLK -> CLK
# * CS/SHDN -> CS
# * DOUT -> MISO
# * DIN -> MOSI
self._adc = Adafruit_MCP3008.MCP3008(
clk=wiring_config.gpio_pins.mcp3008_clk,
cs=wiring_config.gpio_pins.mcp3008_cs_shdn,
Expand Down

0 comments on commit c991f6a

Please sign in to comment.