0

I uploaded a bluetooth sketch from IDE (File->Examples->Firmata->Standard Firmata) to Arduino Duo.

Now if I have a sensor attached to this Arduino, I can use bluetooth from another device (Raspberry pi or mobilephone) to read the sensor.

But what if I want to do something in the arduino itself? I see only one option which is to edit the standardfirmata to read the sensor and do something. So multiple sketches running in one sketch.

Am I correct?

asked Apr 5, 2016 at 13:22

1 Answer 1

-1

If you programmed the Arduino to read the sensor and the do something else, what would you do if a second request to read the sensor came in before you had stopped doing something else?

I don't know anything about Firmata. Could you add two sensor's, so the Pi could select to read from sensor 1 or sensor 2? If you could do that then you alter the 'readSensor2()' function so it did 'Something else'. This way you are exploiting any control/synchronisation logic within Firmata. If you need 'readSensor1()' to automatically 'do something else' ever time it was called then couldn't you just tag it onto the end of 'readSensor1()'.

answered Apr 6, 2016 at 12:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.