Show Posts
Pages: 1 ... 2148 2149 [2150] 2151 2152 ... 3290
32236  Using Arduino / Programming Questions / Re: Multiple instances of NewSoftSerial and the need for simultaneous reads on: December 21, 2011, 02:10:42 pm
Quote
It would seem the only way to achieve this is to use the Mega as that has multiple RX/TX pins - is that right?
Yes, it is. NewSoftSerial is great for a lot of things, but for simultaneous, multiple serial device access, you really need hardware.

Quote
But I was really hoping to stick to one Arduino device (and that ultimately being the Pro Mini upon final production for power and space reasons).
There are other devices that have multiple (not 4, but more than 1) hardware serial ports. Ask Crossroads for details.
32237  Using Arduino / Programming Questions / Re: Using Math.h on: December 21, 2011, 01:59:05 pm
The math.h file already exists. Just include it. Don't worry about where it is. The compiler knows.
32238  Using Arduino / Programming Questions / Re: Reading serial data and echoing it on: December 21, 2011, 01:58:05 pm
Quote
but is there a more elegant way I wonder?
Sure. Create a boolean variable. Set it false when serial data arrives. Set it true when the Idle message is printed. Only print the idle message when the variable is true.

Code:
bool isIdle = true;

void loop()
{
  while(Serial.available() > 0)
  {
     isIdle = false;
     // Leave the rest of the code here
  }

  if(millis() - showedNumber > showTime && !isIdle)
  {
     lcd.clear();
     lcd.print("Idle.");
     isIdle = true;
  }
}
32239  Using Arduino / Programming Questions / Re: Problem using Time.h library on: December 21, 2011, 11:56:35 am
There is a Processing sketch that you can run, that the Arduino can communicate with to get the time on the PC, in seconds since 1/1/1970.

Quote
And it has to be synced with the same time() output of any other device.
Not even close to realistic, unless you get the time from that device.
32240  Using Arduino / Programming Questions / Re: Using the wave shield with the ethernet shield? on: December 21, 2011, 10:54:51 am
The ethernet shield uses pin 10 as the chip select pin. You'll need to move that wire to a different pin on the Wave shield.
32241  Using Arduino / Programming Questions / Re: void value not ignored as it ought to be on: December 21, 2011, 10:48:57 am
Code:
  timer.setTimeout(1,goLed1);
  timer.setTimeout(1,goLed2);
Once per millisecond, you want to call goLed1 and goLed2.

Code:
void goLed1(){
 int j;
 for(j=0;j<=255;j++){
   analogWrite(6,j);
   delay(5);
 }
 delay(200); 
  for(j=255;j>=0;j--){
    analogWrite(6,j);
    delay(5);
  }
}
This code will take more than 3000 milliseconds to execute. How can you expect to call it once per millisecond?
32242  Using Arduino / Programming Questions / Re: Problem using Time.h library on: December 21, 2011, 10:15:42 am
You need to set the time, somewhere. The Arduino doesn't have a clock. It only knows how long it has been running.
32243  Using Arduino / Project Guidance / Re: Arduino + 2 Servos + External Power on: December 21, 2011, 09:04:49 am
External power supplies are generally NOT rated in amp-hours. Batteries are. One generally expects a wall-wart to be able to supply the rated current forever, not for some number of hours.
32244  Using Arduino / Networking, Protocols, and Devices / Re: UDP send/receive problems... on: December 21, 2011, 08:33:11 am
Quote
I would like to send float() to a PC program
You want to send a function to a PC? You'll need a different name for the function, since float is a reserved keyword.

Quote
when I
try to convert data to string i get this errors

float tmp102temp = 22.34;
char ReplyBuffer[] = {tmp102temp};
I'm not surprised that you get errors. You are trying to stuff a 4-byte float into an 1 byte character.
32245  Using Arduino / Programming Questions / Re: How to use Print function on: December 21, 2011, 08:26:19 am
Quote
But I always can change that later on when I am some further with my library
Now, when there is a small amount of code, or later when there is more. I know when I'd start using better names.

Code:
int declength = sizeof(arrayc);
The arrayc variable (dumb name) is an int. All ints are 2 bytes. That's what sizeof() is telling you.

Code:
char value2[declength];
itoa(arrayc,value2,10);
So, you are reserving space for one character and the trailing NULL.

Quote
since I might be able to use sizeof(); to determine the length of the variable
No, you can't.

An int can hold a value between -32768 and +32767. If you can't figure out the size of an array necessary to hold the string representation of an int from that information, we can't really help you anymore.
32246  Using Arduino / Project Guidance / Re: led drum lights on: December 21, 2011, 07:37:15 am
Quote
How would i increment the array pointer +\- 1 one time per event ?
What array pointer?

How do you define an event?
32247  Using Arduino / Interfacing w/ Software on the Computer / Re: INTERFACING ARDUINO WITH FLASH on: December 21, 2011, 07:08:31 am
Quote
now i can not able to open  .fla file
Where? You won't be able to open them on the Arduino. If it's on the PC, the problem has nothing to do with the Arduino.
32248  Using Arduino / Programming Questions / Re: Time and TimeAlarms Libraries – Ask here for help or suggestions on: December 21, 2011, 06:46:19 am
Apparently you do know how to use the Serial.print() function to print values. Use it to print messages, too. How often does Battery() get called. What is the value of Counter in loop?

I don't see anything in your code that puts the Arduino to sleep between Alarm calls to Battery.
32249  Using Arduino / Programming Questions / Re: void value not ignored as it ought to be on: December 21, 2011, 06:20:36 am
Quote
And your complaint is? ...
Well, OP did say:
Quote
Is there any other way to get setTimeout functionality as it was before (simpleTimer.h) ?
32250  Using Arduino / Programming Questions / Re: Reading serial data and echoing it on: December 21, 2011, 06:18:20 am
Quote
Is that more on the right track?
The code placement is now good. Tools + Auto format would be a good thing to do.
Pages: 1 ... 2148 2149 [2150] 2151 2152 ... 3290