H
H
hlx2012-01-15 08:12:12
Android
hlx, 2012-01-15 08:12:12

Arduino + Android real-time data transfer?

Transfer data from Android to Arduino using USB Host Shield.
The logic is this: Data is constantly sent from Android, and depending on the processing of the received data, the delay (x) function is executed on Arduino, where x is the calculated time. The problem is that after the delay, the Arduino receives the data that was sent before, and not the data that is being sent now.
l_6ed5cb49.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AlexanderG, 2012-01-15
@AlexanderG

After processing delay(), clear the receive buffer. Of course, this only applies if the data received during the delay() operation can be lost.

O
Ocelot, 2012-01-15
@Ocelot

When new data is received, an interrupt should be generated, the handler of which should either transfer data to the main program (if it is free), or flush the receive buffer (if delay () is currently running).

E
Evgeny Bezymyannikov, 2012-02-01
@psman

Was the option considered when the PC starts sending data only as soon as Arduino reports that it is ready?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question