Show Posts
Pages: 1 ... 20 21 [22] 23 24 ... 235
316  Using Arduino / Programming Questions / Re: please can someone help me? on: March 12, 2014, 12:23:57 pm
I have followed the guide but it may not work anyway?
If you have followed the guide then this will not be true
Quote
Library is located in the arduino folder run arduino from a folder on the desktop.

Which is it ?  Have you followed the guide or are the library files in the arduino folder on the desktop ?
What is the exact path to the folder in which you have installed the DHT library ?
317  Using Arduino / Programming Questions / Re: lcd blink particular index variable on: March 12, 2014, 12:19:23 pm
AMPS - can you please explain what the Blink_LCD() function is supposed to do ?

Why all the (any ?) gotos ?  The switch/case should take care of itself and only execute the case where the switch variable is true.  The breaks prevent other cases being executed.
318  Using Arduino / Programming Questions / Re: Default compiler in Arduino on: March 12, 2014, 02:35:27 am
Quote
1. How to change default compiler for Arduino to avr-gcc ????
What compiler does it use as a default at present I wonder.
319  Using Arduino / Programming Questions / Re: Subtracting New TIme interval on: March 12, 2014, 02:21:42 am
I wanted to subtract two time interval. here one time interval is 5hour 30 minute and other is current time.the code is written as follow.
Error report i am getting while run on arduino platform . but this code working fine run on python.
Quote
error: invalid operands of types 'double' and 'int' to binary 'operator%'
Code:
main()
{
int Time1;
int Time2;
int hour=10;
int minute=5;
int second=13;
int h; int m;
double  Ntime;
Time1=(3600*5)+(60*30);
Time2=(3600*hour)+(60*minute)+second;
Ntime=Time2-Time1;
Ntime=((Ntime%60)/100+(Ntime/60));
h=(int)(Ntime);
m=((Ntime-h)*100);
printf("hour after subtraction is : %d hour %d min",h,m)

}
Modulo (%) only works on integers (int or long) not floating point values.  So
Code:
Ntime%60
is invalid because Ntime is a double (why ?)

The code does not compile because of a missing semi-colon nor does it produce any output because it uses printf().  Is this really an Arduino question ?
320  Using Arduino / Programming Questions / Re: Need Help With Reading In RC Input And Using As An Interrupt on: March 12, 2014, 02:06:24 am
Code:
byte receiverPin = 7;
unsigned long duration;

void setup()
{
  Serial.begin(115200);
  pinMode(receiverPin, INPUT);
}

void loop()
{
  duration = pulseIn(receiverPin, HIGH);
  Serial.println(duration);
}
Connect one of the receiver outputs to pin 7 and GND to GND.  The serial output will vary with the Tx stick or switch position.  Now you can take action, such as shutting down the motors, based on the value.

Note, however, that using the value from only one channel as a "kill" could be dangerous because it would be easy to trigger it by mistake.  It would be better to read the value of two inputs and only if both of them were in the correct position, perhaps low throttle and full left rudder, disarm the system.
321  Using Arduino / Programming Questions / Re: Need help with Char Array to String Object. on: March 11, 2014, 05:24:56 pm
String libraries in Arduino need a String object not an Array of chars, hence the String = String(ArrayOfChars).
But inputString is not an array of chars, it is a String.

From your code
Code:
String inputString = ""; 
322  Using Arduino / Programming Questions / Re: Need Help With Reading In RC Input And Using As An Interrupt on: March 11, 2014, 02:59:24 pm
You can use pulseIn to read a channel from an RC receiver.  Are you sure that you need to use an interrupt ?
323  Using Arduino / Programming Questions / Re: please can someone help me? on: March 11, 2014, 02:54:12 pm
Where exactly is the library installed ?
324  Using Arduino / Programming Questions / Re: please can someone help me? on: March 11, 2014, 02:01:52 pm
Quote
but wonder what is wrong when I get this error code?
The program cannot find the library file.  Either you have not used #include properly, the library was not installed properly or you did not stop/restart the IDE after installing the library.

Is the DHT library installed ?
If so, where ?

POST YOUR CODE !
325  Using Arduino / Programming Questions / Re: Volatile String Object? on: March 11, 2014, 09:36:18 am
Use a null terminated char array.
326  Using Arduino / Programming Questions / Re: Display DS18B20 High and Low Temperatures on: March 11, 2014, 09:35:02 am
You need 2 variables. Set maxTemp to zero and minTemp to 999
When you read a temperature compare it with maxTemp and minTemp.
If currentTemp is greater than maxTemp then set maxTemp to currentTemp
If currentTemp is less than minTemp then set minTemp to currentTemp
327  Using Arduino / Programming Questions / Re: please can someone help me? on: March 11, 2014, 09:30:35 am
Quote
no it is correct.
Show us the code that you are using.
328  Using Arduino / Programming Questions / Re: please can someone help me? on: March 11, 2014, 06:58:27 am
I would guess from the code that you have not posted that you have not #included the DHT library properly in line 10.
329  Using Arduino / Programming Questions / Re: Randomly LEDs fading problem on: March 11, 2014, 06:55:04 am
Try printing the value of brightness in your for loops.  Are the values what you would expect ?

Code:
  for(; brightness <= 255; brightness += fadeAmount)
This form of for loop always looks ugly to me.  Why not use the form where the loop variable is declared in the for loop ?
330  Using Arduino / Programming Questions / Re: Knob with speed limit on: March 11, 2014, 05:07:11 am
Where did you put 0.5 instead of 1 ?
Pages: 1 ... 20 21 [22] 23 24 ... 235