Show Posts
Pages: 1 ... 719 720 [721] 722 723 ... 1115
10801  Using Arduino / Programming Questions / Re: Bizzare Serial Problem on: February 14, 2011, 05:46:15 pm
Instead of:

while(Serial2.available())

Try:


while(Serial2.available() > 0)

Not sure you really need those long delays in your loop statement, but that's up to your comm protocol I guess.

Lefty
10802  Using Arduino / Project Guidance / Re: Are stepper motors right for this project? on: February 14, 2011, 05:35:43 pm
Well I would have you take a step back and think about what you are proposing.

 Are you are assuming that you need a stepper motor with a step resolution equal to or better then 1 degree of antenna rotation you require?

 That would be true if the stepper motor was directly coupled to the antenna rotation shaft. I don't think you will find a stepper motor large enough to handle direct rotation duty, holding torque would have to be very large to keep it from slipping cogs in high winds.

 I don't recall ever seeing an antenna rotator motor, steeper or conventional motor, that was directly coupled to a rotation axis, they always used some internal or external gearing down. So assuming you will have to have a gear reduction drive, then the step size of the stepper motor becomes less sever does it not? You just have to know how many motor steps equals one degree of output gear ratio rotation. "Let me count the ways" ( A little valentine joke)  smiley-grin

Lefty
  
10803  Using Arduino / Project Guidance / Re: Voltage/Current control via PWM? on: February 14, 2011, 05:01:27 pm
Quote
But I still would run into current problems if ohm's law holds.  What about a potentiometer?

Well you see that is the crux of the matter, Ohm's law will always win out. Assuming the 'secret external device' acts like a fixed resistance value, you can only control current by manipulating the applied voltage. Wanting to set a fixed voltage and a fixed current at the same time requires that the external resistance value be manipulated.

Now there are lab type power supplies that allow one to set a desired fixed regulated output voltage and also set a current LIMIT, not a constant current, but a current that can rise per ohm's law but will be clamped when reaching the preset maximum current value. How does it do that? By lowering the applied voltage of course, to less then the prior fixed value so that the current stays at the set limit.

So Ohm's law rules. You need to determine if what you want to do will stay within the law or not. Perhaps if you could try and restate what you are trying to accomplish it might be possible to accomplish it without going to jail.  smiley-wink

Lefty
10804  Community / Exhibition / Gallery / Re: Car reverse backing obstacle sensor with sonic ranger on: February 14, 2011, 01:07:30 am
Quote
Who's talking now lefty?


You talking to me, you talking to meeeeee ?  smiley-grin

Cool. Now work on that sound, it should be a nice soothing low frequency gentle gong gong gong, picking up tempo. Yours sounds worst then my wife's shrill warnings for me not to back up to close to something.  smiley-wink

Lefty

10805  Using Arduino / Storage / Re: How to save an integer in eeprom on: February 13, 2011, 11:24:27 pm

Maybe just some missing ; ?

Quote
void loop()
{
    // let the user adjust their settings
    // I'll put values here to simulate user selected options
    mynumber1 = 1035;
    mynumber2 = 34;
   mynumber3 = 845;
   // if they push the "Save" button, save their configuration
    if (digitalRead(13) == HIGH)
        EEPROM_writeAnything(0, configuration);

}

10806  Using Arduino / Project Guidance / Re: Cal Poly Senior Project Assistance Needed on: February 13, 2011, 11:17:21 pm
John;

 You need to learn that it's bad form to post the same posting into mulipule subforums. Pick one and stick to it, I suggest project guidance is as good as any.

Lefty
10807  Using Arduino / Project Guidance / Re: Voltage input help (possible reward for help) on: February 13, 2011, 09:50:47 pm
Quote
Do you guys think that an LM386 would work for this? It has voltage gains from 20-200 and is capable of operating on 5Vdc.


No, a LM386 is an opamp optimized to be an audio amplifier, you just need standard opamps and there are a zillion different ones to choose from and most would work fine.
10808  Using Arduino / Programming Questions / Re: Cal Poly Senior Project Help Needed!!! on: February 13, 2011, 09:45:00 pm
John;

SLO is such a cool place to hang about, you are lucky to be in such a fine area and great school.

So on with your project. Yes your servos should have their own independent regulated +5vdc power, budget one amp per servo and you should be gold. Controlling the actuator depends on what kind of signal control input it expects, and if they have internal position feedback/controller or not. A linear actuator can be either self contained just like a servo, or more primitive where you need to bolt on some feedback sensor and do it in your own code.

Anyway good luck and keep us posted, problems or not.

Lefty



10809  Using Arduino / Project Guidance / Re: destructive noise generation to cancel noise from machinery on: February 13, 2011, 09:30:38 pm
Actually the sound you hear is most likely not the air compressor but rather just the air cylinder exhausting/venting the air when commanded to close, with an internal spring supply the motive force. What some do is screw on a small 'muffler' component to the venting port of the air cylinder, it might quite it down enough for you not to mind it, but at the expense of slowing the closing action even more.

 All this electronic talk of noise cancelling is pie in the sky, too many beers to fear ideas. You can't afford it and a Arduino can't do it.

But I will still go on record that the sound that makes in your demo is the coolest part of the whole demo. Why change it?


Lefty
 
10810  Using Arduino / Sensors / Re: UNO vs. Diecimila on: February 13, 2011, 09:10:20 pm
I would triple check your wiring as you move the sensor from one board to another. Both boards use the same processor chip (328) and once running a sketch they are 100% identical. So I would state you have either a wiring difference/problem when you move from one board to the other, or a defective 328 on the Uno, can't think of any other possiblity.

Lefty
10811  Using Arduino / Programming Questions / Re: Issue with writing to serial ports on: February 13, 2011, 07:57:30 pm
Quote
I know that the next two immediately following it are the two that I'm looking for.

But you don't know that the serial hardware has actually received the next two characters and placed them into the receive buffer ready for your next two serial reads. You are making an assumption that based on timing may or may not be true. Hardware and software serial transactions on an Arduino are a byte by byte proposition. So either test that three characters are waiting (not the best method IMHO) or test for 1 or more available right before you do each serial read statement. To not heed that message is either folly or stubbornness on your part.

Lefty
10812  Using Arduino / Project Guidance / Re: Some strange behaviour on a condition statement on: February 13, 2011, 07:49:39 pm
Analog reading can and are frequently noisy. One can deal with it by external filtering (resistor/cap) or by software averaging. If you take 8 readings in a row and add them to a variable and then divide it by 8 you will get a smoother value. Just be sure to zero out the average before doing the next set of 8 reads.

Lefty
10813  Using Arduino / Project Guidance / Re: destructive noise generation to cancel noise from machinery on: February 13, 2011, 07:32:14 pm
Dude, that sounds is actually the coolest part of the project. Don't you dare try and eliminate it.  smiley-grin

EDIT: So say I was passed out drunk and sleeping it off behind your door (just sayin), would it kill me?

Lefty
10814  Development / Suggestions for the Arduino Project / Re: sample code in reference does not compile ( IDE 022) on: February 13, 2011, 07:24:17 pm
Looks like a typro/error in the reference, missing () after loop.

Quote
Here is the code that does not compile:

void setup(){
  Serial.begin(9600);
}

void loop(){
  int i = 2;
  int j = 3;
  int k;

  k = myMultiplyFunction(i, j); // k now contains 6
  Serial.println(k);
  delay(500);
}

int myMultiplyFunction(int x, int y){
  int result;
  result = x * y;
  return result;
}
10815  Using Arduino / Programming Questions / Re: Code issue with PING Sensor and while loop on: February 13, 2011, 07:09:20 pm
So,
Code:
inches = microsecondstoInches(duration);
should go inside of the while loop?


To obtain a new updated distance value inside your while statement you need to do both:

Code:
duration = pulseIn(pingPin, HIGH);
inches = microsecondstoInches(duration);

Lefty
Pages: 1 ... 719 720 [721] 722 723 ... 1115