I would like to use my Pinephone in a project where I need to take gyroscope and accelerometer readings. I can't find any information on how to access these sensors though. I tried lm-sensors but it only displays battery status and thermal sensors. There doesn't seem to be any info on the wiki either about accessing these. How can I log readings from these sensors?
How can I take readings from the gyroscope and accelerometer?
|
Hi,
https://wiki.postmarketos.org/wiki/PINE6...e)#Sensors Have a search around in the directories specified and you'll find the various things you can get a reading from. I'm trying to write a compass, but it's not working very well so far Thanks,
04-01-2021, 10:53 PM
(03-15-2021, 06:12 PM)kk22 Wrote: I would like to use my Pinephone in a project where I need to take gyroscope and accelerometer readings. I can't find any information on how to access these sensors though. I tried lm-sensors but it only displays battery status and thermal sensors. There doesn't seem to be any info on the wiki either about accessing these. How can I log readings from these sensors? https://github.com/Alumniminium/PinePhon...rometer.cs This might help. If you take a look at the Path variable, you'll see the 'Gyroscope` is at "/sys/bus/i2c/devices/2-0068/iio:device2" which contains files like "in_anglvel_x_raw" you can 'cat' files to read and 'echo | sudo tee' to write
04-05-2021, 09:23 AM
You could also have a look at https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/ which abstracts a subset of the sensors out to dbus. Gyros don't seem to be part of that subset, but it should give another example of accel access.
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS | lupyuen | 22 | 11,487 |
05-28-2023, 06:09 AM Last Post: lupyuen |
Users browsing this thread: 3 Guest(s)