Skip to content

removing reset function #14

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 1 commit into from
Apr 23, 2021
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
6 changes: 1 addition & 5 deletions adafruit_as7341.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,25 +247,21 @@ def __init__(self, i2c_bus, address=_AS7341_I2CADDR_DEFAULT):
self.i2c_device = i2c_device.I2CDevice(i2c_bus, address)
if not self._device_id in [_AS7341_DEVICE_ID]:
raise RuntimeError("Failed to find an AS7341 sensor - check your wiring!")
self.reset()
self.initialize()
self._buffer = bytearray(2)
self._low_channels_configured = False
self._high_channels_configured = False
self._flicker_detection_1k_configured = False

def initialize(self):
"""Configure the sensors with the default settings. For use after calling `reset()`"""
"""Configure the sensors with the default settings"""

self._power_enabled = True
self._led_control_enabled = True
self.atime = 100
self.astep = 999
self.gain = Gain.GAIN_128X # pylint:disable=no-member

def reset(self):
"""Resets the internal registers and restores the default settings"""

@property
def all_channels(self):
"""The current readings for all six ADC channels"""
Expand Down