Show Posts
Pages: 1 2 [3] 4 5 ... 539
31  Using Arduino / LEDs and Multiplexing / Re: Problem cascading TLC5917 shift registers using ShiftPWM. on: April 13, 2014, 08:12:12 am
I've also popped out the first chip and jumpered pins 2 & 13, then the outputs for the second chip work as expected.

Did you mean to say "jumpered pin 14 (MOSI) of the socket to pin 9 (QH*) of the socket"? 
32  Using Arduino / Installation & Troubleshooting / Re: avrdude: stk500_recv(): programmer is not responding on: April 13, 2014, 07:57:38 am
Remember that once you have use an ISP to upload a sketch you have wiped out the bootloader and can no longer upload through serial.  To fix that you have to upload a fresh bootloader.

Maybe the board did not have a good bootloader when you got it.  Try uploading the Arduino Pro Mini bootloader and then trying the FTDI cable again.
33  Using Arduino / Project Guidance / Re: 6v 300mA water pump activated by PIR using Arduino Board - 6v issues on: April 13, 2014, 07:36:22 am
The minimum recommended voltage for the Vin pin is 7V.  The Vin pin supplies voltage to the internal 5V regulator and those regulators typically need a couple of extra volts to regulate properly.

That being said: it will probably still work.  The Arduino will likely work fine at the reduced voltage.

To turn the motor on and off use an NPN transistor between the - side of the motor and Ground.  Connect the + side of the motor directly to the 6V battery.  Google for Arduino Transistor to get more information about using a transistor to boost the current and voltage controlled by an output pin.
34  Topics / Science and Measurement / Re: Maximum Digital Sample Rate possible (3 digital inputs)? on: April 13, 2014, 07:27:35 am
But the CPU can only do one thing at the same time?

Yes.  Fortunately the timers are done in hardware so you can be counting off clock cycles at the same time you are running software.  You will want to read about Timer/Counter 1, 2, and 3 in the ATmega328P datasheet. To note the time you just copy the counter register.

You are right that the time it takes to handle the interrupt will limit the minimum delta-t you can measure.  If you expect the events to be very close together you could keep the interrupts off and poll the inputs in a tight loop looking for changes.  The Arduino can execute 16 instructions per microsecond so you should be able to get resolution of a microsecond or better.

static volatile byte dataBuffer[100];
static voltatile boolean done = false;
byte *pointer = dataBuffer;
static byte oldPins = 0, pins;
do {
    while ((pins = PINB & B00011100) == oldPins);
        {/*WAIT*/}   // wait for PORTB bits 2-4 (Pins 2, 3, and 4) to change
    *pointer++ = TCR2;  // Note clock counter from Timer 2
    *pointer++ = pins;  // Note curent state of the input pins
    oldPins = pins; //  Look for further changes
} while (pins != B00011100);
done = true;

You would then post-process the data buffer to see what order the changes came in.  The buffer needs two bytes for each transition.  An 8-bit counter (like 2 or 3) will roll over every 16 microseconds.  If your experiment is likely to take much more than 16 microseconds you might need to use the 16-bit counter (Counter-Timer 1).
35  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE will not start on: April 13, 2014, 06:55:02 am
So i currently use version 1.0.4 on both Windows 7 and OS X 10.5.8!

Mac OS X 10.5 (Leopard) was released in late 2007 so it is over 6 years old and four major revisions back. It is not surprising that the Java it runs is not capable of supporting the latest Arduino IDE.
36  Topics / Science and Measurement / Re: Maximum Digital Sample Rate possible (3 digital inputs)? on: April 12, 2014, 10:50:30 am
You can run a timer at 16 MHz so you an get a precision of 1/16th of a microsecond.

You can use the Pin Change Interrupt feature to run an ISR when any of the pins change.  As each pin goes HIGH, note the pin number and timer count and disable the interrupt for that pin.  Compare timer counts to get relative timing.
37  Using Arduino / Project Guidance / Re: logic for arduino programming? on: April 12, 2014, 10:35:18 am
const byte buttonPin = 3;

void loop() {
   if (digitalRead(buttonPin)) {
    else {
38  Using Arduino / Project Guidance / Re: Camera Stabilizer with MPU6050 IMU on: April 12, 2014, 10:30:55 am
You could use the PID library.
39  Using Arduino / Sensors / Re: Problems with Ultrasonic Range Finder - Maxbotix LV-EZ1 on: April 11, 2014, 08:56:33 pm
I am using a Lilypad Main Board. Does it still work?

If you look at the boards.txt file you will see that the Lillypad uses "variant=standard" which means it uses the same pin mapping as the Arduino UNO.
40  Using Arduino / Programming Questions / Re: Blending/Interpolating between array values on: April 11, 2014, 08:48:26 pm
If you aren't in a hurry you could use floating-ppoin math:
    float entry = (analogRead(1) * 19 ) / 1024.0;  // Value from 0 to 18.999
    float fraction = entry - (int) entry;  // Subtract out the integer part
    float value =  maft[(int)entry] + (maft[(int)entry+1] - maft[(int)entry]) * fraction;
41  Topics / E-Textiles and Craft / Re: Detecting Vigorous Motion on: April 11, 2014, 08:33:03 pm
Many toys detect impact by having a light spring with a wire post own the middle.  On an impact the spring bends and makes contact with the post.  The contact acts as a closed switch.
42  Using Arduino / Audio / Re: LED Audio Sensor Project on: April 11, 2014, 08:30:18 pm
Break the problem down into steps.

Have you successfully connected your microphone and gotten values for loudness?  If not, where are you stuck?

Have you successfully connected the Neopixel strip and set it to various colors?  If not, where are you stuck?
43  Using Arduino / Programming Questions / Re: Arduino Ethernet - not using SD, can I use pin 4 for an I/O? on: April 11, 2014, 08:17:48 pm
You can use Pin 4 for I/O as long as there is no SD card in the SD socket.
44  Using Arduino / Programming Questions / Re: Issue with serial input/output and multiple state machines. on: April 11, 2014, 09:02:52 am
Serial.parseInt() is going to loop until the next non-numeric character arrives.  This can take a significant amount of time and during that time the rest of the loop() function is not being processed.  You can fix that by using a state machine to gather digits into numbers as they arrive.
45  Using Arduino / Installation & Troubleshooting / Re: Voltage level on Serial pins on: April 11, 2014, 08:57:50 am
I am using an osciloscope.

Could you have your probe set to 10x instead of 1x?  That would cause 5V to read as 0.5V (500 mV).
Pages: 1 2 [3] 4 5 ... 539