Show Posts
Pages: 1 ... 16 17 [18] 19 20 ... 289
256  Using Arduino / Project Guidance / Re: Controlling car systems with arduino on: July 29, 2014, 08:57:33 am
I was not being tough, merely ironic and pointing out the error at the same time, but I do wish that you had not revised the original post as it makes comments to it meaningless.  Adding a note to it would have been better.

One thing that I was deadly serious about though was the advice not to try implementing cruise control.
257  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 29, 2014, 08:51:15 am
This thread would have been over quicker if reply #5 had been noted, but I agree that econjack has provided chapter and verse.

What I don't understand is that if the strings (or Strings) are being created dynamically then you will surely know how many of them there are as part of the process of creating them.
258  Using Arduino / Project Guidance / Re: Controlling car systems with arduino on: July 29, 2014, 06:22:03 am
Quote
I understand the usual for boards is 40amp / pin or 200 amp total
WOW !
Where can I buy an Arduino that can supply 40 Amps from a pin ?

I guess we all know what you mean, but seeing what you wrote worries me that there is a certain lack of clear thinking, and if your programming is as sloppy as your understanding of current then you will have difficulties for sure.

Whatever you do please do not attempt to create an Arduino powered cruise control on the car.
259  Using Arduino / Project Guidance / Re: #28015 ultrasonic rang finder on: July 29, 2014, 06:11:51 am
Please Sir, I know the value of pingPin !
Code:
const int pingPin = A2;
Do I get extra points for knowing that it also has another value ?
260  Using Arduino / Programming Questions / Re: Rotary Switch to change Arduino Scripts on: July 29, 2014, 05:00:25 am
As a first step read the analogue input from the switch into a variable and print it.   Now, armed with the value at the 3 different positions (actually you only need the value for the centre position as the 2 ends can be at 0V and 5V)  you can construct a series of if statements to test the value and execute the appropriate code for the switch position.

Note, however, that due to the use of the delay() function in your light sequences, changing the switch position will not immediately make the light sequence change to the newly selected one as the current sequence must end before the switch position is read again.  There are ways round this but get the basic version working first.
261  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 28, 2014, 05:21:46 pm
sizeof() returns the total number of bytes used by the array.  In the code posted by the OP it is an array of pointers, so the total size divided by the size of one array element gives the number of elements in the array.
262  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]));
263  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 !
264  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.
265  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
266  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
267  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 ?
268  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.
269  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()
270  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.
Pages: 1 ... 16 17 [18] 19 20 ... 289