Loading...
  Show Posts
Pages: 1 ... 1071 1072 [1073] 1074 1075 ... 1321
16081  Forum 2005-2010 (read only) / Syntax & Programs / Re: Counter back to zero upon closing serial monitor on: October 06, 2010, 11:47:30 am
Disable the Arduino's autoreset feature.
http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection
16082  Forum 2005-2010 (read only) / Syntax & Programs / Re: pitch and roll from 3-axis accelerometer on: September 26, 2010, 09:47:30 am
Quote
You wait 32 microseconds for all the data to arrive
Not even close
16083  Forum 2005-2010 (read only) / Syntax & Programs / Re: pitch and roll from 3-axis accelerometer on: September 26, 2010, 09:13:45 am
No mystery, but not recommended.
It causes a delay of 32 milliseconds (and therefore limits your update rate to about 30Hz).
In those 32 milliseconds, you could have transmitted over 350 characters at 115200 bits per second
16084  Forum 2005-2010 (read only) / Syntax & Programs / Re: pitch and roll from 3-axis accelerometer on: September 26, 2010, 08:45:44 am
Code:
if(Serial.available() > 0)
  {
    delay(sizeof(data));
    for(int i = 0; i < sizeof(data); i++)data[i] = (Serial.read() % 0xff);

A delay based on the size of an array?
What happens when you change the bit rate?
Why not eliminate the delay and read data when it is actually there?
16085  Forum 2005-2010 (read only) / Syntax & Programs / Re: Picking the biggest of three values on: October 06, 2010, 08:31:32 am
Quote
If you need the max function use it instead of ternary without any penalty
Except that it's a macro, not a function, and as such, may not be penalty-free.
16086  Forum 2005-2010 (read only) / Syntax & Programs / Re: ptz ip camera with j2me on: October 06, 2010, 03:40:59 am
You're allowed to delete your own duplicate posts.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286353200
Just click the "remove" label, up there on the right.
16087  Forum 2005-2010 (read only) / Syntax & Programs / Re: another simple PSTR question: unsigned long format on: September 17, 2009, 01:27:15 pm
Quote
Oh - while I am here, I was trying to pass a length param (Xindex) to only read the num chars that had been stored from the most recent input and so be able to reuse the buffer without initializing it again. Couldn't figure out how to do that - but writing a 0 into the buffer with this line
That's because sscanf expects a 'C' string, which is an array of chars, where the last character is a zero, sometimes represented '\0'.
The compiler automatically includes such a character for strings declared in the program, (e.g. "%u" actually consists of three chars '%' 'u' and '\0'), but for input strings, you got to put your own on (unless handled by libraries or interface functions).
16088  Forum 2005-2010 (read only) / Syntax & Programs / Re:  extern NewSoftSerial lcdSerial <- whats wrong ? on: October 05, 2010, 10:05:14 am
extern NewSoftSerial lcdSerial[glow](what?)[/glow];
16089  Forum 2005-2010 (read only) / Syntax & Programs / Re: Playing sound from the computer. on: October 05, 2010, 04:43:48 am
This sentence:
Quote
I have used processing before however am having trouble using the syntax associated with the arduino.
leads me to suspect that you are confusing the languages and the IDE.
C syntax is not the same as Java syntax.

Processing, which is based on Java, has nothing to do with Wiring, which is based on C and C++.

The Arduino is "inspired" by Processing, but compiling Processing code in the Arduino IDE will produce the sort of errors you reported.

Quote
but its my understanding that the platform was based on processing
No, the IDE is.
16090  Forum 2005-2010 (read only) / Syntax & Programs / Re: Need help in my project... on: October 03, 2010, 03:26:30 pm
If you insist on using "delay", you could do it like this:
Code:
digitalWrite(13, HIGH);
 delay(10);            
 digitalWrite(13, LOW);  
 delay(map (analogRead (potPin), 0, 1023, 1, 1000)));

Still don't see where the sawtooth comes from.
16091  Forum 2005-2010 (read only) / Syntax & Programs / Re: Need help in my project... on: October 03, 2010, 11:47:40 am
analogWrite (13, map (analogRead (potPin), 0, 1023, 0, 255));

Will allow you to dim the LED with the pot.

Quote
I do not actually need a SAWTOOTH PULSE

Quote
But now I want it to blink close to like a SAWTOOTH PULSE..

Which?
16092  Forum 2005-2010 (read only) / Syntax & Programs / Re: Need help in my project... on: October 03, 2010, 11:08:06 am
Have a look at "analogWrite", but remember that it only works on certain pins.
http://arduino.cc/en/Reference/AnalogWrite
16093  Forum 2005-2010 (read only) / Syntax & Programs / Re: Need help in my project... on: October 03, 2010, 10:16:11 am
Quote
I am new to arduino...
So cannot make out how to write...

Yet you wrote sketch to display the pot's mapped value on an LCD?

As Korman said, work through some examples, come to us when you are stuck, but don't expect us to write stuff for you.
16094  Forum 2005-2010 (read only) / Syntax & Programs / Re: Accelerometer data on: October 03, 2010, 03:14:46 pm
[glow]L[/glow]ong

http://arduino.cc/en/Reference/IntegerConstants
16095  Forum 2005-2010 (read only) / Syntax & Programs / Re: Accelerometer data on: October 03, 2010, 03:00:20 pm
Code:
val =(x * 1000000[glow]L[/glow]) + (y * 1000[glow]L[/glow]) + z;
Pages: 1 ... 1071 1072 [1073] 1074 1075 ... 1321