Show Posts
Pages: 1 ... 372 373 [374] 375 376 ... 581
5596  Using Arduino / Microcontrollers / Re: ArduinoISP not working! on: April 02, 2012, 10:55:14 am
In Arduino 1.0 the serial buffer size has been reduced.  This causes failures in the ArduinoISP sketch.  One work-around is to reduce the baud rate in the ArduinoISP sketch and in the programmers.txt file.
5597  Using Arduino / Project Guidance / Re: Wireless detection of vehicle lock movement on: April 02, 2012, 10:46:00 am
You might be able to use a "wireless doorebell".  Put the bell in your bedroom and mount the button in the door such that it will be pressed when the lock is opened.  If you have the doors locked when you are driving and parked the battery in the button unit should last a good long time.

Does your care have a keyless entry system that opens the windows if you hold the button down?  Accidental pressing of the button could explain most of the symptoms you see.
5598  Using Arduino / Motors, Mechanics, and Power / Re: Motor Speed Control on: April 02, 2012, 10:28:26 am
void setup()
  Serial.begin(9600);       // start the serial port
  pinMode(pwm_a, OUTPUT);  //Set control pins to be outputs
  pinMode(pwm_b, OUTPUT);
  pinMode(dir_a, OUTPUT);
  pinMode(dir_b, OUTPUT);
  analogWrite(pwm_a, 80);  //set both motors to run slow
  analogWrite(pwm_b, 78);  // Motor B runs a little faster than Motor A so apply a little less power
  lastState = state = STATE_FORWARD;
5599  Using Arduino / Motors, Mechanics, and Power / Re: Motor Speed Control on: April 01, 2012, 08:13:42 pm
PWM (analogWrite()) only sets the proportion of time the motor gets power.  The characteristics of the motor and load determine how fast the motor goes with that input power.  To get any sort of precise speed control you need feedback.  You need some way to measure the speed and adjust the power to get the speed you want.

You might be able to get close by adding a fudge factor to one motor's control input and manually adjusting that fudge factor to get closer to equal speed on the two motors.
5600  Using Arduino / Project Guidance / Re: LM35 temperature equation? on: April 01, 2012, 02:21:29 pm
Also one more thing I found about the sensor says that " No matter what supply you use, the analog voltage reading will range from about 0V (ground) to about 1.75V." for LM35. I would like to know why that is if anyone knows.

1.75v = 1750 mV = 175°C  The LM35 is only good to 150°C so outputs above 1.5V (1500 mV) can't be relied on.
5601  Using Arduino / Programming Questions / Re: Why is Serial.parseInt() so slow? on: March 31, 2012, 10:07:20 pm
Enter a number value such as 3 (with "No line ending" selected in the serial monitor) to see the sketch delay before getting the 3 value, but then use the value correctly. Enter a value such as "3x" (with or without a line ending) to see the sketch pick up the 3 value instantly but then after a delay receive a 0 value.

You call parseInt() and it sees the 3, starts to accumulate digits and knows it is done when it sees a non-digit (x) coming.  It returns the 3.

You call parseInt() again and it sees the 'x'.  Probably throws it away and waits for a digit to arrive.  After a second it has no new input so it returns 0.

After each parseInt() you should check the serial buffer (.available()) and read the terminating character.  You can turn on linefeed (newline) terminators and check that the terminating character is '\n'.  If it isn't you have detected an input error and can ignore the number.
5602  Using Arduino / Programming Questions / Re: long ISR on: March 31, 2012, 09:58:11 pm
You can re-enable interrupts in your ISR to allow other background operations to happen.  That should not cause a problem unless the current ISR takes longer than the interrupt interval that triggers it.  Does the interrupt ever happen again in less than 100 microseconds?
5603  Using Arduino / Microcontrollers / Re: using the onboaurd 8/16u2 as isp? on: March 31, 2012, 09:52:21 pm
Well, you'd need an ISP to re-write the firmware in the 8U2.  You'd also loose serial communication with the USB host unless you could fit both the ArduinoISP sketch and the USB-to-Serial firmware.  You would need separate firmware for the 386 and 2560 since the 2560 is too big for the STK500V1 protocol and  needs STK500V2.

Aside from all those limitations it would allow you to download sketches without using some of the main processor memory space for a bootloader.
5604  Using Arduino / Programming Questions / Re: Compiler error? A delay is needed to work on: March 31, 2012, 08:54:49 am
       if (Serial.available()>0) {
          //delay(2);  //try coment and uncoment this line  <-------------------------------------------------------------------- HERE!!!
       else {
   while (empty_port==true);

The reason you need the delay() is that you are reading until you get ahead of the sender, not until you read a character that indicates the end of input.  Without the delay you are reading faster than the sender is sending and get ahead of the sender before the transmission is complete.
5605  Using Arduino / Programming Questions / Re: using multiple pages in the ide on: March 31, 2012, 08:48:31 am
You could make each page a .h file and include them all in the main sketch.
5606  Using Arduino / Programming Questions / Re: Servo.h not behaving as i expect on: March 31, 2012, 06:45:44 am
You forgot to show where servo1 and servo2 are created.

You seem to be using pins 1 and 2 for your leg servos.  Are you not using Serial?  Serial uses pins 0 and 1.
5607  Using Arduino / Sensors / Re: PulseIn timeout reading a proximity Sensor on: March 30, 2012, 05:37:39 pm
I believe it has to do with how the function is declared out in the wiring.h file from what I have read.

The declarations look fine in Arduino 1.0.  What version are you using?
5608  Using Arduino / Sensors / Re: Problem with ADXL335 on: March 30, 2012, 12:46:20 pm
Try connecting the GPS with longer wires.  If the problem comes back the GPS is probably creating noise on the power line.  I'm not that familiar with noise reduction on power lines but I would guess that a combination of inductors and capacitors would filter out the noise.
5609  Using Arduino / Sensors / Re: PulseIn timeout reading a proximity Sensor on: March 30, 2012, 12:40:25 pm
Are you sure your sensor still produces pulses at low speed?  What sensor are you using and how is it wired?
5610  Using Arduino / Displays / Re: RGB LED dot matrix display. on: March 29, 2012, 11:03:53 pm
The ShiftPWM library will let you control 768 LED's (256*R+256*G+256*B) with 32 levels of brightness and refresh fast enough to not cause major flicker.

If you want a non-matrixed display, the SPI interface on a 16 MHz Arduino can pump data at 8 million bits per second (1 million bytes per second).  If you want a frame rate of 100 frames per second that gets you 10,000 bytes.  If you use one of the LED driver chips that has 16 bits per LED that would allow 5,000 individual LED's (1666 each of Red, Green, and Blue).  Each chip controls 16 LED's so you'd need 300 of the driver chips and they are not cheap.
Pages: 1 ... 372 373 [374] 375 376 ... 581