Show Posts
Pages: 1 ... 1071 1072 [1073] 1074 1075 ... 1863
16081  Using Arduino / Programming Questions / Re: Newbie Question: Make a servo turn 90 degrees and stop. on: March 17, 2012, 09:30:51 am
If you post your code, we can help you better, otherwise it looks like we'd be writing it for you, and there'd be no fun in that for you.
16082  Using Arduino / Audio / Re: Sound Generation on: March 17, 2012, 09:27:40 am
But would it be possible to make it so that the frequency (pitch) would be controlled by a potentiometer?
Yes, of course.
16083  Using Arduino / Audio / Re: Sound Generation on: March 17, 2012, 06:44:10 am
Have you looked at the Tone library?
16084  Using Arduino / Programming Questions / Re: need help with " 'WiServer' was not declared in this scope" error please on: March 17, 2012, 06:13:00 am
I can't see an object of that type declared, and neither, I suspect, can the compiler.
16085  Using Arduino / Programming Questions / Re: ADXL 345 & Adafruit SD data logger - how to merge the two together on: March 17, 2012, 06:07:44 am
, but it still does not provide me with a sensible output in the serial monitor. I
Well you just give your code a good talking-to and tell it to shape-up and start making sense.
(That's a hint for you to tell us what you consider sensible and how that differs from what you observe)
16086  Using Arduino / Project Guidance / Re: Industrial use on: March 17, 2012, 04:27:49 am
. I did a mad scientist laugh and pointed out that the Atmel328 sports a whopping 64 Byte buffer

I don't quite know how to break this to you...

Back to the original subject, no reason not to use the Arduino, but make sure you protect the inputs and outputs, and that you understand liability law.
16087  Using Arduino / Programming Questions / Re: help with "error was not declared in this scope" on: March 17, 2012, 04:11:36 am
my idea is variating the setpoint with a pot so i can see how the system behaves
But if all you return is the identity of the pin the pot is attached to, the system is going to behave the same all the time!
16088  Using Arduino / Programming Questions / Re: HELP NEEDED WITH PROXIMITY SENSOR CODE on: March 16, 2012, 06:00:19 pm
So, add some more meaningful debug.
Write a simple sketch to blink the LED, to test the LED connections.
You're the one sitting in front of the hardware.
16089  Community / Bar Sport / Re: Assembly language can cause Arrogance in some people? on: March 16, 2012, 05:37:43 pm
Mike, I think this particular bot is confusing the Turing Test with Turing Completeness.
16090  Using Arduino / Programming Questions / Re: help with "error was not declared in this scope" on: March 16, 2012, 05:10:46 pm
float getSetpoint()
   int setpointPin = A1;
   float setpoint = analogRead(setpointPin);
   return setpointPin;
Is that what you want?
Cos that's what you'll get.

float PID(error)

void actuate(output)
16091  Using Arduino / Programming Questions / Re: HELP NEEDED WITH PROXIMITY SENSOR CODE on: March 16, 2012, 04:33:24 pm
It shld turn ON/OFF when I see values on the COM port that are less than/more than 50
No,there you're putting the cart before the horse - the values seen on the COM port have very little to do with the criteria for the LED state - see the early comments above.

const int sensePin=5;                 // proximity sensor output obtained at this pin
const int ledPin1 = 4;     // LED connected to digital pin 5

void setup()

void loop()
  int a = analogRead(sensePin);
  if(a<=50)  {
     digitalWrite(ledPin1, HIGH);
  }  else {
16092  Community / Bar Sport / Re: Every so often I am stunned by a post. on: March 16, 2012, 01:30:25 pm

while( *outstr++ = *instr++);

Basically there is no reason to ever write unreadable code. 
What you have to remember is that C barely qualifies as a high-level language - it was devised as a replacement for assembler when porting an OS.
Don't mistake conciseness for illegibility - both can be features of true high level languages, like APL.

If you want to want easy to read code, write COBOL.
16093  Using Arduino / Project Guidance / Re: Measuring Pulse Width on: March 16, 2012, 11:42:13 am
Timer granularity is 4 microseconds.
Please go back to your post, click on "modify", then highlight the code, then click on the # icon on the toolbar, then click on "save"
16094  Topics / Robotics / Re: 1st engineering student in need of help?! on: March 16, 2012, 11:28:15 am
I've merged the two near identical posts.
Do NOT cross post, it simply wastes time.
16095  Using Arduino / Programming Questions / Re: IR sensor and servos on: March 15, 2012, 03:06:54 pm
but they don't turn together, they rotate in turns
That's because that is how you've written the sketch, with the movement in sequence.
Pages: 1 ... 1071 1072 [1073] 1074 1075 ... 1863