Show Posts
Pages: 1 ... 285 286 [287] 288 289 ... 581
4291  Using Arduino / Project Guidance / Re: suggestions for programming structure and storing of animatronic sequences on: September 16, 2012, 10:38:53 am
Assuming that your cues are compile-time constants you will have much more room to work with if you keep the cues in FLASH (PROGMEM) than if you use RAM.  The ATmega328 has 32k of FLASH but only 2k of SRAM.

Figure out what units of measure you want to use and the ranges of values.  Then you can minimize the data sizes. Remember that if you usuall need less than 255 steps you can use one byte for the number of steps and chain two motions together to get one longer motion.

4292  Using Arduino / Programming Questions / Re: Memory heap on: September 16, 2012, 10:26:13 am
Many times Out of SRAM conditions are caused by string constants used for Serial output.  You can avoid having those constants take up SRAM space by using the F() macro:
Seeial.print(F("This string constant stays in FLASH memory rather than being copied to SRAM."));
4293  Using Arduino / Programming Questions / Re: Blinking LEd controlled by servo state on: September 16, 2012, 10:19:59 am
How long do you expect the travel to take from 0 to 90 degrees?
4294  Using Arduino / Sensors / Re: How to use RAZOR 9DoF AHRS for positioning on: September 16, 2012, 08:52:15 am
You can only use an inertial navigation system to measure changes in position.  For each time interval, determine the orientation and acceleration to get the 3D velocity vector. Integrate that vector over time to get position.
4295  Using Arduino / LEDs and Multiplexing / Re: 10 RGB leds - all doing the same on: September 16, 2012, 08:43:03 am
3. just out of curiosity, insted of putting a resistor in every led, can't i put "high" resistor at the emmiter of each NPN? i mean between GND and Collector&Base "junction".

No, you can't.  Ten LEDs draw ten times the current of one LED but if you put 10 LEDs in parallel and feed them ten times the current there is no way to make them share the current equally.  Some devices will hog the current, overheat, and die.
4296  Using Arduino / LEDs and Multiplexing / Re: 10 RGB leds - all doing the same on: September 15, 2012, 07:32:54 pm
> 1. is that mean that i need 30 NPN transistors...?  smiley-eek

No, you need one transistor per GROUP of cathodes.  Since you have three groups of cathodes (reds, greens, and blues) you need three transistors, like in the LED strip example you found.  Each cathode will need a current limiting resistor.  That is EACH cathode so you will need 30 resistors.
4297  Using Arduino / Programming Questions / Re: Need some help converting from basic to c on: September 15, 2012, 03:27:01 pm
You need to figure out what TXSTA.0 does and how to do that on an ATmega processor.  Looks like a processor register to me.

If you don't care what it does:
unsigned int TXSTA;
TXSTA |= 0x0200;  // Set bit 9
TXSTA &= ~ 0x0200;  // Clear bit 9
4298  Using Arduino / Programming Questions / Re: Controlling 2 DC motors at once on: September 15, 2012, 02:39:29 pm
Looks like your Sholder function never returns. smiley-sad

What I would do:

Global variables for the desired position of each of the motors.

In loop(), check each of the motors to see if it need to move.  For each that needs to move, set it going in the desired direction.

For best motion you should be using a PID control loop for each motor.  This will run the motor fast if it is far from the desired position and slow if it is near the desired position.
4299  Using Arduino / Motors, Mechanics, and Power / Re: Powering and controlling a relay from an Arduino Ethernet with PoE on: September 15, 2012, 02:29:42 pm
Can't you just use a single PNP transistor to switch 5V from the Arduino regulator?
4300  Using Arduino / Installation & Troubleshooting / Re: .hex file path on: September 13, 2012, 05:03:46 pm
Thats a good one but Windows only it seems

Works for me on Mac:
4301  Using Arduino / Project Guidance / Re: Onewire Dallastemperature low and high alarm separate on: September 13, 2012, 04:51:28 pm
It looks like there is only one alarm flag per device.  To determine if the alarm is a HIGH alarm or a LOW alarm you have to read the current temperature and compare it to the two alarm temperatures.  Something like this:

if (sensors.hasAlarm(deviceAddress)) {
    float tempC = sensors.getTempC(deviceAddress);
    if (tempC != DEVICE_DISCONNECTED) {
        if (tempC >= sensors.getHighAlarmTemp(deviceAddress)) {
            // HIGH alarm
        if (tempC <= sensors.getLowAlarmTemp(deviceAddress)) {
            // LOW alarm
4302  Using Arduino / Project Guidance / Re: Onewire Dallastemperature low and high alarm separate on: September 13, 2012, 03:11:27 pm
I'd love to help but I can't find any good documentation for the DallasTemperature library.  Apparently you are supposed to buy the book Beginning Arduino to learn how to use the library.
4303  Using Arduino / Motors, Mechanics, and Power / Re: PID Library MISHAP! on: September 13, 2012, 02:29:38 pm
If Output is negative you have to turn the motor in the other direction.
4304  Development / Suggestions for the Arduino Project / Re: including custom libraries (Mac OS X)? on: September 13, 2012, 02:23:54 pm
Local libraries are put in ~username/Arduino/libraries/LibraryName

4305  Using Arduino / LEDs and Multiplexing / Re: The CD74HC4067 multiplexer, arduino and Pd on: September 13, 2012, 02:21:10 pm
The output of analogRead() is 10 bits (0-1023).  When you store that in a byte as you did in the first sketch it throws away the top 2 bits so instead of 0-1023 you get 0-255,0-255,0-255,0-255.

Either store the value in int (if you want the full range) or divide the value by 4 before you store it in a byte.

unsigned int muxarray[16];

//  OR

byte muxarray[16];
    muxarray[i] = analogRead(0) / 4;
Pages: 1 ... 285 286 [287] 288 289 ... 581