Giter Club home page Giter Club logo

automatic-screen-rotation's Introduction

Accelerometer based automatic screen rotation for Windows

A Python and C++ utility for automatic screen rotation.

Features

  • Automatic port detection and automatic (re)connection to the Arduino board
  • Screen orientation and position customizable for each of the 5 physical orientations (portrait, portrait flipped, landscape, landscape flipped and flat) using a configuration file
  • Control over rotation threshold and sample rates

Requirements:

Python 3.x (or use executable)

Packages:

- PySerial
- win32api

If access is denied, try: python -m pip install instead of: pip install

If you get unresolved imports, see: https://stackoverflow.com/q/53939751

VSCode with PlatformIO IDE

Libraries

- Arduino_LSM6DS3
- Adafruit_SleepyDog
Board Sensor
Arduino Nano 33 IoT LSM6DS3 Accelerometer and Gyroscope (included in the board)

Setup process

  1. Unzip the source folder

Python

  1. Install Python
    • Install listed modules
  2. Create a startup task in task scheduler https://www.jcchouinard.com/python-automation-using-task-scheduler/ Use pythonw.exe for creating a background process (start at logon), usually located at e.g. C:\Python39\pythonw.exe

Alternatively, if you don't have Python installed, use the .exe file

Arduino and PlatformIO

  1. Install VSCode and PlatformIO
    • Install listed libraries
  2. Plug in the board (USB) and upload (arrow at bottom left)

Configuration file and debugging

  1. Change the settings in rotate_screen_config.ini
    • You can execute the python script in a console for debugging purposes with py .\rotate_screen.py (open the terminal in the Source folder) or open rotate_screen_console.exe

automatic-screen-rotation's People

Contributors

nguyen-v avatar

Stargazers

 avatar

Watchers

 avatar

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.