Show Posts
Pages: 1 [2] 3 4 ... 273
16  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 28, 2014, 05:12:44 pm
Try this
Code:
  number = (sizeof(myString) / sizeof(myString[0]));
17  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 28, 2014, 05:02:40 pm
Code:
if (myString[i] = NULL)
NO !
18  Using Arduino / Programming Questions / Re: Library Error --> " 'TwoServoAdapter' does not name a type ". on: July 28, 2014, 03:19:33 pm
The arduino is being powered by a seperate square 9V battery. The two AA batteries are just for the servos, also, I have no idea what the current output is of my AA batteries as it isn't written anywhere. (Forgive me I am bad with batteries)
If the 9V battery is what I know as a PP3 then don't expect it to last long before the voltage drops too low.  If you compound this by powering one of the servos from the Arduino 5V pin then expect it to last only a matter of minutes.

Please consider powering the whole thing from 4 AA batteries with the servos powered directly from them and not via the Arduino.
19  Using Arduino / Programming Questions / Re: switches within a counter sketch on: July 28, 2014, 03:13:12 pm
Quote
how do I do that? and what is PITA?
Put Serial.prints at pertinent points in your code so that you can see which portions of it are being executed.  Add prints of the values of important variables too so that you can see if they are what you expect but make sure that you also print labels with the name of the variable to avoid confusion as to what you are seeing.

As to PITA, see the first definition given on http://www.acronymfinder.com/PITA.html
20  Using Arduino / Programming Questions / Re: LCD & button to change lcd.write on: July 28, 2014, 12:03:09 pm
Good point Arrch.  I was trying to keep it simple, but state change detection will certainly be needed as may debouncing.
It would have been better if I had said
Code:
when button 1 changes from not pressed to pressed increment the counter variable
21  Using Arduino / Programming Questions / Re: parrot drone 2 conversion to rc on: July 28, 2014, 10:26:32 am
How do you know it exists and where have you looked ?
22  Using Arduino / Programming Questions / Re: 'SensorPin' was not declared in this loop on: July 28, 2014, 10:24:52 am
Quote
I can't tell what I did wrong
It is simple. The SensorPin variable is not declared anywhere in your program, or at least the portion of it that you have posted.

As an aside, please use code tags when posting code as it makes it easier to read.  Please read http://forum.arduino.cc/index.php?topic=97455.0 and follow the advice given there.
23  Using Arduino / Programming Questions / Re: LCD & button to change lcd.write on: July 28, 2014, 10:20:34 am
Quote
I assume this would use interrupts
There is no need to complicate things so forget about using interrupts.

Here is some pseudocode to give you some ideas
Code:
declare an array of pointers to the lines of text
declare a counter variable and set it to zero

start of loop()
  if button 1 is pressed increment the counter variable
    if the counter variable is greater than the maximum or button 2 is pressed
      reset the counter to zero
    end of if
  end of if
  display the message from the array using the counter as the array index
 end of loop()
24  Using Arduino / Programming Questions / Re: Very INSANE Problem-NOT RESOLVED on: July 28, 2014, 06:09:42 am
A suggestion.
Put some Serial.prints into your program so that you know which parts of it are running and when and what the value of important variables are at certain points, such as the distance returned by the sensor and print some messages so that you know which if commands are being executed as a result.
25  Using Arduino / Programming Questions / Re: Very INSANE Problem on: July 28, 2014, 04:52:22 am
I am sorry but I can't make sense of your reply.
The first step is to put some Serial.prints into your code to see what value the sensor is returning.

When you say that you have a drive do you mean that you have a motor driver board that forces you to use those pins ?  What happens if you don't try to play any tones, does the robot work OK then ?
26  Using Arduino / Programming Questions / Re: Very INSANE Problem on: July 28, 2014, 04:35:10 am
It may not be the cause of your problem but using the tone() function prevents use of PWM on pins 3 and 11 and your program uses both for PWM.

How do you know that the sensor does not detect anything ?
27  Using Arduino / Programming Questions / Re: How to test if a led is on without looking at it? on: July 27, 2014, 02:00:32 pm
Agreed 100%
28  Using Arduino / Programming Questions / Re: How to test if a led is on without looking at it? on: July 27, 2014, 01:54:07 pm
Quote
we don't have a real time "answer" from arduino about the state of this pin
You will if you use a global variable or one bit of a global variable to flag the state of the pin.
29  Using Arduino / Programming Questions / Re: on off swich on: July 27, 2014, 01:48:54 pm
it activates the pull down resistor for an input.

pull up or pull down ?
30  Using Arduino / Programming Questions / Re: Library Error --> " 'TwoServoAdapter' does not name a type ". on: July 27, 2014, 11:10:42 am
Quote
Oh, you need 1400mA?
The stall current of each servo is up to 700 mA according to the data in the link to them that you gave.  It would be simpler to user 4 AA batteries and remove the voltage regulator.
Pages: 1 [2] 3 4 ... 273