LCD devpack

Discuss mobile apps for Texas Instruments products.
lb96
Posts: 18
Joined: 11:32, 06 Jul 2015

LCD devpack

Postby lb96 » 13:11, 19 Oct 2015

Hi

Is there any support for the 2650 LCD devpack within Evothings?

Regards
LB

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LCD devpack

Postby Fredrik » 13:32, 19 Oct 2015

Welcome back!

I assume you refer to the Watch DevPack (documentation here and here).

Much like the buzzer, we don't yet have explicit support for the DevPacks, but you can access their characteristics directly.

lb96
Posts: 18
Joined: 11:32, 06 Jul 2015

Re: LCD devpack

Postby lb96 » 13:48, 19 Oct 2015

Yes I meant the watch devpack. I thought that might be the case.

Pity as i wanted to integrate it into an existing project so I could use the sensortag as in altimeter display. I currently have a working altimeter that records data to an iphone app and this would have been a nice addition.

Thanks for your help

LB

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LCD devpack

Postby Fredrik » 14:06, 19 Oct 2015

I think you may have misinterpreted my message. It should be entirely possible to control the LCD screen via an Evothings app.

For example, this piece of code might print a message on the screen:

Code: Select all

// Control: display on.
device.writeCharacteristic('f000ad02-0451-4000-b000-000000000000', new Uint8Array([2]), function() {
// Control: clear all.
device.writeCharacteristic('f000ad02-0451-4000-b000-000000000000', new Uint8Array([3]), function() {
// Control: set position, top-left.
device.writeCharacteristic('f000ad02-0451-4000-b000-000000000000', new Uint8Array([6, 0, 0]), function() {
// Data: "Hello World!"
device.writeCharacteristic('f000ad01-0451-4000-b000-000000000000', evothings.ble.toUtf8("Hello World!", function() {
  console.log("success");
}, fail);
}, fail);
}, fail);
}, fail);

lb96
Posts: 18
Joined: 11:32, 06 Jul 2015

Re: LCD devpack

Postby lb96 » 08:55, 20 Oct 2015

Thanks for the reply. I have a screen on order so will try it out when it arrives.

lb96
Posts: 18
Joined: 11:32, 06 Jul 2015

Re: LCD devpack

Postby lb96 » 18:37, 12 Dec 2015

Hi

My LCD screen has just arrived and I can't seem to get it to do anything when I try and run the code:

device.writeCharacteristic('f000ad02-0451-4000-b000-000000000000', new Uint8Array([2]), function() {}, fail() );

I get the error:

TypeError: fail is not a function. (In 'fail(evothings.easyble.error.CHARACTERISTIC_NOT_FOUND + ' ' +
characteristicUUID)', 'fail' is undefined)

I've tracked this down to line 1112 of easyble.js as basically the function fail doesn't exist. Anyway I've modified the line to:

...
console.log("BLE writeCharacteristic failed: " + evothings.easyble.error.CHARACTERISTIC_NOT_FOUND + ' ' + characteristicUUID);
...

and the gap debugger now shows the error:

BLE writeCharacteristic failed: EASYBLE_ERROR_CHARACTERISTIC_NOT_FOUND f000ad02-0451-4000-b000-000000000000

This gives me the impressions the code doesn't know about the LCD display.

I've upgraded the sensortag firmware for the LCD and the display works fine via the TI SensorTag iPhone app. I'm also using the latest version of easyble.js that downloaded from github.

Any suggestions.

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LCD devpack

Postby Fredrik » 18:45, 12 Dec 2015

Looks like the SensorTag doesn't have the characteristic "f000ad02-0451-4000-b000-000000000000", as I thought it would. The documentation only says "ad02", so we'd have to guess at the rest of the UUID... except you can use the BLE Discovery example to get a complete list. So do that, and see what characteristics there are that have "ad02" in them.

lb96
Posts: 18
Joined: 11:32, 06 Jul 2015

Re: LCD devpack

Postby lb96 » 18:17, 13 Dec 2015

Thanks I'll try that and post back with the results.

lb96
Posts: 18
Joined: 11:32, 06 Jul 2015

Re: LCD devpack

Postby lb96 » 21:55, 14 Dec 2015

Hi

This is proving to be a bit tricky??

I had to read the service with 'f000ad00-0451-4000-b000-000000000000' which got rid of the previous error however when I try to write to the screen it fails with the error "The value's length is invalid"

my code snippets are as below which are modifications of the example "TI SensorTag CC2650 Demo":

app.sensortag.LCD_SERVICE = 'f000ad00-0451-4000-b000-000000000000';
app.sensortag.LCD_DATA = 'f000ad01-0451-4000-b000-000000000000';
app.sensortag.LCD_CONTROL = 'f000ad02-0451-4000-b000-000000000000';

....
....

app.readBuzzerServices = function(device)
{
device.readServices(
[
app.sensortag.IO_SERVICE,
app.sensortag.MOVEMENT_SERVICE,
app.sensortag.BAROMETER_SERVICE,
app.sensortag.LCD_SERVICE
],
// Function that monitors accelerometer data.
//app.startBuzzerNotification,
app.startTagNotification,
function(errorCode) { console.log('Error: Failed to read SensorTag services: ' + errorCode + '.'); }
);

};

....
....

app.startTagNotification = function(device)
{
///////////////////////////////////////////////////////////////////////
// LCD display
///////////////////////////////////////////////////////////////////////

// Control: display on.
console.log("Trying to turn LCD display on");

device.writeCharacteristic(app.sensortag.LCD_CONTROL, new Uint8Array([2]), function() {

console.log("LCD Display On");

// Control: clear all.
device.writeCharacteristic(app.sensortag.LCD_CONTROL, new Uint8Array([3]), function() {
console.log("Clearing LCD");

// Control: set position, top-left.
device.writeCharacteristic(app.sensortag.LCD_CONTROL, new Uint8Array([6, 0, 0]), function() {
console.log("Setting LCD position");

// Data: "Hello World!"
// This causes failure "The value's length is invalid"
device.writeCharacteristic(app.sensortag.LCD_DATA, evothings.ble.toUtf8("Hello World Test!"), function() {
console.log("LCD write success");
}, console.log("Failed to write to LCD")
);

}, console.log("Failed to set LCD position")
);

}, console.log("Failed to clear LCD")
);

}, console.log("Failed to turn on LCD")
);

};

....
....

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LCD devpack

Postby Fredrik » 22:04, 14 Dec 2015

The docs say Display Data size is 1-16 bytes. "Hello World Test!" is 17 bytes. Try a shorter string.


Return to “Texas Instruments”

Who is online

Users browsing this forum: No registered users and 1 guest