Jump to content

Yes, this sounds stupid, but is it possible? How would i set it up?

 

I have a monitor on a stand that spins 360 degrees, and it would be cool to just rotate it to portrait, and having it switch automatically to portrait.

Part of the reason for this idea is that the "ctrl + alt + arrows" shortcut has been removed from windows for absolutely no reason, so the only possibilty to change monitor rotation is to "win+d" to desktop, right click, display properties, choose the monitor rotation, click apply.

 

So any ideas about this idea?

If this is not possible, any ways to re-add monitor rotation shortcuts?

I only see your reply if you @ me.

 

Link to comment
https://linustechtips.com/topic/1104909-add-a-gyroscope-to-my-monitor/
Share on other sites

Link to post
Share on other sites

You could use this solution:

https://superuser.com/questions/447155/how-do-i-set-up-a-hotkey-or-shortcut-to-rotate-my-screen-in-windows

And bind some Autohotkey to certain key combos (like Ctrl+Alt+Arrows ;) )

 

Or you could take it a step further and add a gyroscope to your monitor + microcontroller (like an Arduino Nano) and if the rotation changes by a certain amount, have it trigger that shortcut (would require a cable from the Arduino to your computer)

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to post
Share on other sites

Just now, spartaman64 said:

i dont think theres many gyroscopes for movement on the consumer market. why dont you just do it with motors

Motors?

 

Gyroscopes are the sensors that detect object rotation.

 

So when i rotate the screen with my hands on my cool monitor mount, the gyroscope should detect it, and then send that info to the computer

I only see your reply if you @ me.

 

Link to post
Share on other sites

Just now, Origami Cactus said:

Motors?

 

Gyroscopes are the sensors that detect object rotation.

 

So when i rotate the screen with my hands on my cool monitor mount, the gyroscope should detect it, and then send that info to the computer

oh i thought that you meant you want the monitor to rotate by itself when you set it to portrait in settings. sorry morning no coffee brain

Link to post
Share on other sites

Just now, minibois said:

Or you could take it a step further and add a gyroscope to your monitor + microcontroller (like an Arduino Nano) and if the rotation changes by a certain amount, have it trigger that shortcut (would require a cable from the Arduino to your computer)

That would be my main idea, any more info?

How would i even start to setup something like this? Any place i could find the info at?

I have only programmed lego robots, but i don't think i could hook up my lego gyroscope to my computer.

I only see your reply if you @ me.

 

Link to post
Share on other sites

Just now, spartaman64 said:

oh i thought that you meant you want the monitor to rotate by itself when you set it to portrait in settings 

That would be really cool to, probably even cooler than my idea, but it would be much more expensive. ?‍♀️

So i would maybe do that in the future? ?

I only see your reply if you @ me.

 

Link to post
Share on other sites

8 minutes ago, Origami Cactus said:

That would be my main idea, any more info?

How would i even start to setup something like this? Any place i could find the info at?

I have only programmed lego robots, but i don't think i could hook up my lego gyroscope to my computer.

You first need to get supplies:

- Arduino Uno/Nano (or similar microcontroller, Arduino just has a big userbase, many supplies and tutortials. You can get this either from the official source, or a knockoff from any Chinese marketplace.

- Gyro that works with your Arduino of choice

- Cable long enough for your purpose (The Arduino Uno and Nano use USB-B and Mini-B respectively, usually a short cable is included).

 

Coding:

Some basic info on Arduino: it's a tiny 'computer' (not exactly computer entirely..) that runs some pretty basic code. It needs to check the rotation of the gyro and pass along a key command upon a certain threshold is reached.

Say this is your setup:

image.png.18e59c96a5c3ac783e71770e8dc01314.png

Then the code should press either command one time.

Some pseudocode to give you an idea:

//Code initialization:

// An 'enum' is a specific state a variable can have
enum PossibleMonitorState {
  Potrait,
  Landscape
};

PossibleMonitorState CurrentMonitorState;
PossibleMonitorState NewMonitorState;

// if the rotation is within 10 degrees, the monitor will turn to that.
int standardDeviation = 10;

// The two rotation angles.
int LandscapeAngle = 0;
int LandscapeAngleUpper = LandscapeAngle + standardDeviation;
int LandscapeAngleLower = LandscapeAngle - standardDeviation;

int PortraitAngle = 90;
int PortraitAngleUpper = PortraitAngle + standardDeviation;
int PortraitAngleLower = PortraitAngle - standardDeviation;


// Run this constantly:
int rotation = GetRotationScript();

// Get a new monitor state from that rotation
NewMonitorState = GetMonitorState(rotation, CurrentMonitorState);

if(NewMonitorState != CurrentMonitorState)
{
	CurrentMonitorState = NewMonitorState;
	ChangeMonitorRotation(CurrentMonitorState);
}

public PossibleMonitorState GetMonitorState(int monitorRotation, currentState)
{
	PossibleMonitorState returnValue = currentState;

	if(monitorRotation < LandscapeAngleUpper && monitorRotation > LandscapeAngleLower)
    	returnValue = PossibleMonitorState.Landscape;
        
	if(monitorRotation < PortraitAngleUpper && monitorRotation > PortraitAngleLower)
    	returnValue = PossibleMonitorState.Portrait;
        
    return returnValue;
}

public void ChangeMonitorRotation(PossibleMonitorState rotation)
{
	if(rotation == PossibleMonitorState.Landscape)
    	// Do the command for 0 degrees
	if(rotation == PossibleMonitorState.Portrait)
    	// Do the command for 90 degrees
}

Something like that should work. Not the prettiest code, but should do the trick.

I would recommend just looking up some examples people have already made with Gyros on Arduino.

 

The keypad library would probably be helpful too, in combination with the AHK shown before:

https://playground.arduino.cc/code/keypad/

 

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to post
Share on other sites

7 minutes ago, Origami Cactus said:

That would be my main idea, any more info?

How would i even start to setup something like this? Any place i could find the info at?

I have only programmed lego robots, but i don't think i could hook up my lego gyroscope to my computer.

That would be insanely complicated to have a motor control the rotation of your screen. How do you check if you have no object around, what happens if your screen is elevated on the stand to allow the rotation and not hit the desk, or monitor stand? (and that is ignoring the fact that you'll need to code a small program to detect screen rotation and send a signal to an Arduino, and stuff.

 

 

Link to post
Share on other sites

HP once had a monitor that was supposed to automagically change from landscape to portrait and back when you rotated the screen 90 degrees with a driver that came with it. It didn't work on my machine. I called HP's tech "help" and all the idiot I spoke to could tell me was my computer was missing a driver (he called it a program) but couldn't tell me what it was. His response was to call the manufacturer of the computer to get that program. I asked the idiot if HP was going nto pay for the service call to Acer since my computer was out of warranty. When he said no, I told hime either he was going to tell me how to fix it or I would never buy another HP product again. That was almost ten years ago and I still will not buy HP products (I also had to replacce a perfectly good HP laser printer because the bastards wouldn't write a new driver for it when Win 7 came out, and their toner cartridges were chipped and I couldn't find any that weren't expired). Apparently, I wasn't the only one who had problems with that model because, afik, HP doesn't make them anymore.

Jeannie

 

As long as anyone is oppressed, no one will be safe and free.

One has to be proactive, not reactive, to ensure the safety of one's data so backup your data! And RAID is NOT a backup!

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×