Coder Social home page Coder Social logo

PineTab (aka Quirky Devices) about rot8 HOT 3 CLOSED

efernau avatar efernau commented on July 30, 2024
PineTab (aka Quirky Devices)

from rot8.

Comments (3)

zhaofengli avatar zhaofengli commented on July 30, 2024

Still WIP, but I've made some changes to accommodate PineTab and similar devices:

Use the correct accelerometer value scale

Not all devices have the accelerometer raw values between 0 and 1 (e.g. PineTab). The correct scale is accessible via sysfs.

Revamped keyboard mode system

I added --keyboard-mode, which can be one of:

  • integrated: The keyboard is an integral part of the device. We will disable the keyboard when the screen is not oriented upright.
  • detachable: The keyboard is detachable. We will keep the screen oriented upright when the keyboard is attached.
  • none: We won't touch your keyboard.

After-rotation hook (#4)

You can specify a command to be run in shell after rotation with --rotate-hook. Useful for forcing a restart of Polybar, for example.

from rot8.

thurstylark avatar thurstylark commented on July 30, 2024

I also have issues with the accelerometer value scale. For my hw (Lenovo Yoga 920), /sys/bus/iio/devices/iio\:device0/in_accel_scale contains 0.009806650

I believe all that's necessary is to replace / 1e6 with a multiplication of whatever value is read from in_accel_scale:

rot8/src/main.rs

Lines 260 to 262 in b7b42d9

// Normalize vectors
let x: f32 = (x_clean as f32) / 1e6;
let y: f32 = (y_clean as f32) / 1e6;


Edit: Actually, it should be (raw + offset) * scale

Reference: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-inertial-measurement-units/adis16400#show_channel_value

from rot8.

efernau avatar efernau commented on July 30, 2024

thanks for your commit, sadly not merged.
your problem should now be solved with --normalization-factor and --invert-y. the idea with the after-rotation hook and the keybord mode should be implemented. but the change of -k would be a braking change, see this in the planned rewrite version 0.2.0.

from rot8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.