Show Posts
Pages: 1 ... 65 66 [67] 68 69 ... 73
991  Using Arduino / Programming Questions / Re: using struct command on: January 31, 2012, 02:32:32 pm
A struct is a way of grouping several variables together under a common name. The variables in the struct do not have to be the same type.

A common example (outside of the Arduino IDE) was  an address record or struct(ure) you hade name, address, zip, soc.sec.no, and other realted data all stuck in 1 struct because of their relationship.

so - you have created a struct with values for the 3 colors at that point -
struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
this is desctibing a record with the values for R, G ,& B

You then describe another struct using the same name (probably adds to the confusion) that is an array of the previous struct

I would have thought you would have done this -
struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
 and use it as a new type , and then define an array -
CRGB leds[60];

and you would address them as leds[1].r, leds[1].g and leds[1].b

You are calling a function -     
strip.setPixelColor((m - 1), 0, 0, 0);
which probably has something like this -
strip.setpixel (int index, unsigned char red; unsigned char green; unsigned char blue)
 and has code something like this -
   leds[index].r=red;
   leds[index].g=green;
   leds[index].b=blue;
...
but this allows you to work with a "variable"  called leds[] that contains multiple values, but to be handled as one chunk.
992  Development / Other Software Development / Re: Simulator for Arduino on: January 30, 2012, 05:32:29 pm
Does it allow you to simulate external interrupts?
993  Development / Other Software Development / Re: My newest development in interfacing arduino with input hardware on: January 30, 2012, 05:29:26 pm
Quote
Are there any more grey codes?
There will be, I haven't looked at them for years but IIRC there are versions with a lot more codes than you have there, a grey code after all is just a code where only a single bit changes for every new value.

Grey codes are normally used for absolute encoders I thought, a relative encoder should have no need for such things.

______
Rob

No - Gray codes are used for relative encoders, Allows you to get your information in 2 bits and keep track of position in software. Absolute encoders have either a whole bunch of wires or use some serial/parallel protocol to give position.

I have seen 2, 3, & 4 bit grey codes. 2 bit is most common, with a Z bit thrown in that goes true for exactly one sequence of the code in every revolution of the shaft.
994  Development / Other Software Development / Re: Visual Micro - Arduino for Visual Studio on: January 30, 2012, 05:24:02 pm
Only 1 slight problem... If you don't have the latest and greatest in computers, then Visual Studio 2010 takes all day to get anything done. It is another piece of Microsoft bloatware.(for the record - I am a VB6 and Visual Studio 2000 user) I tried running VS 2010, and AVR Studio 5 and found them both to be agonizingly slow. Visual Studio 2008 isn't much better.
995  Using Arduino / Motors, Mechanics, and Power / Re: Current limiting circuitry for servos on: January 30, 2012, 05:09:01 pm
Your power supply should have a + voltage and a Common or ground. Ground from your servo power supply should be connected to Arduino Ground. Servos don't need current limiting resitors.

If you don't supply the servos from both sides of the supply they won't work...
996  Using Arduino / Motors, Mechanics, and Power / Re: What kind of motor is this? on: January 30, 2012, 05:05:27 pm
It is actually a five wire stepper motor that can be wire Unipolar or Bipolar.
BiPolar works if you have an H-Bridge driver to connect to the motor.

It will also work if you have 4 transistors, the transistor's collectors to ABC&D, Base to Arduino pins, and emitters to ground,  and the power supply to O on the motor, then sequence a, b, c, d for simple stepping, A, AB, B,BC,C,CD,D,DA, etc for 1/2 stepping.
997  Using Arduino / General Electronics / Re: Kickback Diode On Motor - question on: January 30, 2012, 11:14:42 am

I don't think so. The diode connected across the transistor is the wrong way round to conduct reverse voltage from the coil when the current through it is interrupted, unless it is a Zener diode.

However, in an H-bridge with diodes across all the transistors (or the body diodes of mosfets), you're right, those diodes contain the back EMF by feeding it into the power supply.

The diodes are doing the same job in either position. the diode across the transistor is there specifically to protect the transistor from reverse transients from switching off an inductive load. The Diode across the motor would short the voltage spikes through just the motor and would stress other elements of the circuit less. The capacitor would be a good addition for either a motor or a coil, just make sure it has a high enough voltage rating for the spike.
998  Using Arduino / Motors, Mechanics, and Power / Re: Motor causing Arduino to Brownout on: January 26, 2012, 06:24:17 pm
First thing would to be use a bigger power supply. When starting a motor, the initial instantaneous current can be a lot higher than the 500ma you are quoting. You could, depending on the motor size and load pull much higher currents and thus are dropping below 6-7 volts and the regulator shuts off the arduino.
999  Using Arduino / Microcontrollers / Re: ISP! on: January 26, 2012, 06:04:52 pm
If you are using the Arduino-1.0 IDE to load the ArduinoISP sketch you will have a problem.

Geta copy of Arduino-0.22 and load the ArduinoISP sketch and then the Arduino board will work just fine.

If you are using AVRDude to transfer a HEX file, the Arduino-0.22 sketch will run at -b 19200, the Arduino-1.0 sketch will run at -b 9600. If you are not running AVRDude directly this won't mean a thing to you.
1000  Using Arduino / Microcontrollers / Re: ####ing attiny85 on arduino... on: January 26, 2012, 05:58:23 pm
Arduino 1.0, as I understand it, made a change in the serial library that sort of crashed ArduinoISP when loaded from 1.0. It will work at 9600 (if you change the serial setup in the sketch) when using AVRDude from the command line, the 22 version will work at 19200 AND will tranfer from 1.0 using the transfer using ISP option.
1001  Using Arduino / General Electronics / Re: current maximums on the output pins on: January 26, 2012, 05:49:33 pm
Download a copy of the datasheet (if you haven't already) and look at the pin descriptions. They will have as part of the naming - PB0, PB1,PB2..., PC0, PC1,PC2..., PD0, PD1, PD2, PD3... and such. these are the port groupings. Then map those groupings to you setup and to that chart and you should have a pretty good idea whether you are pushing the current limits.

Page 2 of the datasheet shows the pinouts and names them all.

And here is the datasheet.
http://www.atmel.com/dyn/resources/prod_documents/2549S.pdf
1002  Using Arduino / General Electronics / Re: Critique my circuit: Poor man's UPS on: January 26, 2012, 05:40:04 pm
Why not use some recharge-ables and leave them in the circuit all the time. At least then you won't have the system failing because someone forgot to change the batteries. Then you power supply just has to be regulated to the proper voltage for the batteries. NiCads peak out at approx 1.25 V/cell and run through a good part of their discharge cycle approx 1.2 V/cell so you coud regulate to 5V and supply that 5V after the regulator, straight to the arduino and the batteries.
1003  Using Arduino / General Electronics / Re: Relay activating without signal on: January 26, 2012, 05:21:46 pm
Do you have any capacitor after the 5V regulator? You are getting some noise and it might well be the current in the circuit when you release on of the other relays is causing the radio relay to trigger. As it only requires a pulse, that might just be where the noise shows up, the others require an physical action and they may not have a long enough pulse for you to hear the siren or see the flash. Relays are noisy devices and you will probably need a capacitor to take care of that noise.

A good place to  start would be a 10 micro farad, 25 V electrolytic on the input and output of the regulator.
1004  Using Arduino / General Electronics / Re: magnetic door stop on: January 26, 2012, 05:14:21 pm
Those adapters often have a capacitor across the output pins to filter some of the ripple in the DC that is left after rectifying the AC. A capacitor with hold a charge for a bit of time after the unit is unplugged from the wall if it has nothing attached to the load side.

Now you have some more things to study - capacitors and rectifiers. Keep this up and you will have the stuff I paid good money to learn in my first semester when I was in college.

Don't feel too bad about being snowed under by all the terminology, you can look on wikipedia and other places on the web and you should be able to learn what all this means. Not knowing your background, but it shouldn't take too long if you want to learn it.

And don't feel too bad, some of the old timers manage to mess it up and have to go back to class to remember some of this fundamental stuff that makes up the basics for all these electrical toys we play with.

 
1005  Using Arduino / General Electronics / Re: Connecting multiple things to the 5V pin. on: January 25, 2012, 01:45:21 pm
Depending on the value of the potentiometer it will have minimal effect on the circuit. 5V and 1k doesn't make for much current, and a larger value pot will draw even less current - you are using the pot more as a voltage sense than for current anyway...

The seven segment display will be more of a source of current draw. Though you will have to limit the current (to limit the voltage across the segments) with a resistor going to each Arduino pin.

I have a little shield that I made to play with analog and LEDs that has 2 pots and 7 LEDs that all work at the same time from the same 5 V on the Arduino. As long as you don't try to run too much current through any pin and you are drawing less current than the 5V pin can supply you should be fine.
Pages: 1 ... 65 66 [67] 68 69 ... 73