How to print a variable using ble_write() function ?

nRF8001
BLE Shield
How to print a variable using ble_write?
nRF8001
BLE Shield

Hi Sir,

I have connected Ble_sheild to Android App, I want to print variable value on display by using ble_write() function.

byte i = 1;
How to print "i" value using ble_write ??
I have tried all these ways, but could not work.

  1. ble_write(i);
  2. ble_write(&i);
  3. ble_write(bytes*);*
    EXAMPLE:
    if (i < 5) {
    i++;
    ble_write(i);
    }
    Could you please help me?

Without knowing what the ble_write() function does, it does not seem likely that we can help you.

You might be able to use something like:

byte i=1;

char stg[8];
sprintf(stg, "%d", i);
ble_write(stg);

Thanks for your reply.
Very last question.

unsigned long new_time;
void loop()
{
new_time = millis();
if ( ble_connected() )
{
ble_write(new_time);
}
ble_do_events();
}

How to print new_time value ??

How to print new_time value ??

Print it where? What makes you think that that code is not doing that?

WE CAN NOT SEE WHAT YOU SEE!