Show Posts
Pages: 1 ... 17 18 [19] 20 21 ... 272
271  Using Arduino / Programming Questions / Re: converting character strings to numbers on: June 04, 2014, 04:09:33 pm
Now that I have seen your code I see that you are using Strings, not strings.  Not the same thing at all.

Have you been trying to use atoi() and atof() with Strings ?
272  Using Arduino / Programming Questions / Re: converting character strings to numbers on: June 04, 2014, 02:01:32 pm
Quote
Perhaps with atoi() and atof(), but I can't get that to work.
Can you please post a program showing what you tried and details of what did not work.
273  Using Arduino / Programming Questions / Re: Trying to make a standalone signal system... on: June 04, 2014, 02:55:55 am
Code:
if (route = 0)
This compiles but does not do what you want.
You need to use == to test a value as you have done correctly later in the program.

Code:
  for(int x = 0; x<13; x++){
    pinMode(x, OUTPUT);
  }
Do you really want to set pins 0 and 1 to OUTPUTs ?

Code:
if (digitalRead(cancelButton) == HIGH) route = 0; //reset route if cancel pressed
if (route = 0) { //only do this if no route has been set
  if (digitalRead(cb[1]) == HIGH) {
    route = 10;
  }
Personally I would always enclose the code block for a true if statement in braces rather than sometimes omitting them when the block has only one line of code
274  Using Arduino / Programming Questions / Re: extending battery life on Arduino uno servo control setup on: June 04, 2014, 01:34:47 am
As I said in my previous post
Quote
The library is not installed, installed in the wrong place, named wrongly or you did not stop/start the IDE after the installation.
Where is the library installed ?  Please give the full path of the folder and its name.

It should be in the libraries folder of the folder holding your programs, not the libraries folder where the Arduino executable is located.  If the problem is with the library location then looking at your code will not help.
275  Using Arduino / Programming Questions / Re: Help with logic on: June 04, 2014, 01:29:38 am
Quote
Is there a way i could have a current position variable? if  tell the stepper to move say 20 steps clockwise from 0 and it takes say 5 seconds to complete is there a way to check at what step it is at part way through the move?
Not unless you have some form of feedback from the motor such as a rotary encoder.  What you could do as a compromise is to move the motor one step at a time instead of 20 then you would at least know which individual step it was executing at any point in the program. 
276  Using Arduino / Programming Questions / Re: custom characters on: June 03, 2014, 03:03:36 am
Quote
my string"bhuvanesh:gd mrng"is not showing up
What, if anything, does show up ?
277  Using Arduino / Programming Questions / Re: extending battery life on Arduino uno servo control setup on: June 03, 2014, 01:11:05 am
Quote
I get a pop up when I verify that says ('IRrecv' does not name a type) And it highlights  IRrecv irrecv(RECV-PIN);
The library is not installed, installed in the wrong place, named wrongly or you did not stop/start the IDE after the installation.
278  Using Arduino / Programming Questions / Re: Am I overflowing a variable on State 2? on: June 02, 2014, 03:21:10 pm
I find state machines implemented with switch/case much easier to write and maintain than using if/else.  Use the state number as the switch variable and have a case for each state.  Using an enum or #defines to give states names helps even more.
279  Using Arduino / Programming Questions / Re: extending battery life on Arduino uno servo control setup on: June 02, 2014, 01:48:31 pm
I think that the first thing to ask is how you are powering the servos.  Can you provide a circuit diagram ?  A hand drawn one will suffice.
280  Using Arduino / Programming Questions / Re: LCD is displaying Chinese characters instead of alphanumeric??!! on: June 02, 2014, 01:04:26 pm
You could have at least posted your code.

The Additional Options link below the edit window allows you to attach a file to a post.  Including a picture in a post does seem to be unnecessarily difficult as it seems that it must be on a server for it to work.

See below for an attached image.

281  Using Arduino / Programming Questions / Re: LCD is displaying Chinese characters instead of alphanumeric??!! on: June 02, 2014, 12:18:24 pm
Why did you not post your code and circuit diagram here ?
282  Using Arduino / Programming Questions / Re: Help with logic on: June 02, 2014, 12:16:43 pm
Quote
I'm just not quite sure how to add all the states into it then so that say the servo wont start moving until the motor has moved the correct distance.
Do some research on Finite State Machines.

At any one time the program is in one of many states doing whatever is needed in that state such as running a motor for a fixed time or until a limit switch is reached.  Inputs and/or time passing cause the program to move to another state.  A convenient way to do this is to use the switch/case construct with the switch based on the current state.  What you must not do is to write code that blocks operation of the Arduino such as the delay() function.  Timing is best done using the millis() function.  Note the start time of a timed state (millis()) then each time through loop() check if it is time to end the current activity and move to a new state.

If you have more that one set of independent activities then you can have two FSMs running at the same time.
283  Using Arduino / Programming Questions / Re: Help with logic on: June 02, 2014, 11:30:27 am
Quote
I know it can be done in C++ but the arduino language is not exactly the same
What makes you think that it is different when it comes to such basics as passing variables to functions ?

In fact, if you thought about it for a split second you would know that it works otherwise the Arduino specific functions such as pinMode(), digitalWrite() and dozens of others would not work.

284  Using Arduino / Programming Questions / Re: Information output using C++/python/PHP on: June 02, 2014, 11:25:24 am
Quote
how could I make arduino  "talk " to c++ or python program I write
The most common way is probably to use a serial link but other methods such as Ethernet, SPI and I2C are available.
285  Using Arduino / Programming Questions / Re: Button matrix with serial communication code errors on: June 02, 2014, 04:50:32 am
Quote
I've started this build as a university project, and I'm nearing the deadline.  It's (supposed to be) a midi controller for a live music performance this week
This sounds all too familiar I am afraid.  The programming is left until the last minute because it will be either

(a) Easy to do.
or
(b) someone else will have done it before and you can use their code.

As you have discovered neither of these is true.
If you need help please share your requirments and circuit diagram here.
Pages: 1 ... 17 18 [19] 20 21 ... 272