Show Posts
Pages: 1 ... 2250 2251 [2252] 2253 2254 ... 3287
33766  Using Arduino / Storage / Re: I2C sensor + I2C RTC + SPI SD + Bluetooth on: November 05, 2011, 06:49:36 am
Quote
I'm just wondering if there is anything I might have missed? I won't have my board in till Monday.
Yes. The opportunity to test that anything actually works.

Dreamers assume that code will work the first time. Realists test every code change, to make sure that it hasn't broken anything else.

Realists build applications one piece at a time.

Make sure you can read from the sensors, one at a time. Make sure that adding another sensor does not interfere with reading from the one that was working.

Make sure that you can read from the clock. Make sure you can set the clock, so that what you read from it is correct. Make sure the clock does indeed keep time correctly.

Make sure that you can actually initialize the SD card, that you can write to the SD card, and that the SD card can be removed and read elsewhere.

Make sure you can initialize the bluetooth device, that you can write to it, and that something else can pair with it, and see the data that you are writing to the device.

Only then is it time to integrate the individual pieces into a useful application.

But, do let us know how well writing all the code in advance works out for you.
33767  Using Arduino / Storage / Re: How to change text in text file on SD card on: November 05, 2011, 06:39:36 am
Code:
At the end of the month or year, I can retreive the data and use it on excel, for example.
I think that it would be much simpler to write to the SD card something like
w: date distance
o: date distance

Then, create an application on the PC that would read all the entries in the file, and add up the distances for the appropriate date, for the w: records (work) and the o: records (non-work).
33768  Using Arduino / Programming Questions / Re: 2ic Help on: November 05, 2011, 06:18:01 am
Code:
  Wire.requestFrom(2, 1);    // request 6 bytes from slave device #2
You sent 8 bytes from the slave. Yet you are asking for 1, regardless of what the comment says. Why am I not surprised that you don't get multiple values?

Code:
    int photocellReading0 = Wire.receive(); // receive a byte as character
And store that one byte in an int, and pretend that you got both bytes. How's that working out?

Code:
  while(Wire.available())    // slave may send less than requested
  {
    int photocellReading0 = Wire.receive(); // receive a byte as character
    Serial.println(photocellReading0);         // print the character
  }
  int photocellReading1 = Wire.receive();
While there is any data available, read it incorrectly, storing it in a local variable that goes out of scope as soon as the while loop ends. As soon as there is no more data to read, read another byte, pretend that it represents both bytes of an int.

There is more wrong with the receiver code than is right, I'm afraid.
33769  Using Arduino / Programming Questions / Re: [as3] button delay issue on: November 05, 2011, 06:08:36 am
Code:
    import funnel.*;
This compiles on the Arduino? I don't believe that.

Post your Arduino code. That's what you are here for help with.

If you needed help with the action script stuff, you'd have gone to an action script forum, wouldn't you?
33770  Using Arduino / Programming Questions / Re: A few errors which I don't understand. on: November 05, 2011, 05:58:47 am
Quote
Int(..) plays the role of converting byte...
Yes, it does. This means that int() has an input (the value in the parentheses) and an output, which you discard. It also means that it is an rvalue (can only appear on the right side of an equals sign), so you can not use at as an lvalue (something that can appear on the left of an equals sign).
33771  Using Arduino / Programming Questions / Re: How to Ask: "Is the LED hooked up to pin(x) lit?" on: November 05, 2011, 05:55:07 am
Quote
If not, I could set up an array of 8 integers and and send the appropriate array element HIGH when I turn the LED on, and send that element LOW when I turn the LED off. - Right??
The way I see it, you have the logic backwards. What you want to do is set the nth array element to HIGH or LOW, and then set the nth pin state to the value in the nth array element. That way, they are always in sync.
33772  Using Arduino / Project Guidance / Re: Yet another chronograph, serial output. on: November 04, 2011, 09:15:38 pm
Code:
Void Loop () {
Posting code that actually compiles is preferred.

Code:
else;
The else is not mandatory. If you have nothing to do, leave it out.

Code:
if (digitalRead(sensorA) == LOW) {     
    start_time=micros();
    flagA = 1;
   
    if(digitalRead(sensorB) == LOW) {
      stop_time=micros();
      flagB = 1;
Why is the reading of sensorB happening only is sensorA is low? If the direction doesn't matter, the flags are unnecessary.

Code:
            velocity= (distance * 1000000) / elapsed; // etc... post it to serial, delay...
Literals, like 1000000 are interpreted as ints, in the absence of directives to the contrary. 1000000 is NOT an valid int value. You need to add UL to the end to tell the compiler that the value is to be interpreted as an unsigned long.

Will distance * 1000000UL fit in whatever variable type distance is?
33773  Using Arduino / Project Guidance / Re: Learning Project: Binary LED Display on: November 04, 2011, 08:32:30 pm
Quote
As I understand it, for any given number n, An-En are connected and Fn-Jn are connected; on the side rails, any given rail is connected all the way from top to bottom (from 1-63).
Depends on the breadboard. Some rails are split in the middle. You actually need to jumper across them if you want power along the whole rail.
33774  Using Arduino / Project Guidance / Re: Yet another chronograph, serial output. on: November 04, 2011, 08:22:11 pm
The while loops have to go. They are not accomplishing what you want.

On each pass through loop, you need to sense if sensorA is LOW. If so, record when sensorA goes HIGH, and set a flag.
On each pass through loop, you need to sense if sensorB is LOW. If so,record when sensorB goes HIGH, and set a flag.
On each pass through loop, you need to check whether both flags are set. If so, the difference in times will tell you the direction and speed.
33775  Using Arduino / Project Guidance / Re: Wireless modules on: November 04, 2011, 08:01:53 pm
Quote
I would like to know what are the most reliable wireless modules to use ,say in using for wireless weatherstation
XBees. Not cheap, but they do error detection and retries automatically.
33776  Using Arduino / Project Guidance / Re: Learning Project: Binary LED Display on: November 04, 2011, 07:59:18 pm
For one thing pow() is a float function. It takes float arguments and returns float values. Round off errors can occur, even with integer arguments. So, the very first if test may not result in true like you expect.

Further use of the pow function produces the same erroneous results. You really need to develop a different method of computing two to the nth power. Perhaps a simple lookup table for 16 values.

The results you are seeing are consistent with expecting integer results from pow().
33777  Using Arduino / Programming Questions / Re: A few errors which I don't understand. on: November 04, 2011, 06:51:19 pm
Quote
But why can't
i
Code:
nt(hkvtnrToestand) = 0;                               // Oftewel: volgende
int(hkvnrToestand) = 0;                                // karakter.
work?
What does int() do? You can't assign a value to a function call. You really need to understand lvalues and rvalues.
33778  Using Arduino / Programming Questions / Re: [as3] button delay issue on: November 04, 2011, 06:32:27 pm
I'm nearly certain that that won't compile using the Arduino IDE.
33779  Using Arduino / Programming Questions / Re: A few errors which I don't understand. on: November 04, 2011, 06:26:41 pm
Code:
{v = ;}
V equals what?

Code:
int(hkvtnrToestand) = 0;                               // Oftewel: volgende
int(hkvnrToestand) = 0;                                // karakter.
You were told before that this wouldn't work. Why aren't you listening?

Your gotos are completely unnecessary. Get rid of them. A simple change in the program logic will cause the rest of the code in loop to be skipped, accomplishing the same goal of going back to the start of loop.
33780  Using Arduino / Project Guidance / Re: Beginner's question about Ethernet Shield + SD on: November 04, 2011, 06:15:26 pm
Quote
is it possible to load a pre-written page and send it over the ethernet, similar in design to the app example for the Spinnerette server made by Parallax?
I'm not familiar with the Spinnerette server, but, yes the Arduino can act as a web server.

Quote
I.E. a simple page of buttons (or HTML links) from the SD card
If the page is simple, there is no need to store it on an SD card. It's only when the page is too large to fit in the Arduino's memory and/or program memory that storing it on an external storage medium is needed. If that's the case, having the Arduino serve it is probably not appropriate.

Quote
having the task of resend the page (not needing to constantly reload the page from the browser command line.)
No, this last bit is not possible. Client/server connections are not persistent. Trying to make them so is an exercise in frustration.

However, a web page that is served up can include Meta tags that tell the client to fetch the page again automatically after any desired period of time.
Pages: 1 ... 2250 2251 [2252] 2253 2254 ... 3287