sandeepmistry / node-powermate

A Node.js library for the Griffin PowerMate
41 stars 25 forks source link

Unable to use set brightness/speed #8

Open Mrono opened 8 years ago

Mrono commented 8 years ago

Set pulse speed only turns it solid or pulse, no speed change set brightness sets it to the brightness then instantly changes it back

sandeepmistry commented 8 years ago

@Mrono could you please share the code you are running?

The following works for me:

Pulse:

var PowerMate = require('./powermate');

var powermate = new PowerMate();

powermate.setPulseAwake(true);

powermate.setPulseSpeed(250);

Brightness:

var PowerMate = require('./powermate');

var powermate = new PowerMate();

var i = 0;

setInterval(function () {
  console.log('setBrightness', i);

  powermate.setBrightness(i);

  i += 10;
}, 100)
Mrono commented 8 years ago

Brightness wasn't working right because pulseAwake was still set to true

Pulse range is wrong, only range that works for me is 240-310

sandeepmistry commented 8 years ago

Pulse range is wrong, only range that works for me is 240-310

I think the range in the code was based on the PowerMate USB HID protocol doc. Unfortunately, I can't find my copy of this on my Mac. Maybe you could look into it further?