camera logic to roll camera

I want to roll the horizon.
As in a jet fighter cockpit view.
But this would be including the entire animation/scene.

I haven’t found a web search or forum search that shows how this can be done, but it seems to be just a question of rolling the camera, using the logic. Rather than tilting and panning, which are often also referred to as ‘roll’.

The input would be from an external absolute position encoder. The BGE scene must sync in orientation with a real live image which is rotating on a screen. No doubt someone will guess what this is for.
Getting external input has one web link I found, putting encoder data into a file and then have python read it at intervals with an access flip so data cannot be read while it is still being written.

The needed rate of change in horizon level is very slow, a complete 360 degrees in several minutes.

Sorry, this is one of those irritating noob questions that betrays a total lack of experience with BGE.
Before I invest too much time modelling and animating, I want to know if it is going to be possible.

Thanks for any help.

Edit:Found this trying to guess what keywords to use in a search.
Thread: Arduino controls Blender object in real time
It is an old thread, so wondering what the latest releases of Blender and python script will allow.
Reading through the thread I can see that if the BGE will be a standalone executable, any data input must be done from that directly using a python read of the USB serial input.

H[leonardo59](https://blenderartists.org/forum/member.php?296658-leonardo59)
Parenting the camera to the jet should solve your problem.

This camera will “see” the horizon visible from the jet.

Jolo

This will require python knowledge and understanding.

I would avoid going through external files, as on Windows, reading/writing files is quite slow (Linux seems to do a better job of caching them). There is the pySerial module which allows you to access the serial port (AKA talk to the arduino) directly.

This sort of thing is definitely possible. I’ve used BGE several times to interact with real-world systems - primarily as interfaces for controlling robots and displaying real-time data about the robot. Typically I interface with the robot/system over ethernet/wifi, but I have used the pyserial as well (though only with a different GUI toolkit).

What specific issue are you having? Are you able to read the values in python and are having issues writing them to the camera orientation?