A Python and C++ utility for automatic screen rotation.
- 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
- 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
- Arduino_LSM6DS3
- Adafruit_SleepyDog
Board | Sensor |
---|---|
Arduino Nano 33 IoT | LSM6DS3 Accelerometer and Gyroscope (included in the board) |
- Unzip the source folder
- Install Python
- Install listed modules
- 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
- Install VSCode and PlatformIO
- Install listed libraries
- Plug in the board (USB) and upload (arrow at bottom left)
- 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