button AND BT

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

You need to post your Arduino program.

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

...R

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

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