Go Down

Topic: button AND BT (Read 51 times) previous topic - next topic

Rookie77

Good afternoon all,

So I have been playing around and trying to figure things out.  Lots of reading, lots of youtube. (thanks to all that have helped btw!)

So I got playing with Mit ai2.  I can control an led through BT and I can control an LEd through Arduino using internal pull ups.

Now, what if I wanted to turn the LED on with Bluetooth (say by sending a 1 for on) how can I have it that the original push button will turn off and then send a "0" (for off ) so that the app knew it was off?

I've tried a few things and now are so far off where I started that I'm starting over, lol

A point in the right direction would be appreciated, so to recap,

Arduino uno
pull up resistor enabled
button on 2
led on 13

mit ai2 sending 1 for on
Arduino button to turn off and send 0 for off
Thanks in advance



Robin2

You need to post your Arduino program.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

xl97

Save the (variable) state of the LED...

and use that for the button, as well as to send back to the BT app.

Go Up