Help Read GPIO pin in Python
Hello everyone. I have been attempting to read the analog signal from the GPIO pin of the MetamotionR board. I am using the pymetawear library on a raspberry pi.
This is the sesnor I am attempting to read: https://www.sparkfun.com/products/12650?_ga=2.112552772.1984315370.1584943763-165751714.1579836749
Reading the sesnor from the GPIO pin with the MetaWear android app does work. However when I try to test it in python I am stuck.
I have been modifying the gpio.py script in the pymetawear modules folder. Here is my code:
Note, this file is a copy of the the gpio.py file from the modules folder within a clone of the pymetawear library, in which I am editing. I have been playing around with the code around line 100 but nothing seems to work.
There error message is as follows:
Traceback (most recent call last): File "gpio.py", line 217, in <module> gp.notifications(handle_gpio_notification) File "gpio.py", line 197, in notifications super(GpioModule, self).notifications(data_handler(callback)) File "/usr/local/lib/python3.7/dist-packages/pymetawear/modules/base.py", line 135, in notifications data_signal = self.data_signal File "gpio.py", line 100, in data_signal return libmetawear.mbl_mw_gpio_get_pin_monitor_data_signal(self.board, '0') ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type
Any help is welcome.