-1

I'm new to Arduino and try to accomplish following 2 things (via Bluetooth module connected to an Android phone):

  1. read an integer value provided by user.
  2. obtain current time from the phone (the Arduino board itself has no clock module).

As for #1 - I'm able to print to the Bluetooth terminal as follows: Serial.println("Enter time to wait(in miliseconds): ");. I see this string on my phone. However I can't manage to read the value from the terminal using timeToWait = Serial.read();. I tried many possible combinations, but in the best case I get it in form of chars' ASCII values. So how can I properly read an integer value from the Bluetooth terminal?

As for #2 - is it possible at all, and if yes - how? If it is not possible to obtain current time via BT from Android phone - is it possible to obtain it via BT from a Linux laptop? How?

-1

Over a serial port, you are transmitting data byte by byte. If you want to interpret them as numbers, you have to parse the data and assemble the numbers yourself.

You could resort to BLE instead, there you may transmit strings and numbers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.