From BlueMelon
This firmware is available on newly purchased modules. The firmware will be available for existing modules soon through an update utility which is currently in development.
This example demonstrates how the open collector output device can be used to generate PWM (Pulse Width Modulation) signals. Such signals can be used for example to simulate analog outputs or to dim lights.
First you need the block on the top to establish the connection between Max MSP(tm) and the BlueSense USB (wireless) router.
The middle block contains the BM7002 Bluesense digital outputs module. The first argument of the module is its identification number. Every BlueSense module has its own identification number which never changes. The id can be found on the module itself, and can also be found by checking the module table of the BlueSenseMaster component.
The open collector output module has 16 outputs. Normally these outputs are configured as either on or off. By typing PWM as the third argument however you can configure up to 16 pins as Pulse Width Modulation outputs. The PWM signal has a frequency of about 1 kHz which is enough to dim lights. The duty cycle of each PWM pin can be adjusted via the Max MSP object.
"BlueSenseOCOutput 912 PWM A" chooses a Open Collector Output module with id 912 and allows the adjustment of the duty cycles of the PWM signals on side A. If you set the duty cycle of a pin to zero, the corresponding PWMis deactivated.
In this example 15 of the 16 pins are used as PWMs. A1,A2,A3 can be connected to a three color led, just as A4,A5,A6 A7,A8,B1 B2,B3,B4 and B5,B6,B7. A1, A4, A7, B2, B5 must be connected to the red component of the corresponding leds. A2, A5, A8, B3 and B6 to the green component and A3, A6, B1, B4 and B7 to the blue component. The 'mood' generator can be used to generate random led colors. Refer to PWM explained for more info on pulse width modulation.