How to read_timed (loboris library)
Posted: Wed Jul 08, 2020 6:28 pm
I would like to read a joystick using the read_timed method. (https://github.com/loboris/MicroPython_ ... o/wiki/adc)
If I do the following ...
... I get this error:
Unfortunately I have no idea how to change the "type" of a list. It should be "H" / "h" or "B".
(I tried "bytearray" but it didn't work.)
I would like to do this to save a timer on the ESP32 (I think I can do it like this or not?).
If there is a better method, please.
Thanks in advance!
If I do the following ...
Code: Select all
>>> a = []
>>> x = machine.ADC (machine.Pin (36))
>>> x.read_timed (data = a, freq = 5000)
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: array or file name argument expected
(I tried "bytearray" but it didn't work.)
I would like to do this to save a timer on the ESP32 (I think I can do it like this or not?).
If there is a better method, please.
Thanks in advance!