Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / count character on: April 07, 2013, 10:36:17 pm
How to count a character...

Example:

char char1[20] = "love";

 
result is countchar = 5;


The result is base on how many the char is in the char1.
char1 have 5 char including the null terminator which turn countchar equal to 5.

2  Using Arduino / General Electronics / Re: DC power is not working on: March 26, 2013, 12:43:37 pm
I find out the problem after I buy the tester..



It is a s4 diode.. but what kind of s4 diode it is?
3  Using Arduino / General Electronics / Re: DC power is not working on: March 24, 2013, 06:16:33 am
Quote
1. Check power supply voltage.
2. Check voltage after protection diode.
3. Check voltage after 5v regulator.

One of these will fail.

how can I check it..
Do I have to use a tester.?

Sorry I'm a bit noob..
4  Using Arduino / General Electronics / Re: DC power is not working on: March 24, 2013, 06:15:38 am
Quote
Does the power LED come on with USB but not with the 2.1mm power connected?  If so, to troubleshoot have you any way of confirming your external power source is supplying in the range 7-12V?

Hi.. The power LED come on with usb but now with the 2.1mm power connected.
Power supply that I already tested are.. 9.0v, 17v, and 12v.. But it is now working.
5  Using Arduino / General Electronics / DC power is not working on: March 24, 2013, 05:46:15 am
My Iteaduino 2.2... suddenly not working with DC input power.

But working in USB power.

What should I do?
6  Using Arduino / Project Guidance / Re: sms based door lock on: March 18, 2013, 06:20:59 am
unsigned long last_check = millis();

loop()
{
  if (millis() - last_check > 30000)
  {
     // do the check
     last_check = millis();
  }
}

This code actually help me... but instead of 30000 millis interval I rather prefer 1000 which is give exactly what I want..
The logic you gave me is what I really need. If I'll have a problem regarding to this matter.. I'll post it. Thank you Monsieur

7  Using Arduino / Project Guidance / Re: sms based door lock on: March 18, 2013, 03:39:55 am
Quote
Understand your sms library. Then define one or more states, for example idle, command_sent, response_received. Study how to read from serial without blocking, for example here http://www.gammon.com.au/forum/?id=11425. Then, instead of calling IsSMSPresent,

- start from idle state.
- when in idle state, send the AT+CGML command (or whatever the library sends) and change state to command_sent.
- when in command_sent state, receive the response from the modem in a non-blocking way. The response will be processed during many loop()s and will contain more than one row. Each time you receive a complete row (a '\n' char) you take some action (e.g., update a counter, see what the library does) and clear the receive buffer.
- when you receive the OK ending the response from the modem take some further action, then return to idle state.

This is *not* a trivial modification to the library source code and will require a substantial amount of additional code.



I don't know how to do it.. I don't understand AT-COMMANDS .. I would be grateful if someone will do it for me T_T
8  Using Arduino / Project Guidance / Re: sms based door lock on: March 18, 2013, 03:22:10 am
Quote
sms.IsSMSPresent() is a function outside your code, in a library. I don't know what it does and if you want you can attach this library. I guess however that the function sends a command to the phone, something like AT+CGML="REC UNREAD", which lists the unread messages in the phone's memory. The problem is that it is blocking, it must wait for the modem response, and takes time even if there are no messages. You can measure the time it takes using millis(), this way:


millis spent in sms.IsSMSPresent: 91
millis spent in sms.IsSMSPresent: 91
millis spent in sms.IsSMSPresent: 91
millis spent in sms.IsSMSPresent: 91
millis spent in sms.IsSMSPresent: 91
millis spent in sms.IsSMSPresent: 90


This is what it show when I test the time millis between

this code

Code:
unsigned long elapsed_millis;
  unsigned long start_millis = millis();
 char pos =  sms.IsSMSPresent(SMS_UNREAD);
 if (pos) {
  sms_detected();
 }
 
  elapsed_millis = millis() - start_millis;
  Serial.print("millis spent in sms.IsSMSPresent: ");
  Serial.println(elapsed_millis);
 

9  Using Arduino / Project Guidance / Re: sms based door lock on: March 17, 2013, 10:51:28 am
Quote
The only alternative I see is changing the library code so that instead of a single blocking function you have different functions that are called during successive repetitions of loop().

How could I do this?
10  Using Arduino / Project Guidance / Re: sms based door lock on: March 17, 2013, 05:13:48 am
No. If you see my code in the loop I am not sending a message unless otherwise the attempt is equal to 3, I only reply to message when I received it. In the loop I only monitor incoming messages.. and I only monitor attempt then said messages and its part of the process to wait when sending messages.. However the problem is when I insert this code
Code:
char pos =  sms.IsSMSPresent(SMS_UNREAD);
 if (1==pos) {
  sms_detected();
 }

If it is the problem what is the solution.. Should I use millis();   ?
11  Using Arduino / Project Guidance / Re: sms based door lock on: March 16, 2013, 05:52:15 am
When the gsm module is off.. It is 100% fast and responsive.. however when it is turns on it remove 50% speed and accuracy.. do you It is fault of gsm ??
12  Using Arduino / Programming Questions / Arduino Mega2560 Rev3 on: March 15, 2013, 11:25:45 am
Hi.. Recently I am trying to build a secret knock and sms based door lock.. but when I implement the sms the secret knock is not very responsive ? What should I do.. my board is Arduino Duemilanove w/ Atmega328, Icomsat 1.1.

Should I replace Arduino Duemilanove w/ Atmega328 to Arduino Mega2560 Rev3?
For faster processes ?

The code is attached below...
13  Using Arduino / Programming Questions / Re: Should I replace my board or there is something wrong with my code on: March 15, 2013, 08:18:11 am
I remove all of those sensor and delay.. but in some reason when I knock it detect not very well unless otherwise the gsm is off..
14  Using Arduino / Programming Questions / Re: How to add a char on: March 15, 2013, 08:16:01 am
Thank your monsieur
15  Using Arduino / Programming Questions / How to add a char on: March 15, 2013, 04:48:24 am
How to add a char inside a char..?


Example: char char1[] = "I am";
             char char2[] = "Legend";

I want a result :

             charadd = "I am Legend"
Pages: [1] 2 3 4