Pages: [1]   Go Down
Author Topic: i want to have the status of my pins on my android phone using bluetooth  (Read 513 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i am using arduino , android phone , and bluetooth..
i have 2 pins .. i need to turn them on or off .. but the problem is that i need to get the status first of those 2 pins .
for example if pin 1 is on , so there is no need to turn it on ...
i need a program that checks the status of my pins  .. and when it check, it must give me a feed back on my ON and OFF pins.. please help me ..

Offline Offline
Faraday Member
Karma: 92
Posts: 3447
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What have you tried?

Offline Offline
Full Member
Karma: 2
Posts: 175
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you must use digitalRead(pin) and after send this state to bluetooth with serial.
int val = 0;     // variable to store the read value
int ledPin=13; //Indicator led. If pin 2 or 3 is HIGH red led on.
//We check the pins 2, can change it....

void setup()
  pinMode(ledPin, OUTPUT);      // sets the digital pin 13 as output
  pinMode(2, INPUT);      // sets the digital pin 2 as input
  pinMode(3, INPUT);      // sets the digital pin 3 as input

void loop(){
for(int i=2;i<4;i++){
     val = digitalRead(i);
if ( val==HIGH ) {
           Serial.print(i);//Send to bluetooth HIGH pin
           digitalWrite(ledPin,HIGH); //If pin 2 or pin 3 is HIGH the LED 13 on for 1 secs
} else {
    digitalWrite(ledPin, LOW);  // turn LED OFF

 You must see in your android screen the HIGH pins...
« Last Edit: May 25, 2013, 10:25:29 am by power7net » Logged

Web / sms / bluetooth / arduino / android remote control. Home Automation projects.

Pages: [1]   Go Up
Jump to: