Show Posts
Pages: 1 ... 2251 2252 [2253] 2254 2255 ... 3286
33781  Using Arduino / Programming Questions / Re: Temperature sensor with multiple 74HC4511's and 7 segments. on: November 03, 2011, 02:37:45 pm
Quote
But I can not figure out how to e.g make the first 7-segment write "2" when the temperature is 20-29, and "30" if the temperature is in the 30's.
What code do you have to display anything on the displays?
33782  Using Arduino / Interfacing w/ Software on the Computer / Re: Java IDE and Adruino communication problem on: November 03, 2011, 02:33:55 pm
Quote
Is there a way round having to manually reset the Adruino mega after starting serial communication with the board.
Unless you have modified the Arduino, opening the serial port from a PC application does reset the Arduino.

Quote
when my project is completed i wont have access to the board as it will be in a remote location, so this is going to be an issue.
But still connected to a PC?

Quote
can someone please provide a quick fix example that will work by either responding to a command from a PC or internally in the setup code.
What you are describing is not normal behavior. Until the sketch is running, any code in setup() won't be executed, including connecting to the serial port to receive a command. So, no, code won't help you.
33783  Using Arduino / Programming Questions / Re: OneWire and DallasTemperature libraries under 1.0 beta on: November 03, 2011, 02:26:08 pm
Replace the #include "WConstants.h" with #include "Arduino.h" in OneWire.cpp.
33784  Using Arduino / Programming Questions / Re: Code Problem- Two motors need to work at once in simple sketch on: November 03, 2011, 01:02:48 pm
Code:
for(pos1 = v2; pos1 < 179; pos1 += 1)  {   
   
   v2 = random(30,180);           
   servo1.write(pos1);             
   delay(50);                     
 }
Probably work better if you assigned a value to v2 BEFORE using it in the for loop.

You have one loop to move each servo. The 2nd servo doesn't start until the 1st one completes its motion.

Use just one loop, moving both servos in that loop.
33785  Using Arduino / Networking, Protocols, and Devices / Re: Cellular Shield and Uno on: November 03, 2011, 12:07:32 pm
Quote
1. it seems like a sim card is necessary, why is that ?
The shield emulates a cell phone. The SIM card contains the data necessary for it to do that, just like your regular cell phone needs one.

Quote
2. this may seem dumb, how do we know(or find out) the "phone number" of our arduino in order to text it?
It's on the SIM card. When you get one, you'll be told the phone number.
33786  Using Arduino / Networking, Protocols, and Devices / Re: Baud rate for USB serial on: November 03, 2011, 11:52:59 am
Quote
Since communication between an Arduino and a PC is done over a USB port and not a serial port
It is done by a chip the converts the serial data sent by the Arduino to USB data. The driver on the PC that talks to the Arduino converts the USB data back to serial data.

Quote
However, all the example code sets the Baud rate, which makes it look like it is important.
Only because it is.

Quote
Does this mean that it's important to make sure that the serial port on the PC is configured to use the same Baud rate as the Arduino?
Only if you want to meaningfully exchange data.
33787  Using Arduino / Programming Questions / Re: Problem with arduino-processing. on: November 03, 2011, 11:48:15 am
Quote
i just get this msg and the Processing dont get the data from Arduino.
The two are not necessarily related. What code is running on the Arduino?

Are you CERTAIN that the Arduino is connected to the first item in the list returned by Serial.list()?
33788  Using Arduino / Programming Questions / Re: Problem with arduino-processing. on: November 03, 2011, 11:39:57 am
Does that warning cause problems? If not, why are you concerned?
33789  Using Arduino / Programming Questions / Re: Best way to parse a string of numbers into a float array? on: November 03, 2011, 11:37:43 am
Quote
1) If I don't pad the string with an extra word, the strtok function leaves out the first number in my string. (not reallly a big deal since the simple solution was to add an extra "term" in front of the original string
Wrong solution.

Code:
  tokenPtr = strtok(buffer, " ");
 
  while( tokenPtr != NULL ) {
    int i = 0;
    tokenPtr = strtok( NULL, " ");
    stringOutput[i] = (String)tokenPtr;
You're stomping on the pointer to the first token before you copy/store it. Don't do that.

Try this, which also defines and increments i properly.
Code:
  int i = 0;
  tokenPtr = strtok(buffer, " ");
  while( tokenPtr != NULL )
  {
    stringOutput[i++] = (String)tokenPtr;
    tokenPtr = strtok( NULL, " ");
  }

Quote
2) It gives me the error "cannot convert 'float*' to 'float' in return. From what I've gathered, this is because I used a character pointer variable (?? correct me if I'm wrong), so the function must return a pointer float array, not a regular array.
You can't return a pointer to an array defined in the function. The array goes out of scope when the function ends. A pointer to out-of-scope memory is a bad thing.

Make the array global, or pass it to the function to fill.

Quote
3) If I change the function type to float*, the script compiles fine. However, the float array it returns are 6 zero values truncated to 2 decimal places (I need all 3).
The values are truncated by something else you are doing, not by the fact that you are compounding error on top of error in this function.
33790  Using Arduino / Programming Questions / Re: I will pay $50 for someone to write simple program on: November 03, 2011, 10:57:56 am
Quote
i have drawn a picture of my wiring on the transistor
That'll be a pretty small picture, won't it?
33791  Using Arduino / Programming Questions / Re: problem with ping ultrasonic sensor code on: November 03, 2011, 10:54:35 am
Quote
no , i have blackdimond  so pin 12 is free
Post a link to your WiFi shield.
33792  Using Arduino / Programming Questions / Re: problem with ping ultrasonic sensor code on: November 03, 2011, 10:27:23 am
Code:
const int pingPin = 12; // ping pin
Isn't your shield using pins 10 to 13 (the SPI pins)?
33793  Using Arduino / Programming Questions / Re: Simple VSS code? on: November 03, 2011, 10:22:19 am
Quote
I figured I would take it from Pulses per second divide by the number of pulses in a rotation to get rotations per second divide by rotations per mile to come up with miles per second, multiply by 60 and then multiply by 60 again to come up with MPH?
So, what do you need help with? This sounds like a reasonable approach. The only tricky parts are determining the number of pulses per rotation of whatever is rotating, and the number of rotations per mile.
33794  Using Arduino / Project Guidance / Re: Converting wired component video out signal to wireless? on: November 03, 2011, 08:56:53 am
Quote
Could I just use a wire if I don't want to much range?
There's no such thing as too much range.

You need to define the range you want, and what that antenna is for, exactly.
33795  Using Arduino / Project Guidance / Re: Timer1 interupt help on: November 03, 2011, 08:54:18 am
Quote
any advice on hw to fix the other the errors?
You means besides the obvious - declare/type the undefined variables?
Pages: 1 ... 2251 2252 [2253] 2254 2255 ... 3286