Loading...
  Show Posts
Pages: 1 ... 23 24 [25] 26 27 ... 93
361  Using Arduino / Programming Questions / Re: using debounce on: April 06, 2013, 04:14:46 pm
You need to make the debounce section test not just whether the bouncing has finished but also that the input has changed from LOW to HIGH.  If that is true then add one to your counter.
362  Using Arduino / Programming Questions / Re: Looking for the DS1307RTC.h library on: April 06, 2013, 02:54:18 pm
First hit in a Google search for DS1307RTC.h download
https://bitbucket.org/johnmccombs/arduino-libraries/src/fb1d031725b8/DS1307RTC/DS1307RTC.h
363  Using Arduino / Programming Questions / Re: Guiding for coding buttons on several places. on: April 06, 2013, 02:51:53 pm
Mea maxima culpa
or, to translate, whoops !
364  Using Arduino / Programming Questions / Re: Alarm event without RTC ok, with RTC no alarm. Not rocket science I'm sure. on: April 06, 2013, 02:09:10 pm
Does this page help ?
http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/understanding-the-code
365  Using Arduino / Programming Questions / Re: Guiding for coding buttons on several places. on: April 06, 2013, 01:51:42 pm
Code:
if (armed = true);
should be
Code:
if (armed == true);
or
Code:
if (armed);
366  Using Arduino / Programming Questions / Re: Need the void loop to run just once... on: April 06, 2013, 07:53:21 am
Or even better above
Code:
if (Serial.available() > 0)
{
  serialA = Serial.read();
  Serial.println(serialA);
}
to make it easier to read
367  Using Arduino / Programming Questions / Re: how to read analog value continuous with Serial.read() on: April 06, 2013, 04:43:57 am
i want serial monitor to monitoring continuous like a loop , not single value.
Can you please describe what the program should do ?  That might help understand exactly what you mean.
368  Using Arduino / Programming Questions / Re: Need the void loop to run just once... on: April 06, 2013, 04:20:40 am
Apart from your original code have you got any where you have tried to do what has been suggested ?  Even if it does not work post it here and we will help you some more.
369  Using Arduino / Programming Questions / Re: how to read analog value continuous with Serial.read() on: April 06, 2013, 04:17:36 am
As it is currently written your program will only read the analogue inputs whilst there is something in the serial buffer.
Is that how you want it to work ?
370  Using Arduino / Programming Questions / Re: small function() eats up RAM on: April 06, 2013, 01:48:06 am
Quote
I have optimised the memory usage by using the Flash library http://arduiniana.org/libraries/flash/ for most strings which is why the print statements may look strange but it works really well.
except that it might be causing your problem.

Please post your whole code

Does the function consume memory each time it is used if you use conventional methods of printing messages to the lcd ?  Are the messages defined as Strings by any chance ?
371  Using Arduino / Programming Questions / Re: code seems to pause for no reason on: April 06, 2013, 01:37:40 am
Let's look at a small section of your code
Code:
void loop()
{
  pingRight();
  rightDistance = microsecondsToCentimeters(durationRight);
  delay(300);
  pingLeft();
  leftDistance = microsecondsToCentimeters(durationLeft);
  delay(300);
Presumably the pingRight and pingLeft functions are meant to measure the distances right and left, but if you look at either of them they do not move the pan servo.
372  Using Arduino / Programming Questions / Re: Controlling LED-s with Potentiometer on: April 06, 2013, 01:05:48 am
Quote
I can tell you that you are not going to learn programming in a day, week or even a month.
or at all if someone writes the code for you.
373  Using Arduino / Programming Questions / Re: servo coding on: April 05, 2013, 04:26:21 pm
Quote
most code we can find online.
It is true that there is plenty of code online but rarely will it do exactly what you want, hence the need to do some coding yourself despite what your teachers might say.
374  Using Arduino / Programming Questions / Re: stop led in a void on: April 05, 2013, 04:20:54 pm
Unless the wheels are spinning at incredible speed I would forget about using interrupts.
Read the sensors each time through loop() and do the LED on/off/flash timing using millis() as your timer, not delay(), because if the first LED is to stay on for say 5 seconds and you use delay(), then the program cannot read the other sensor during the delay.

Look at the BlinkWithoutDelay example in the IDE to see how millis() can be used like this
375  Using Arduino / Programming Questions / Re: Need the void loop to run just once... on: April 05, 2013, 04:15:00 pm
so what exactly should i change in the sketch?
Declare the new variables at the top of the program before anything else then turn my psuedo-code into real code.

Did you write the code that you posted ?  If so, then you will know how to write an if statement to test whether a variable is true or false to determine whether a section of code should be run or not because it has ifs in it already.

One thing to look out for is if case 2 is true before case 1 and the case 2 code runs then it will not run again even after case 1 has been subsequently run when using the logic in my code.  After each case has run you will need to make sure that the next case can run by setting its 'flag' variable to false.
Pages: 1 ... 23 24 [25] 26 27 ... 93