Show Posts
Pages: 1 ... 1889 1890 [1891] 1892 1893 ... 3082
28351  Using Arduino / Programming Questions / Re: Reading From NewSoftSerial on: January 12, 2012, 10:03:24 pm
Code:
Serial.print(touchBuffer);//there's no write in this version of Arduino
Which version is that? I've used all the versions from 15 on up and they all have Serial.write().

http://arduino.cc/en/Reference/Char
Quote
The char datatype is a signed type, meaning that it encodes numbers from -128 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.
240 is NOT between -128 and 127.
28352  Using Arduino / Programming Questions / Re: help with incrementing code on: January 12, 2012, 09:56:15 pm
Quote
I think I need to learn how to map values, and define max min values then I can make my fan speed variable through the whole analog write range   
You need to decide how far above the target temperature the fan should run full speed. I'd recommend making that a #define so you can easily change it.
#define MAXDIFF 20

Then, something like this should work:
Code:
int deltaT = outsideTemp - targetTemp;
if(deltaT > 0)
{
  int fanSpeed = map(deltaT, 0, MAXDIFF, 0, 255);
  fanSpeed = constrain(fanSpeed, 0, 255);
  analogWrite(fanPin, fanSpeed);
}
28353  Using Arduino / Programming Questions / Re: confused on using 2 serial ports on a arduino-mega at the same. on: January 12, 2012, 09:47:23 pm
Quote
The IR sensor sends the data via serial 1
This doesn't make sense. The IR sensor is read by the Arduino. It does not have the ability to send serial data.

Quote
In my loop function I only have 2 functions, one that reads the android phone and one that reads the IR sensor in that order.
But, I'm not going to show you either one.

Quote
Is there a way to give priority to serial 0? Maybe disable serial 1 when data is received on serial 0? making the android phone dominate.
Serial data is buffered. Which one you read first is up to you.

Quote
EDIT: from some reason it wont let me post the picture
The forum didn't stop you posting your code, though. So, where is it?
28354  Using Arduino / Programming Questions / Re: Fading an LED using a Ping on: January 12, 2012, 02:32:36 pm
Quote
so less than 2 mph.
Even at 2 mph, a delta distance of 0.01 cm is pretty silly, don't you think?
28355  Using Arduino / Programming Questions / Re: servo control via serial on: January 12, 2012, 02:22:35 pm
PU is missing a break
So is RB.
28356  Using Arduino / Programming Questions / Re: Fading an LED using a Ping on: January 12, 2012, 02:16:38 pm
Quote
Realized at lunch today that this simple little setup would work perfectly for a back up system in a car, telling you when you get close down to the nearest hundredth cm.
On a car moving at what speed?
28357  Using Arduino / Programming Questions / Re: help with incrementing code on: January 12, 2012, 02:01:20 pm
Quote
i am using the DS18B20 1 wire temp probes deviceAddress is juts whats is used in the 1 wire temp example
Which you are free to extend/alter/modify, as you did. There is no reason to stick with meaningless names, when you know better names.

Quote
its a powerful 200mm commercial centrifugal  inline fan there is a massive difference from slow speed to full speed, if the temp is high enough to run the fan on full speed it will draw away enough hot air it will lower the temp and then cycle to slow speed then to fast speed when temp rasies again, and in my house there is vents in the all rooms it will be very annoying to have it cycle like this so i want a consistent speed at different temps above my set target temperature for comfort.
The idea, though, is that a small rise about set point should cause the fan to run slowly. As the temperature rises higher above the set point, the fan should speed up, in small steps, not in big jumps. The temperature in the space will be more consistent with a smooth increase in speed vs. big jumps.
28358  Using Arduino / Networking, Protocols, and Devices / Re: YABQ - Yet another bluetooth question... on: January 12, 2012, 11:59:15 am
Quote
1.1 Does it require a phone application to be built?
Yes. On the other hand, if the Arduino had an ethernet shield, it could be controlled from much farther away (like around the world) with no special app on the phone/ipad/PC.

Quote
1.2 If so does a different application need to be built for each operating system (ios / android)?
Well, yeah.

Quote
1.3 If so how does one go about facilitating the download / installation of the application on to the phone device?
If it's an iDevice, you need to make the application available at the apple store, which means an application development account (NOT free) and application development software on the mac (free).

Quote
1.3.1 Would a device have to be jail-broken to allow installation of a bluetooth app?
Not if you follow the rules and pay the money.

Quote
1.5 As an alternative to the bluetooth method - would an arduino-wifi-webserver and an html5 webpage enable a larger population of different brands of wifi enabled devices (phones; tab; etc) to access the arduino and cycle the solenoid?
But of course.

Quote
2) What is the minimal hardware required to enable a solenoid to be activated by a bluetooth or ethernet wifi connection?
An Arduino, an ethernet shield, a solenoid, and a relay/transistor to toggle power to it.

Quote
3) If the arduino device is battery powered - what life span can be expected from the batteries?
Depends on the batteries, don't you think?
28359  Using Arduino / Programming Questions / Re: Continuous Rotation Servo Control with a Keyboard & Limited t Stop at a Point. on: January 12, 2012, 11:43:22 am
Quote
It wasn't butchered and is being sold by Addafruit
Sure it was. A servo has a position feedback mechanism built in, that prevents continuous rotation. In order to make a "continuous rotation servo" (which is technically nothing more than a variable speed motor after the modification) the positional feedback mechanism, along with any physical stops, is removed.

I didn't mean to imply that you butchered it.

Quote
Okay what if I ordered a 180 Degree servo something like (https://www.adafruit.com/products/155) the above mentioned should be able to be done while the servo won't let it go past a factory defined point.
That would work.
28360  Using Arduino / Programming Questions / Re: Help! Tips on how to change the message an LCD using PushButton on: January 12, 2012, 11:36:21 am
Perhaps the fact that you clear the display on every pass through loop is an issue. You could clear the display only when pressCount changes to minimize that.
28361  Using Arduino / Networking, Protocols, and Devices / Re: Sense/Stage MiniBee - small Arduino/XBee combo and library on: January 12, 2012, 10:57:47 am
Pretty cool project. Nice job.
28362  Using Arduino / Networking, Protocols, and Devices / Re: Xbee communication Error on: January 12, 2012, 10:32:43 am
Quote
As a program starter I still don't understand the meaning of " inData[index] = '\0'; ",
A string is a character array that is NULL terminated. That statement is NULL terminating the array.

Quote
By the way, is there any one can give me a input about the power consumption of the Serial port and the Xbee in different speed?
Baud rate has no relationship to power consumption.
28363  Using Arduino / Programming Questions / Re: From RS232 to SD writing issue on: January 12, 2012, 10:28:40 am
Code:
void loop()                     // run over and over again
{
    if (mySerial.available()>0){
        ofstream sdout("no3.txt", ios::out | ios::app);
        while(mySerial.available()>0){
            inbyte=mySerial.read();
            sdout <<(char)inbyte;
        }   
    }
}
You are still opening and closing the file many times before the whole file is received.

I suggested:
Quote
    while(serial available and inByte != EOF)

You didn't implement the highlighted part.
28364  Using Arduino / Programming Questions / Re: Continuous Rotation Servo Control with a Keyboard & Limited t Stop at a Point. on: January 12, 2012, 10:13:10 am
Quote
Is it possible to control a Continuous Rotation servo with a keyboard as in if you were to press say the "Q" key to run in a direction and the "W" key to stop but also be able to limit how far the servo is allowed to rotate, say something like 60 Degrees?
Yes, and no. Yes, it is possible to start the servo rotating. No, it is not possible to make it stop at some specific location. If that is a requirement, the servo should not have been butchered.
28365  Using Arduino / Programming Questions / Re: free(ptr) not working on: January 12, 2012, 10:07:23 am
After you free the memory pointed to, YOU must set the pointer to NULL. That is not done for you.

Code:
free(ptr);
ptr = NULL;
Pages: 1 ... 1889 1890 [1891] 1892 1893 ... 3082