Lid Angle Sensor data

Neil Quigley's icon

Does anybody have a way of accessing macbook pro lid angle sensor through Max? I can't seem to find any info.

Thanks

Source Audio's icon

that sensor is HID Device.

maybe you can access it using hi object.

Neil Quigley's icon

You're right! - it shows up as "Page: 0x20, Usage 0x8a". It seem to only receive whole numbers from the hall sensor though and at a substantial delay. Still potentially useful though :)

Thanks!

Source Audio's icon

did you capture the output to max console using fast poll ?

Neil Quigley's icon

Is fast poll a specific message for the hi object? I'm currently running the poll at 10ms and there seems to be a delay in reading the sensor and only whole numbers.

Source Audio's icon

no, that is what I meant,

but did you print to console of just fill the message with output ?

sometimes HID devices send longer and itering strings

Neil Quigley's icon

Oh yeah, when I print the whole message directly from hi the value is prepended by 20, though there is still a delay and still the whole numbers. I assume that maybe its how the Macbook is reading the info from the sensor. I guess the refresh rate doesn't need to be that frequent for what it's being used for. It'd be nice to get the raw data from the hall sensor though.

Source Audio's icon

you could try this:

in max one can run python scripts using shell,

or maybe py externals

Neil Quigley's icon

Oh cool,

Thanks for this. I'll have a look and share any developments :)