Show Posts
Pages: 1 ... 23 24 [25] 26 27 ... 285
361  Using Arduino / Project Guidance / Re: Help starting my sketch on: June 27, 2014, 02:23:31 am
The most useful thing that you can do is to post your code, including the if statements that you are having trouble with and explain what is going wrong.
362  Using Arduino / Programming Questions / Re: The easiest way to do a "single-game" console? on: June 26, 2014, 03:35:41 pm
Have you done any research on the functions in the library ?
http://arduino.cc/en/Reference/TFTLibrary
http://arduino.cc/en/Reference/TFTLoadImage seems to be what you want.
363  Using Arduino / Programming Questions / Re: How use a function? on: June 26, 2014, 08:07:15 am
Quote
I tried move the  function "remoteIP"  to the class "UIPClient" but  the function returns an IP wrong .
Have you any code that you want to share with us ?
364  Using Arduino / Programming Questions / Re: Hello guys I need some helping hand... on: June 26, 2014, 06:55:45 am
Quote
Sir Hellibob... can you show me how it is done? i dont really have an idea how to do that
Have you looked at and do you understand the BlinkWithoutDelay example in the IDE ?  If not then do it now.

You will need to restructure your program so that you keep calling the popo() function. When it is first called send the carriage return and save the first start time from millis().  Next time it is called check whether the required interval has passed and if so send the first AT command string and save the new start time.  Next time it is called check whether the required interval has passed and if so send the second AT command string and save the new start time.  Carry on the same way until all the data has been sent.  If you update a byte variable in popo() as each command is sent you can keep track of what state the system is in, how long to wait and what to do next.  You will have created a State Machine.

I see, however, that there are suggestions in this thread that you may not need to wait as long between sending, if at all.  What is it that you want to do whilst the data is being sent ?
365  Using Arduino / Programming Questions / Re: Hello guys I need some helping hand... on: June 26, 2014, 01:17:48 am
Quote
is it possible to remove the delay in sending message and change it into millis?
Yes.

Does there actually have to be a delay between the commands and data in the popo() function and if there does do they need to be as long as one second ?
366  Using Arduino / Programming Questions / Re: Subroutine causing loss of serial data coming from a GPS. on: June 25, 2014, 01:40:19 am
Quote
The LCDmain() code is too large at the moment to post, has very few comments, and, at this point, has no interaction with any of the other parts of the program.
But it presumably prints things including text.  Could that be causing a problem with memory shortage when it is included ?
367  Using Arduino / Programming Questions / Re: ServoTimer2 library giving errors..... PLEASE HELP on: June 25, 2014, 01:36:24 am
That library is old and predates Arduino 1.00 and needs changes made
Download the corrected library from http://sourceforge.net/projects/pgahtow/files/Arduino%20%28v1.0%29%20libaries/ServoTimer2.zip/download
368  Using Arduino / Programming Questions / Re: Serial Port Error Display on: June 25, 2014, 01:31:40 am
As you have not posted your whole program the snippet that you have posted is fairly meaningless.
Please post your whole program.

Where do you want to
Quote
put the data received from the external device
369  Using Arduino / Programming Questions / Re: Using button to clear eeprom on: June 24, 2014, 03:57:09 pm
Peter, you are of course right and that is what I meant but did not express clearly.  Combining that with CrossRoads suggestion of using one location as a clear/not clear flag would further reduce the chance of writing to the EEPROM when not necessary.
370  Using Arduino / Programming Questions / Re: Delay() or Not Delay(), that is the question. on: June 24, 2014, 11:24:14 am
Quote
the sweep example, is another of the "how not to design code" examples.
It does what it sets out to do, which is to sweep a servo through 180 degrees in each direction.  It is not presented as an example of good programming practice and if it were written as non blocking code many users looking at it for the first time would be bamboozled for sure.

What would have been better would be to include 2 versions, one as now and a second non blocking version with an explanation of why it is better in some circumstances.  The examples, particularly those included with libraries, are examples of how things can be done, not necessarily how they should be done.  This may be a shame but it is a fact.
371  Using Arduino / Programming Questions / Re: PIR activated relays on: June 24, 2014, 04:59:53 am
If the OP has stated his requirements accurately then I would go with delay() as suggested by wildbill.  True the OP will not learn to use the BlinkWithoutDelay millis() way of timing, but why complicate things when it is not necessary ?

Code:
delay(x);
does exactly what it says on the tin.  It delays the code for x milliseconds.  If/when the OP comes back and says that he wants to implement an override button or read a second sensor during the waiting period, then would be the time to move to a different timing mechanism.

An analogy would be to suggest using direct port manipulation to turn the relays on and off because it is 'better'.  It may be smarter, faster, neater etc but it is unnecessary in this case.
372  Using Arduino / Programming Questions / Re: Hello guys I need some helping hand... on: June 24, 2014, 04:46:07 am
Some comments on your code, albeit not related to your problem.

Code:
  float hh = now.hour();   
  float mm = now.minute();   
  float ss = now.second();   

  float yy = now.year();   
  float mmm = now.month();   
  float dd = now.day();   
Are the hour, minute, second, year, month and day really floats ?  I have not used an RTC but it sounds unlikely to me.

Code:
  String k=message;        // Save input string
Why ?

Code:
};
You really love your semi-colons don't you !
373  Using Arduino / Programming Questions / Re: Using button to clear eeprom on: June 24, 2014, 02:34:13 am
I don't really see the problem.  In the loop() function read the pin that the button is attached to and if the button is pressed use a for loop to fill the EEPROM with zeroes.  Am I missing something ?
374  Using Arduino / Programming Questions / Re: Latching a Momentary Button to last pressed state on: June 24, 2014, 02:27:11 am
As currently written the program changes LEDstate when the button IS pressed rather than when it BECOMES pressed so it will change very rapidly.  There is a StateChangeDetection example in the IDE that will show you how to detect the change from not pressed to pressed.
375  Using Arduino / Programming Questions / Re: Help Needed!! Controling Servo Angle Trhough Xbee on: June 24, 2014, 01:09:08 am
Code:
case '1':
  case 1:
You still don't quite get it, do you ?
Pages: 1 ... 23 24 [25] 26 27 ... 285