Show Posts
Pages: 1 ... 16 17 [18] 19 20 ... 273
256  Using Arduino / Programming Questions / Re: 2 Shift register with 16 LEDs on: June 11, 2014, 01:51:17 pm
Shift out 16 zeroes perhaps ?
257  Using Arduino / Programming Questions / Re: My Piezo Buzzer Won't Cooperate With My Ping Ultrasonic Sensor and Servo on: June 11, 2014, 01:11:16 pm
Whether or not it is causing problems presently it is important that you do not power the servo from the Arduino 5V and GND pins as its voltage regulator is only able to supply limited current and could easily be damaged.

Code:
  if (inches <= 5) {
    digitalWrite(ledBoard, HIGH);

    beep(100);
    delay(1000);
    servoNeck.write(0);
    delay(500);
    servoNeck.write(90);
    delay(500);
    servoNeck.write(180);
    delay(500);
    servoNeck.write(90);
    delay(5000);
  }
Whilst the servo is moving you are not doing any distance measurement.  You need to change the scanning portion of the code.  Move the servo a little bit, measure distance, move it again and so on.  As it is at the moment all you do is move the servo and wait a bit.  Move it, wait again and so on.
258  Using Arduino / Programming Questions / Re: My Piezo Buzzer Won't Cooperate With My Ping Ultrasonic Sensor and Servo on: June 11, 2014, 01:52:10 am
Using the Servo library disables PWM output on pins 9 and 10 on boards other than the Mega. 
Guess which pin you are using for the speaker .....
259  Using Arduino / Sensors / Re: How do I use the KY-039 sensor? on: June 10, 2014, 05:12:39 pm
Should there be light coming from the Led when you apply power to the sensor?
No.  It's infrared light so invisible to the naked eye, but you should be able to see it using a digital camera.
260  Using Arduino / Programming Questions / Re: Converting Float to Char for ASCII Byte manipulation - Help with Char* to String on: June 10, 2014, 03:08:17 pm
In your example 'NewHeading"  is the same string identity.
As they say in all the best Pantomimes "Oh No its not !"


Quote
NewHeading.length();
versus
strlen(NewHeading);   

do both return the same integer?
One of the things that I like about the Arduino is the ease with which things can be tried for oneself.....
261  Using Arduino / Programming Questions / Re: When print works, but when return to funcion doesn't :( on: June 10, 2014, 09:43:23 am
Quote
For me the valor_decimal would always have some value..
Only inside the function where it is declared unless you declare it static in which case its value is maintained between calls to the function.

Did you also note the need for the array to be declared with 3 elements rather than 2
262  Using Arduino / Programming Questions / Re: Converting Float to Char for ASCII Byte manipulation - Help with Char* to String on: June 10, 2014, 09:04:20 am
There may be some confusion between Strings and strings (what's new ?)
Code:
NewHeading.length()
is a String function
Code:
strlen(NewHeading)
is a string function
263  Using Arduino / Programming Questions / Re: Problems after pressing reset button on: June 10, 2014, 08:57:47 am
Quote
and program wouldn't stop unless switching off the power
Why did you expect the program to stop ?
Which of the 2 examples (Knob or Sweep)  did you have trouble with or was it both ?
264  Using Arduino / Programming Questions / Re: Serial.read and array problems on: June 10, 2014, 06:45:33 am
What have you got the line ending set to in the Serial monitor ?
If it is set to 'Both NL and CR' then the NL will mess things up because you are only testing for CR in your code.
265  Using Arduino / Programming Questions / Re: Timer and Interrupt ! on: June 10, 2014, 02:55:40 am
Does this really need an interrupt at all ?  Surely just polling the drip detector would be good enough.
266  Using Arduino / Programming Questions / Re: Relay with TWO Input pins !!!! on: June 09, 2014, 06:23:11 am
We are all stabbing in the darks here.
Can you provide a link to where you obtained the relay in your picture as it is impossible to see the details in it such as what the jumper is for ?
267  Using Arduino / Programming Questions / Re: PWM output run in background? on: June 09, 2014, 02:23:44 am
What range of values do you see for pwm1 and pwm2 when you print them ?
268  Using Arduino / Programming Questions / Re: PWM output run in background? on: June 08, 2014, 12:05:06 pm
Thank you.  Now can you please do it again using code tags so that much of the program does not go into italics because of an array subscript using i like this
for (i = 0; i < buflen; i++)
   {
       Serial.print(buf);
       Serial.print(' ');
           
   }

I expect that you missed that advice when you read http://forum.arduino.cc/index.php?topic=97455.0
269  Using Arduino / Programming Questions / Re: PWM output run in background? on: June 08, 2014, 11:59:04 am
Post your code so that we can see what you are doing.
Do you want to control the speed of the motor or just turn it on and off ?
270  Using Arduino / Programming Questions / Re: Really easy question to answer about buttons on: June 07, 2014, 04:15:02 pm
In any case the counter would continue to increment very quickly whilst the button was pressed making stopping at the required display virtually impossible.
Pages: 1 ... 16 17 [18] 19 20 ... 273