My Mobile Phone’s Senses

I’ve been experimenting with Termux on my Moto G7 Play. While my route in was looking for a terminal emulator for the phone, I’ve since discovered that Termux us much, much more than that.

For example, I can run Node-RED on my phone via Termux, which gives me a rich visual programming tool for wiring up inputs to outputs.

What kinds of inputs, you ask?

Well, via Termux: API, I gain access to all of the sensors on my phone. And it turns out there are a lot of them:

# termux-sensor -l
  "sensors": [
    "LSM6DSM Accelerometer",
    "MMC5603NJ Magnetometer",
    "MMC5603NJ Magnetometer Uncalibrated",
    "LSM6DSM Gyroscope",
    "LSM6DSM Gyroscope Uncalibrated",
    "EPL259x ALS\/PS PROX",
    "EPL259x ALS\/PS ALS",
    "LSM6DSM Accelerometer -Wakeup Secondary",
    "MMC5603NJ Magnetometer -Wakeup Secondary",
    "MMC5603NJ Magnetometer Uncalibrated -Wakeup Secondary",
    "LSM6DSM Gyroscope -Wakeup Secondary",
    "LSM6DSM Gyroscope Uncalibrated -Wakeup Secondary",
    "EPL259x ALS\/PS PROX -Non Wakeup Secondary",
    "EPL259x ALS\/PS ALS -Wakeup Secondary",
    "Linear Acceleration",
    "Rotation Vector",
    "Step Detector",
    "Step Counter",
    "Significant Motion Detector",
    "Game Rotation Vector",
    "GeoMagnetic Rotation Vector",
    "Tilt Detector",
    "Android Stationary Detector",
    "Android Motion Detector",
    "Gravity -Wakeup Secondary",
    "Linear Acceleration -Wakeup Secondary",
    "Rotation Vector -Wakeup Secondary",
    "Step Detector -Wakeup Secondary",
    "Step Counter -Wakeup Secondary",
    "Game Rotation Vector -Wakeup Secondary",
    "GeoMagnetic Rotation Vector -Wakeup Secondary",
    "Chop Chop Gesture",
    "Moto Glance Gesture",
    "Camera Gesture",
    "Display Rotate",
    "LTS Gesture",
    "FTM Gesture",
    "LTV Gesture",
    "Off Body",

Lots more experimenting to do now!


Frank Meeuwsen's picture
Frank Meeuwsen on June 24, 2019 - 02:20 Permalink

I am very curious what movement enables the "Chop Chop Gesture" and how you will use it for your own projects!

Jarek's picture
Jarek on June 24, 2019 - 21:13 Permalink

On my older Moto G5, "chop" gesture is two rapid "karate chop" motions (as you would make from the elbow down, though for the phone doing it with only the wrist is sufficient), with the face of the phone held parallel to the plane of movement. It defaults to turning the flashlight on or off. (And the "camera gesture" is two twists of the wrist.)