Our "tisensortag" library doesn't have any functions to access the LED/buzzer service, but it ought to be possible to do it directly. A good starting point might be our example "ti-sensortag-cc2650-demo", which doesn't use the library but instead talks to the tag via "easyble".

The buzzer/led value is a bitfield. One can use the bitwise OR operator ( | ) to combine bits.

Values are determined by the formula (1 << bit).

The first bit, bit 0, has the value 1 and controls the red LED. The second bit, bit 1, has value 2 and controls the green LED. The third bit, bit 2, has value 4 and controls the buzzer.

That is how value 4 turns on the buzzer. Similarly, value 1 should turn off the buzzer and the green LED and turn on the red LED. Value 7 (1 | 2 | 4) should turn on all three devices. Value 0 should turn them off.

Am also trying to get the buzzer/leds functioning. Have tried the code presented by lb96 in all manner of ways both in the workbench and in the sample app "ti-sensortag-cc2650-demo"....within a function etc. etc. and after the initialization routines. No luck. Am familiar with reading from the Sensortag........but not writing. Any simple ideas. Thanks in advance for your reply......

// Set accelerometer notification to ON. device.writeDescriptor( app.sensortag.MOVEMENT_DATA, app.sensortag.MOVEMENT_NOTIFICATION, // Notification descriptor. new Uint8Array([1,0]), function() { console.log('Status: writeDescriptor ok.'); }, function(errorCode) { // This error will happen on iOS, since this descriptor is not // listed when requesting descriptors. On iOS you are not allowed // to use the configuration descriptor explicitly. It should be // safe to ignore this error. console.log('Error: writeDescriptor: ' + errorCode + '.'); });

I followed this example, and I can get the buzzer/LED's to turn on when initializing the app (thanks!), but how do I go about if I want to create a function to turn LED's/buzzer on or off when e.g. clicking a button? It seemed very straight forward - I just created a function inside of app.js using the exact same code as was suggested here:

This won't work however. I can see why there would be a problem, since startBuzzer asks for an object to be passed in ("device") and I don't know how to do this (I've tried everything I could think of, "device", "app.device" etc. but I'm a noob so I can't get it to work).