Setting the frequency command of HiTechnic Color Sensor V2 #346
Answered
by
dlech
dianabarrett
asked this question in
Q&A
-
Hi! Is there a way of setting 50Hz or 60Hz frequency values of the HT Color Sensor V2? class HiTechColorSensor(Ev3devSensor):
def __init__(self, port):
# Initialize the parent class.
super().__init__(port)
# Get the sysfs path.
self.path = '/sys/class/lego-sensor/sensor' + str(self.sensor_index)
# configure the sensor for 60Hz
def set_60hz(self):
with open(self.path + 'command', 'w') as file:
file.write('60Hz') I'm getting an error when calling
|
Beta Was this translation helpful? Give feedback.
Answered by
dlech
May 22, 2021
Replies: 1 comment 3 replies
-
This needs a trailing slash: self.path = '/sys/class/lego-sensor/sensor' + str(self.sensor_index) + '/' |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
dianabarrett
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This needs a trailing slash: