Show Posts
Pages: 1 [2] 3 4 ... 539
16  Using Arduino / Sensors / Re: Problems with Ultrasonic Range Finder - Maxbotix LV-EZ1 on: April 14, 2014, 04:26:57 pm
Quote
A lot like the code for one pin but done three times to control three different pins.

Does it matter that I am controlling 3 analog pins (0, 3 and 5) with pin 11?

Yes.  It does matter.
17  Topics / Science and Measurement / Re: Maximum Digital Sample Rate possible (3 digital inputs)? on: April 14, 2014, 04:20:52 pm
Oops. I had forgotten to put in the line "    oldPins = pins; //  Look for further changes".  Corrected above.
18  Using Arduino / Programming Questions / Re: Negative pulse generator with Arduino ???? on: April 13, 2014, 08:48:30 pm
You can certainly output low-going pulses (5V -> 0V -> 5V) at about 1 kHz but you will need some external pulse shaping to get that funky shape.  A capacitor can be used to round off the leading edge.  A resistor will set how long it takes to reach zero.  A diode will get the value back up to 5V quickly.
19  Using Arduino / General Electronics / Re: what is it in the file arduino-mega2560_R3-reference-design.zip. on: April 13, 2014, 08:43:40 pm
The SCH and BRD file are for Eagle. Get the freeware version of Eagle here:
 https://www.cadsoftusa.com/download-eagle/freeware/
20  Using Arduino / Sensors / Re: Problems with Ultrasonic Range Finder - Maxbotix LV-EZ1 on: April 13, 2014, 08:34:50 pm
Quote
It is possible that you will need to control the three RX pins separately.

What would the code look like for that?

A lot like the code for one pin but done three times to control three different pins.
21  Using Arduino / Installation & Troubleshooting / Re: avrdude: stk500_recv(): programmer is not responding on: April 13, 2014, 08:32:59 pm
I've looked at the board and I can't find anywhere on the board where the RXI is even close to VCC?
What about that surface-mount device next to the words "Pro mini"?  it has RXI connected to one end and VCC connected to the other.  Perhaps it is shorted?
22  Topics / E-Textiles and Craft / Re: Detecting Vigorous Motion on: April 13, 2014, 08:18:03 pm
Can you provide any specifics on how to implement this concept - a link to a tutorial, blog post or something similar would be much appreciated. Also, is there a specific name for this kind of switch?

Shock/Impact/Vibration switch
https://www.google.com/patents/US6545235

You can buy 100 of them for $18.99:
http://www.aliexpress.com/item/Free-Shipping-100pcs-lot-SW-58020P-Vibration-Switch-Closed-Leg-SW-58020P-Vibration-Spring-Switch-Shock/1251566328.html

Or 10 for $5.10:
http://www.aliexpress.com/item/Free-Shipping-10pcs-SW-18015P-18015P-Non-direction-Spring-Sensor-Switch-Vibration-Sensor-Switch-Shake/744989644.html
23  Using Arduino / Project Guidance / Re: 6v 300mA water pump activated by PIR using Arduino Board - 6v issues on: April 13, 2014, 04:21:42 pm
You can't control the Vin pin.
24  Using Arduino / Installation & Troubleshooting / Re: avrdude: stk500_recv(): programmer is not responding on: April 13, 2014, 04:19:06 pm
RXI should definitely not be shorted to VCC.  Examine both traces under magnification to see if you can find the short.
25  Using Arduino / Sensors / Re: Problems with Ultrasonic Range Finder - Maxbotix LV-EZ1 on: April 13, 2014, 04:15:51 pm
Quote
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.

Ok, I finally get the 8-bit I/O ports but how can I control 3 analog pins (0, 3 and 5) using a digital pin such as pin 11?

It is possible that you will need to control the three RX pins separately.
26  Using Arduino / LEDs and Multiplexing / Re: Problem cascading TLC5917 shift registers using ShiftPWM. on: April 13, 2014, 04:12:30 pm
No, I jumped pins 2 & 14 (SDI & SDO) on the first register, just to verify that the circuit of the second IC was operational. Which it was, even though it was then operating as the first register.

Oops.  My mistake.  I was looking at the schematic for the project you pointed to which uses 74595 shift registers.  I think the way you had it was right.  Have you tried swapping the two registers to make sure both act the same in either location?  If so it sounds like the second socket isn't getting one of the signals: MOSI, CLK, or SS.
27  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"? 
28  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.
29  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.
30  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.

Code:
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).
Pages: 1 [2] 3 4 ... 539