Go Down

Topic: Arduino ADK (Read 1 time) previous topic - next topic

Feb 22, 2012, 08:51 am Last Edit: Feb 22, 2012, 09:12 am by TeenAndroid Reason: 1
Hello, I'm a beginner in Arduino programming..we are designing a GSM doorbell. I'm using an Arduino ADK board that will communicate to a Samsung Galaxy Y Android phone.The phone and board are embedded to the doorbell. The doorbell captures images of visitors that will press the doorbell and sends it to the homeowner's phone and after that, It would call the phone. I would like to make a program that would cancel the process (using a seperate pushbutton wired inside the house)of communication between the phone and the board if for instances the homeowner is inside the house. I've started the program, here it is..

const int dbbutton = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize serial communication:
 Serial.begin(9600);
 // initialize the LED pin as an output:
 pinMode(ledPin, OUTPUT);      
 // initialize the pushbutton pin as an input:
 pinMode(dbbutton, INPUT);    
}

void loop(){
 // LED normally on
 digitalWrite(ledPin, HIGH);
 // read the state of the pushbutton value:
 buttonState = digitalRead(dbbutton);
 // check if the pushbutton is pressed.
 // if it is, the buttonState is HIGH:
 if (buttonState == HIGH) {    
   // turn LED off:    
   digitalWrite(ledPin, LOW);  
 
 }
 
}
Btw, an LED is on if doorbell button is pressed it will be turned off if the cancel button is pressed.
Thank you so much!I would really appreciate your help. :)

dxw00d

This will need to be part of existing code that does the image capture/phone call. Where is that code?

PaulS

Quote
Thank you so much!I would really appreciate your help.

Perhaps you could start with telling us what you need help with?

You are not enabling the internal pullup resistor. So, you must have an external resistor. You do have one, right?

Might I strongly encourage you to put each { on a new line, and use the Tools + Auto format option to make your code more readable.

While I'm at it, might I encourage you to post code properly, using the # icon.

dxw00d :No, the codes for the capturing and voice calling are programmed in eclipse. Are we doing it right?lol

PaulS: No, we do not have an external resistor.Thank you for your corrections! I just forgot to include it in my program. I need help in sending a data to the Android phone so that the ongoing process would be cancelled once the cancel button is pressed.in serial communication of course.


dxw00d

Quote
the codes for the capturing and voice calling are programmed in eclipse.


That code is running on the Arduino ADK board though, yes?

Quote
That code is running on the Arduino ADK board though, yes?


Yes sir, it is!I'm just having a problem with the codes regarding the sending of data, from arduino to android to cancel the ongoing process on the android phone, which is the main purpose of program that I posted.

dxw00d

Right. So you need to insert the cancel button routine into the existing code that you have running. You can't just write a separate sketch for it.

Ok thank you for your help sir! :)

Go Up