Loading...
  Show Posts
Pages: 1 ... 52 53 [54] 55 56 ... 68
796  Using Arduino / Microcontrollers / Re: Arduino - Path to Atmel on: February 28, 2012, 11:11:35 am
Most of us probably bought an Arduino as a standalone product and some of us are into the phase where the Arduino is a development board.

I got my Arduino to see just what I might be able to do with it. I then ordered a spare, preprogrammed 328 from SparkFun (along with some other components to put one on a breadboard) and have since bought blank 328 and 2313 chips for my own creations. I developed the idea in Arduino to see if it would work and to work out the kinks.( I was playing with interrupts, found out I only needed 1 and simplified the code) I then downloaded a copy of AVRStudio4 (5 was too slow) and developed the same code in assembly. Went from 1200 bytes to less than 100 bytes in the final program.

I made a small board with 2 sockets, a 28 pin for the 328 and a 20 pin for the 2313 that plugs into my Arduino board and using Arduino0.22 I loaded the ArduinoISP and use it along with AVRDude to write the code to the 2313. Because i got 328 and not 328A chips I had to use AVRDude to load the bootloader onto my 328s.

For someone starting out I would recommend getting an Arduino UNO as a first board. After they play with it a bit they can then use anything they feel comfortable with. I can see where using an Arduino UNO in a product has advantages - if there is a problem with the board, just program another UNO and swap the whole board. Also means that if someone else has to maintain your creation behind you they will have an easier time figuring out the hardware as compared to a custom, 1-off board.
797  Using Arduino / Programming Questions / Re: 2 stepper motors running at SAME TIME - Arduino uno on: February 28, 2012, 10:52:52 am
You could try something like this - Speed might be an issue -

Dir1 and Dir2 control the direction the motor will step +1 and -1. Dir1 or Dir2 = 0 will result in no motion for that motor.
How often you call them controls the motor speed. Each time you call motor 1 or Motor 2 you will get 1 step.
You could use half stepping but that would require 8 patterns (0-7) and the necesary changes to Motor1 and Motor2


Code:
int StepCt1 = 0;
int StepCt2 = 0;
int Dir1;
int Dir2;


void Motor1(int Direction){
   StepCt1=Stepct1+Direction;
   StepCt1=StepCt1 && 3;       / StpepCt1 ranges from 0 to 3,  -1 = B11111111 so B11111111 && B00000011 = B00000011
   switch (StepCt1)
      case 0:
          digitalWrite(2, HIGH);
          digitalWrite(3, LOW);
          digitalWrite(4, LOW);
          digitalWrite(5, LOW);
          break;
      case 1:
          digitalWrite(2, LOW);
          digitalWrite(3, HIGH);
          digitalWrite(4, LOW);
          digitalWrite(5, LOW);
          break;
      case 2:
          digitalWrite(2, LOW);
          digitalWrite(3, LOW);
          digitalWrite(4, HIGH);
          digitalWrite(5, LOW);
          break;
      case 3:
          digitalWrite(2, LOW);
          digitalWrite(3, LOW);
          digitalWrite(4, LOW);
          digitalWrite(5, HIGH);
          break;
    }
}
void Motor2(int Direction){
   StepCt2=Stepct2+Direction;
   StepCt2=StepCt2 && 3;       / StpepCt1 ranges from 0 to 3,  -1 = B11111111 so B11111111 && B00000011 = B00000011
   switch (StepCt2)
      case 0:
          digitalWrite(8, HIGH);
          digitalWrite(9, LOW);
          digitalWrite(10, LOW);
          digitalWrite(11, LOW);
          break;
      case 1:
          digitalWrite(8, LOW);
          digitalWrite(9, HIGH);
          digitalWrite(10, LOW);
          digitalWrite(11, LOW);
          break;
      case 2:
          digitalWrite(8, LOW);
          digitalWrite(9, LOW);
          digitalWrite(10, HIGH);
          digitalWrite(11, LOW);
          break;
      case 3:
          digitalWrite(8, LOW);
          digitalWrite(9, LOW);
          digitalWrite(10, LOW);
          digitalWrite(11, HIGH);
          break;
    }
}
798  Using Arduino / Programming Questions / Re: PWM Questions on: February 28, 2012, 10:30:21 am
I am thinking that English is not your first language so I am not understanding exactly what you mean.

#1 - Frequency is 1 minute - is this how often you want to update the values?

#2 - Are you wanting to use the built in 500Hz PWM or are you wanting to control the on/off time yourself?

#3 - When what is less than 50%?

These questions may be perfectly clear to you because you have the whole idea in your mind or on paper, but this post is our only glimpse into your thoughts.
799  Using Arduino / Programming Questions / Re: Motor control methods help on: February 28, 2012, 10:17:45 am
Those pins probably have more descriptive names like Forward or speed1 or something. Naming them In1, In2,... looks really odd when you then use them as outputs in your Arduino sketch.

What exactly do the 4 inputs to the card do? are you just feeding the card 1 of 16 options? or do specific pins do a specific function? By putting more specific names it makes it easier to see if there is some problem with the logic.
800  Using Arduino / Project Guidance / Re: Problems integrating two signals. on: February 28, 2012, 10:10:50 am
Would this data aquisition unit be tied to a PC? It might be easier to use the Arduino to aquire the data and pass the raw data to the PC and do the data storage and number crunching there. The Arduino has a limited amount of memory to store data, whereas a PC has, by comparison, unlimited storage. VB, VC#, Python, Java all would provide the tools necesary to to process and store the data.
801  Using Arduino / Project Guidance / Re: LINE MAZE SOLVER on: February 28, 2012, 10:03:51 am
Thanks for posting that link. Hits the nail square on the head!
802  Using Arduino / Project Guidance / Re: Please Help... on: February 28, 2012, 10:02:18 am
This is an Arduino forum, you might get better help in a forum dedicated to the PIC series for your PIC. Not wanting to be a snob, but our help might not be very helpful...
803  Community / Bar Sport / Re: looking to meet people on: February 27, 2012, 11:47:43 am
Sorry dude, but you're getting a bit high on the delusional scale if you are looking to Arduino to meet girls... If you hadn't realized it, Arduino is pretty much GEEK and that lowers your chances right there. And be warned - geeks and booze is an even more fatal combination.

Sorry...
804  Community / Bar Sport / Re: Measuring voltage on: February 27, 2012, 11:41:29 am
Buy a good quality DVM and use it. I used to work as a Biomed Tech and we had a guy come by twice a year to check and calibrate our test equipment. Our Fluke meters never needed any adjustment and always passed. That is my experience. Don't try to use one with a weak battery and they perform great.
805  Using Arduino / Programming Questions / Re: digital staus pin read on: February 27, 2012, 11:08:29 am
Are those 4 inputs all related to each other, or 4 seperate events? It would look like you have 4 seperate sensors that each need to send a message?
806  Using Arduino / Project Guidance / Re: help: simple interrupt on: February 27, 2012, 10:47:00 am
How are you triggering the interrupt? The most likely reason is that you are getting multiple interrupts because of "bounce" from the switch that is triggering the interrupt. Look up using a 7414 as a debounce circuit.

Also - you only need to check for HIGH or LOW as there are no other states, and Blink just changes the state of turn from High to Low.

Loop would be clearer like this -

void loop()
{
  if (turn == LOW){
  digitalWrite(indicator_1, HIGH);
  digitalWrite(indicator_2, LOW);
  }
  else {
  digitalWrite(indicator_1, LOW);
  digitalWrite(indicator_2, HIGH);
  }
 
807  Using Arduino / Installation & Troubleshooting / Re: please help what kind of  ARDUINO BOARD I need for my slider track dolly on: February 27, 2012, 10:36:39 am
Sorry dude, this is not a design service. We all have our own lives and jobs and don't have the time to do free design work for you.
808  Development / Other Hardware Development / Re: arduino clone on: February 25, 2012, 09:02:34 pm
Just the de-coupling caps, other than that it looks good.
809  Using Arduino / General Electronics / Re: 5.5volts + 6.5volts on: February 24, 2012, 01:41:32 pm
The 5.5V battery will discharge the 6.5V battery until they are both at the same value. Don't know what currents might be involved so if anything else happens ????
810  Using Arduino / Programming Questions / Re: What does the 'F' mean please? on: February 23, 2012, 02:05:36 pm
It is there to force the string to be stored in flash rather than being placed into RAM. These chips are short on RAM so keeping anything out of RAM keeps room for the stuff that absolutely has to be in RAM.
Pages: 1 ... 52 53 [54] 55 56 ... 68