Skip to content

Made pixels private, created property with docs #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 11, 2017
Merged
Changes from all commits
Commits
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
28 changes: 16 additions & 12 deletions adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,21 @@ def __init__(self):
# Define LEDs:
self._led = digitalio.DigitalInOut(board.D13)
self._led.switch_to_output()
self.pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)
self._pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)

# Define sensors:
self._temp = adafruit_thermistor.Thermistor(board.TEMPERATURE, 10000, 10000, 25, 3950)
self._light = Photocell(board.LIGHT)

# Define audio:
self._speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
self._speaker_enable.switch_to_output(value=False)

self.sample = None
self.sine_wave = None

@property
def pixels(self):
"""Sequence like object representing the ten NeoPixels around the outside
of the CircuitPlayground. Each pixel is at a certain index in the sequence
as labeled below. Colors can be RGB hex like 0x110000 for red where each
Expand All @@ -61,17 +75,7 @@ def __init__(self):
while True:
pass
"""

# Define sensors:
self._temp = adafruit_thermistor.Thermistor(board.TEMPERATURE, 10000, 10000, 25, 3950)
self._light = Photocell(board.LIGHT)

# Define audio:
self._speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
self._speaker_enable.switch_to_output(value=False)

self.sample = None
self.sine_wave = None
return self._pixels

@property
def button_a(self):
Expand Down