Show Posts
Pages: 1 ... 380 381 [382] 383 384 ... 539
5716  Using Arduino / Project Guidance / Re: Using ATMega328 on breadboard on: January 27, 2012, 11:43:51 am
As long as the +2.5 and -2.5 rails have a common Ground and you DO NOT CONNECT THAT GROUND TO ANYTHING CONNECTED TO THE ATmega you can use the -2.5 rail as Ground and the +2.5 rail as +5.
5717  Using Arduino / Project Guidance / Re: Read recorded sensor data sequentially from CSV on: January 27, 2012, 11:40:19 am
is there a way to do this so that it reads the data at the same speed etc as it was recorded?

Depends on what speed the data was written.

Hopefully it was written at a fixed rate that is reasonably slow, like less than 100 per second.

Use the "Blink without delay" example to see how you schedule thing to happen at regular time intervals.

In loop():
    if you have a parsed value ready:
        if it's time to send the next value:
            set the value to 0
            mark the value as 'not ready'
         if there is a character available in the file:
             read the character
              if the character is a comma:
                    mark the value as available
              if the character is a digit:
                  multiply the value by 10 and add character - '0'
    end of loop()
5718  Using Arduino / Installation & Troubleshooting / Re: arduino bootloader on: January 27, 2012, 11:26:57 am
Try turning on "verbose output during upload" in Preferences.  That might give more information.  It should allow you to see what value came back from the chip.  Is it possible you got a 328 instead of a 328P?
5719  Using Arduino / Project Guidance / Re: Streaming Serial Data into Arduino on: January 27, 2012, 10:41:54 am
First thing I would suggest is to only send data when it changes.  That way you get better responsiveness because you don't have to wait for data that isn't needed.

Second thing is to send binary rather than text so it doesn't have to be converted back.

If each data byte contains address information then you don't need to provide framing.

You have 43 bits you want to send:  4*8 for joysticks and 11 for buttons.  You can break those into blocks of 4 bits and use the other 4 bits in the byte to specify which block of data:

0X: Joystick axis 1 High Four Bits
1X: Joystick axis 1 Low Four Bits
2X: Joystick axis 2 High Four Bits
3X: Joystick axis 2 Low Four Bits
4X: Joystick axis 3 High Four Bits
5X: Joystick axis 3 Low Four Bits
6X: Joystick axis 4 High Four Bits
7X: Joystick axis 4 Low Four Bits
8X: Buttons 0-3
9X: Buttons 4-7
AX: Buttons 8-11
BX: Spare
CX: Spare
DX: Spare
EX: Spare
FX: Spare

As each byte arrives the Arduino places the low four bits in the correct location based on the high four bits and then calls whatever function handles that data item.

One problem is that sending a joystick axis as two parts might cause glitches as the joystick moves since it might be acting on the left half of a new value combined with the right half of the old value.  Fix this by having the sending program always send the low half if the high half changes and have the Arduino only act when the low half arrives.  Small changes that only change the low half will remain efficient and large changes are likely to change both halves anyway so little efficiency is lost by sending both.

If the data might get lost along the way you can have the sending program send out the un-changed values periodically.  Say one joystick value or set of 4 buttons every tenth of a second or so.  That would help assure that both sides have the same current values.
5720  Using Arduino / Programming Questions / Re: SPI specs on: January 27, 2012, 10:00:32 am
In the IDE select Reference from the Help menu.

At the top of the Reference page, click on the Libraries link.

On the Libraries page, click on the SPI link.
5721  Using Arduino / Installation & Troubleshooting / Re: Problem uploading - stk500_getsync(): not in sync: resp=0xe0 on: January 27, 2012, 09:58:33 am
Is it possible that someone burned an optiboot (UNO) bootloader on your chips?  Try selecting the Arduino UNO board to see if that works.
5722  Using Arduino / General Electronics / Re: Rotary Encoder Tutorial port to Arduino Uno on: January 26, 2012, 11:41:43 pm
5723  Using Arduino / Programming Questions / Re: Akting a motor and a relais simultaniously on: January 26, 2012, 11:19:52 pm
If you want to minimize changes you could split the long delays into several smaller delays.

For example if you wanted to have the valve open for 2 second starting half a second after the motor starts down:

    digitalWrite(dirPin,directionMovementR);  // Motor direction down
    analogWrite(pwmPin,powerOnR);  // Motor start

    delay(500);  // Run motor for 1/2 second before opening valve

    digitalWrite(6,HIGH);  // Valve open
    delay(2000);  // For two seconds
    digitalWrite(6,LOW);  // and then closed

    delay(durationMovementR - 2500);  // The rest of the motor down time
    analogWrite(pwmPin,powerOff); // Stop the motor
5724  Using Arduino / LEDs and Multiplexing / Re: Control red-green led (inverted?) on: January 26, 2012, 11:11:32 pm
If you have a "Common Anode" style of LED cluster, connect the common anode to +5.  Then connect the separate cathodes to I/O pins through the same size resistor you would use if the LED was connected to Ground.  Then when the pin is HIGH, no power will flow (both ends of the LED are at +5V).  When the pin is LOW the LED will light up (power will flow from +5V through the LED and resistor to the LOW I/O pin.

If you use PWM outputs, 0 will be full on and 255 will be full off.  Exactly the inverse of a Common Cathode cluster.

No, you can't use a single resistor on the common pin.  Each LED needs a separate current limiting resistor.
5725  Using Arduino / General Electronics / Re: SPI Programmer and how to isolate from ATtiny..... on: January 26, 2012, 06:31:52 pm
Have you tried just setting the programming outputs from the UNO to inputs?  That should prevent them from interfering with the operation of the ATtiny.
5726  Using Arduino / General Electronics / Re: SPI Programmer and how to isolate from ATtiny..... on: January 26, 2012, 04:37:09 pm
Typically you would put an ICSP header on the board to be programmed.  Plug in the programmer to program.  Unplug it to run your program.

An alternative, if you are using a DIP processor, is to unplug it from your board and plug it into a socket/board set up for programming.
5727  General Category / General Discussion / Re: coin validator programming (ie cctalk) on: January 26, 2012, 03:57:55 pm
SR5 Serial Protocol Manual:

Generic cctalk protocol manual:

I think you want the "Teach Mode Control" command (202).  You will want 8 or more samples of the coin to be programmed.
5728  Using Arduino / Installation & Troubleshooting / Re: Problem with the upload on: January 26, 2012, 02:28:37 pm
Perhaps the firmware for the USB-to-Serial processor has gotten corrupted and needs re-writing:
5729  Using Arduino / Networking, Protocols, and Devices / Re: HMC6352 Suggestions on: January 26, 2012, 02:14:28 pm

Connecting to Arduino is just about as easy.  The I2C pins on the Arduino are A4 and A5.
5730  Using Arduino / Project Guidance / Re: SPI Servo PWM IC on: January 26, 2012, 02:09:20 pm
You want one control chip per servo motor?  Won't SPI use a lot of pins since each chip would need it's own SS line.  Perhaps you should look into TWI/I2C.

In either case the ATtiny 25/45/85 family of 8-pin microprocessors could do the work.
Pages: 1 ... 380 381 [382] 383 384 ... 539