Show Posts
Pages: 1 ... 33 34 [35] 36 37 ... 285
511  Using Arduino / Programming Questions / Re: digitalWriteFast library on: May 28, 2014, 03:03:02 am
Quote
sketch_may28d:19: error: 'digitalReadFast' was not declared in this scope
It looks like the library is not installed properly or that the IDE was was not stopped and restarted after the library was installed.

Which library do you want to use ? digitalReadFast or digitalWriteFast ?

Is the library installed and if so, where (exactly) ?

512  Using Arduino / Programming Questions / Re: Merging codes on: May 28, 2014, 02:57:49 am
AMPS - did you try compiling that code ?
Code:
          case 2:
            lcd.setCursor(0,0);
            set_latitude();
            timedBeep(shortBeep,1);
            goto longi;



          case 3:
Not only does it have a dreaded goto in it, the label that it refers to does not exist
513  Using Arduino / Programming Questions / Re: Why doesn't my input ever work? on: May 28, 2014, 02:48:15 am
Code:
  if(inVar == LOW) {          //count up each time button is pressed
    haltOps++;
  }
That is not counting how many times the button is pressed.  Rather it increments haltOps every time through loop() if the button is held down, ie very frequently.

Look at the state change detection example in the IDE to see how to determine when an input changes from HIGH to LOW, not when it is LOW as you are doing now.
514  Using Arduino / Programming Questions / Re: digitalWriteFast library on: May 28, 2014, 02:41:00 am
Quote
from some reaon it is not compiling.
Please post the text of the error message.
515  Using Arduino / Programming Questions / Re: fatal error: avr/interrupt.h: No such file or directory compilation terminated. on: May 28, 2014, 02:32:10 am
You appear to have posted this question twice.

Please remove the other post and post the program that causes the problem here, having noted the advice in http://forum.arduino.cc/index.php?topic=97455.0
516  Using Arduino / Programming Questions / Re: Help to get a simple LCD text string to work in the middle of GPS sketch on: May 28, 2014, 01:33:45 am
The problem sounds like it is caused by running out of memory.  Granted that a series of spaces should take the same space as a series of characters....

Try using the F() macro for your string constants as in
Code:
Serial.println(F("This string will be stored in flash memory"));
517  Using Arduino / Programming Questions / Re: New to arduino, and need some help with my logic on: May 28, 2014, 01:25:25 am
Code:
  while(LED == HIGH)
LED is a const int variable with a value of 13.  HIGH has a value of 1
When will 13 equal 1 ?

I assume that you meant to read the value of the LED pin to ascertain whether it is HIGH or LOW and then act accordingly, but you never read it, only write to it.  However, had you read it then it would always have been LOW anyway because you set it that way a few lines above.

Code:
    myArray[4] = 00000;
    myArray[4]++;
I still don't understand what these lines are supposed to do.
518  Using Arduino / Programming Questions / Re: While Loop versus For Loop - Why does the LED stay on? on: May 27, 2014, 02:55:43 pm
The break; is exiting the while loop unconditionally and the LED is then turned off only to be turned on again next time through the loop() function if the while conditions are met.  Take out the break; you don't need it.
519  Using Arduino / Project Guidance / Re: newbie asking.. master plz help me on: May 27, 2014, 07:31:07 am
My first piece of advice would be to stop using those 9V batteries if they are really what you are using and not just in the diagram for illustration only.  They are not capable of running the Arduino for more than a few minutes and they will certainly not run motors or the servo sensibly because they cannot deliver enough current.

The best way to start is to get each element of your project working independently then combine them together.  Have tried the example programs for the ultrasonic sensor, the servo and the motor shield ?  If not, what have you tried ?

Post any code that you have tried, making sure that you read, understand and follow the advice in the stickies at the top of this forum about how to do it.
520  Using Arduino / Programming Questions / Re: DTMF - Arduino Uno R3 motor controller code on: May 27, 2014, 02:35:06 am
I can't help with the DTMF side of things but the Arduino side of things sounds relatively simple.
I suggest that you test it first using pushbuttons as inputs.  That way yo don't have to worry whether the DTMF system is working.

Wire 4 pushbuttons to 4 Arduino input pins using a resistor between the pin and GND to hold it LOW and the pushbutton between the pin and 5V to take it HIGH when when the button is pressed.  Note that there is a simpler way to wire them that does not need an external resistor but it may not be appropriate when used in conjunction with the DTMF unit, hence this suggestion, but see below.  Now use the examples in the Arduino IDE Digital section to experiment with reading the inputs and reacting to them.

You will not be able to drive the motor directly from the Arduino as it cannot provide enough current so you will need a motor shield or at least some external electronics connected to an output pin in order to do it.  Connect the motor however you decide to do it and try outputting a PWM signal to the pin controlling it and the speed should vary.  The IDE Fade example will show you how to do this.

The next phase is to combine the 2 ideas.  Read an input and when it changes from LOW to HIGH (IDE State Change example) change the output PWM value appropriately.  Take it one step at a time an don't try to do everything at once.  Use Serial.print() to show you the value of variables at various points in the program and to indicate which section of code is being executed.  Once everything is working you can take them out.

Once you have the DTMF sorted out you can replace the pushbuttons with connections to the DTMF circuit to take the Arduino inputs HIGH.  If the the DTMF unit takes them LOW then you can reverse the Arduino logic and wiring to accomodate this.
521  Using Arduino / Programming Questions / Re: Leonardo pin 17 (rx led) on: May 26, 2014, 10:35:33 am
If you can't test it then I suggest that you can't use it.

Can you please clarify exactly what you mean by "pin 17" ?
Pin 17 of the Leonardo board or pin 17 of processor chip ?
522  Using Arduino / Programming Questions / Re: Leonardo pin 17 (rx led) on: May 26, 2014, 01:24:39 am
Quote
will the following code work as intended?
One of the nice things about the Arduino is that it is so easy to try things for yourself.
523  Using Arduino / Programming Questions / Re: Serial Comunication on: May 25, 2014, 02:30:04 am
How far have you got ?
Can you read the value from the pot, convert it to a byte and print it on the Serial monitor of the first Arduino ?

Have you looked at the analogue example programs in the IDE ?  AnalogInOutSerial would seem to be particularly relevant.
524  Using Arduino / Programming Questions / Re: Serial Comunication on: May 25, 2014, 01:20:23 am
Is it the code to use RS485 or the code to do the control that you have a problem with ?

A Google search for arduino rs485 or a search for rs485 in this forum returns quite a few hits. 

The motor control aspect of the project sounds easy.  Read the pot with an analogue input on Arduino 1 and map() it down to the 0 to 255 range (or just divide it by 4) then send the resulting byte to Arduino 2.  On Arduino 2 read the byte and use a PWM output to drive the motor using the incoming byte as the PWM parameter.

525  Using Arduino / Programming Questions / Re: Problem while adding numbers on: May 24, 2014, 04:50:50 pm
Thanks.  I see what you are getting at now.
Pages: 1 ... 33 34 [35] 36 37 ... 285