Toggle navigation
Categories
Discussions
Activity
Sign In
Home
›
Firmware
Uint8Array structure
ldeluca
August 2014
in
Firmware
What are the read and write values for the Uint8Array arrays for each of the modules? Is this documented somewhere?
Comments
Eric
August 2014
Currently, we don't have any public documentation available on the byte formats. The closest thing out there is the source code for the Java API on the GitHub page.
Some Java files of interest:
https://github.com/mbientlab/Metawear-AndroidAPI/blob/1.0.3/src/com/mbientlab/metawear/api/util/Registers.java
Check out the Register inner enum in each of the classes:
https://github.com/mbientlab/Metawear-AndroidAPI/tree/1.0.3/src/com/mbientlab/metawear/api/controller
Look bettween lines 238 and 552 for byte orderings
https://github.com/mbientlab/Metawear-AndroidAPI/blob/1.0.3/src/com/mbientlab/metawear/api/MetaWearBleService.java
doncoleman
August 2014
In order to get the LED to light, what's the process? Set a Color Channel, then call Play?
Can any of the color channel arguments be omitted to turn the LED solid Blue or Red?
https://github.com/mbientlab/Metawear-AndroidAPI/blob/1.0.3/src/com/mbientlab/metawear/api/MetaWearBleService.java#L368
Eric
August 2014
Yes that is correct, first set a color channel then play. And yes, you can omit channels as they are controlled independently of each other.
ldeluca
August 2014
going through the java code to figure out the structure is painful.
@eric
, can you give us an example of changing the LED color?
Eric
August 2014
The MetaWear app has examples covering most of the functions in the api.
https://github.com/mbientlab/Metawear-SampleAndroidApp/blob/2.1/src/com/mbientlab/metawear/app/LEDFragment.java#L157
ldeluca
September 2014
I tried this:
data[0] = 0x02; // Color Register
data[1] = 0x02; // always 2 on test
data[2] = 0x00; // high intensity
data[3] = 0x00; // low Intensity
data[4] = 0xF4; // rise time
data[5] = 0x01; //
data[6] = 0xF4; // Rise Time
data[7] = 0x01; // High Time
data[8] = 0xF4; // High Time
data[9] = 0x01; // Fall Time
data[10] = 0xD0; // Fall Time
data[11] = 0x07; // Duration 2000
data[12] = 0x00; // Duration 2000
data[13] = 0x00; // Pulse Offset
data[14] = 0x0A; // Pulse Offset
AND THIS:
// Blink Blue?
var data = new Uint8Array(16);
data[0] = 0x02; // Color Register
data[1] = 0x02; // Color Blue ??
data[2] = 0x02; // Flash?
data[3] = 0x31; // High Intensity
data[4] = 0x0; // Low Intensity
data[5] = 0xFF; // Rise Time
data[6] = 0x0; // Rise Time
data[7] = 0xFF; // High Time
data[8] = 0x0; // High Time
data[9] = 0xFF; // Fall Time
data[10] = 0x01; // Fall Time
data[11] = 0xD0; // Duration 2000
data[12] = 0x07; // Duration 2000
data[13] = 0xFF; // Pulse Offset
data[14] = 0x0; // Pulse Offset
data[15] = 0x0A; // Repeat Count 10
neither one of these caused the LED to light up.
ldeluca
September 2014
I think i got it working. wasn't enough to send the color information, also had to send the play command.
HOW DO I RESET THE PATTERN. I want to use a single color not a pattern.
This discussion has been closed.
Comments