Show Posts
Pages: 1 ... 2248 2249 [2250] 2251 2252 ... 3393
33736  Using Arduino / Programming Questions / Re: Is there a way to practice/emulate without a bot? on: December 23, 2011, 10:17:18 pm
I just want to write the code before I get the bots so I can hit the ground running.
You are a lot better off getting the hardware first. Once you have the hardware, write some code to make the robot move forward. Then, make it stop after a period of time. Then, make it back up.

Then, add sensors to make the robot learn about its environment.

There are some emulators, but they won't tell you a thing about the physical hardware. Suppose the robots drifts to the right all the time. The emulator won't tell you that that will happen, so, you won't have learned anything about the need to compensate for the tendency to drift.
33737  Using Arduino / Programming Questions / Re: Millis - Something out of order? on: December 23, 2011, 07:26:57 pm
So, remove the unsigned long bit. You are trying to declare another variable of the same name, when all you want to do is reset the existing variable.
33738  Topics / Robotics / Re: RC-Car Control on: December 23, 2011, 06:13:08 pm
I donĀ“t want to send out another char. when I release the Button.
Please explain why not. This would be the most reasonable thing to do.
33739  Development / Other Software Development / Re: Use of direct port register to set PIN state without digitalWrite - Help needed on: December 23, 2011, 05:57:14 pm
DDRC = B00000001;  // set analog 0 to OUTPUT
PORTC = B00000001; //set analog0 to HIGH
Your comments (and assumptions) are wrong. Analog pins are INPUT only, by definition.

The analog pins can be used as digital pins, which is what you are doing here. The comments should reflect this,
33740  Using Arduino / Programming Questions / Re: Millis - Something out of order? on: December 23, 2011, 05:31:44 pm
    Serial.println("                                                 Camera 1 is  NOT RECORDING");                                  // r_p     
Add a curly brace after this.

Move the while loop that follows this one indent level to the left, and remove the extra curly brace that will be at the end (because of the one added above).
33741  Using Arduino / Programming Questions / Re: SD libary on: December 23, 2011, 04:55:56 pm
Why can't this work
The compiler told you why. The exists() method does not accept a String object.

how can i fix it
Don't pass a String object to exists.

People wrote extensive text processing applications for decades before the String class was introduced. It is a crutch for lazy people. Don't use it.
33742  Using Arduino / Programming Questions / Re: Display Column Number in Processing Window on: December 23, 2011, 04:52:33 pm
was wondering if there was any way to display the column number on the coding window.
No, but if you set the window width appropriately, and don't type beyond the edge of the window, the column number doesn't really matter.
33743  Using Arduino / Programming Questions / Re: Newbie Syntax issues, HELP! on: December 23, 2011, 04:47:42 pm
if (RightPin){
The name implies a pin number. The usage implies a pin state. Which is it? Why are you not using unambiguous names?
33744  Using Arduino / Programming Questions / Re: Why my servo turns back to zero after whatever serial interaction? on: December 23, 2011, 10:29:05 am
      if (index < 122) {
The array is 80 elements long. As long as you have received fewer than 122, add this byte to the array. No, I don't think so.

I removed the Moose
You removed what?
33745  Using Arduino / Networking, Protocols, and Devices / Re: Twitter API Refresh Rate? Worked before, now not? on: December 23, 2011, 10:20:03 am
Each call to the server generates a response. You haven't showed what responses you are getting, so it's not possible to tell what the problem is. Most free services have some access rate that you must respect. It's unlikely that twitter wants you checking for messages every ten seconds.
33746  Using Arduino / Networking, Protocols, and Devices / Re: Twitter API Refresh Rate? Worked before, now not? on: December 23, 2011, 09:38:53 am
Is twitter mad at me for being too needy?
Quite possibly.

String holder = String(">hello, world");  // string to hold the text we're testing against / looking for
If you are going to use a class that is a resource hog, there is no reason to go overboard wasting resources.
String holder = ">hello, world";
would work just as well, and waste fewer resources.

556 bytes of SRAM gone right there. If you are using a 328 based Arduino, that's more than 1/4 of the memory gone.
33747  Using Arduino / Networking, Protocols, and Devices / Re: real time Feedback. Possible? on: December 23, 2011, 09:27:11 am
If there is anything easier than that. Please let me know.
XBees and XBee shields allow the radios to take place of the wires that the Serial class communicates with. You can hardly get any simpler than that. Cheaper, yes. Simpler, no.
33748  Using Arduino / Networking, Protocols, and Devices / Re: email when motion detected on: December 23, 2011, 09:01:39 am
   if (motionDetect());
That semi-colon on the end is causing your grief. It IS the body to be executed when the statement is true. Remove is, and the stuff in the curly braces that follows the statement will become the body to be executed (which appears to be what you want).
33749  Using Arduino / Programming Questions / Re: analogReference(EXTERNAL) on: December 23, 2011, 08:55:40 am
yesh that is mistake
No, it isn't. There is no way to set the mode for analog pins, because they are input only, by design.

When you use the analogReference() function, with EXTERNAL as the argument, the ADC compares the measured voltage on the analog pin to the voltage on the VRef pin. What do you have supply voltage to the VRef pin? What voltage is it?
33750  Using Arduino / Programming Questions / Re: Best Practice with millis()? on: December 23, 2011, 08:49:50 am
does Method 1 get around the bound condition when the millis rolls over
Yes, it does, and that is why it is the preferred solution. In terms of time required, the subtraction operation is very fast. Don't worry about "saving clock cycles" here.
Pages: 1 ... 2248 2249 [2250] 2251 2252 ... 3393