I try to get a touch sensor to work on the brickpi, but I'm a little lost. What Class should I use? Where is the sensor in /sys/class ?
>>> from ev3dev.auto import TouchSensor, INPUT_4
>>> ts = TouchSensor(INPUT_4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/ev3dev/core.py", line 1664, in __init__
Device.__init__(self, self.SYSTEM_CLASS_NAME, name_pattern, name_exact, driver_name=['lego-ev3-touch', 'lego-nxt-touch'], **kwargs)
File "/usr/lib/python2.7/dist-packages/ev3dev/core.py", line 180, in __init__
name = next(list_device_names(classpath, name_pattern, **kwargs))
File "/usr/lib/python2.7/dist-packages/ev3dev/core.py", line 123, in list_device_names
for f in os.listdir(class_path):
OSError: [Errno 2] No such file or directory: '/sys/class/lego-sensor'
anton@ev3dev-rpi:~$ ls /sys/class/
backlight graphics iscsi_session raw thermal
bcm2708_vcio hidraw iscsi_transport rfkill tty
bcm2835-gpiomem i2c-adapter leds rtc uio
bdi i2c-dev lego-port scsi_device vc
block ieee80211 mem scsi_disk vc-cma
bsg input misc scsi_host vc-mem
dc-motor iscsi_connection mmc_host sound vc-sm
devcoredump iscsi_endpoint net spi_master vchiq
dma iscsi_host power_supply spidev vtconsole
gpio iscsi_iface pwm tacho-motor watchdog
I try to get a touch sensor to work on the brickpi, but I'm a little lost. What Class should I use? Where is the sensor in /sys/class ?