RBL Simple Controls app additional input readings (urgent)


#1

Hi there! I’m on a serious time crunch and would be deeply grateful if anyone could help me out.

I was looking through the code for the Simple Controls app on both the Arduino side & the App side(Android) and was wondering, if I wanted to read another 2 Analog inputs from the BLEShield, how would I go around doing it?

Currently from what I could see, on the Arduino side,
uint16_t value = analogRead(ANALOG_IN_PIN);
ble_write(0x0B);
ble_write(value >> 8);
ble_write(value);

And on the App side(Android),

private void readAnalogInValue(byte[] data) {
for (int i = 0; i < data.length; i += 3) {
if (data[i] == 0x0B) {
int Value;

			Value = ((data[i + 1] << 8) & 0x0000ff00)
					| (data[i + 2] & 0x000000ff);

			tv.setText(Value + "");
		}
	}
}

I’m guessing that I have to change both of these code but I’m not sure how to.


#2

A completely different alternative is to use the general purpose pfodApp (www.pfod.com.au) on the Android side to display and log the data.
The free pfodDesigner (https://www.forward.com.au/pfod/pfodDesigner/index.html) will generate Arduino code for the RedBearLab BLE Shield (https://www.forward.com.au/pfod/BLE/index.html#RedBearLab)
including display and plotting of analog inputs.


#3

Ohh okay… I will try. Thank you!