Show Posts
Pages: 1 ... 8 9 [10] 11 12 ... 295
136  Using Arduino / Programming Questions / Re: Arduino mega at2560 overclock 20mhz on: September 04, 2014, 09:14:23 am
Quote
So this is why I need more "power"!
Are you sure that your code is optimised and that you cannot use the Arduino at its native speed ?
137  Using Arduino / Programming Questions / Re: Help to get a MQ-2 Programming Code on: September 04, 2014, 09:09:33 am
This may be a radical idea, but what have you got to lose ?
Try searching this forum for MQ-2
138  Using Arduino / Programming Questions / Re: speed of transistor on: September 04, 2014, 07:13:07 am
Post your program so that we can see what you are doing and how.
139  Using Arduino / Programming Questions / Re: puseIn / digitalWrite() question on: September 04, 2014, 02:19:11 am
Quote
I have ordered another receiver that has SBUS capabilities, and that may be the answer
I predict that it will be the source of more problems rather than providing the answer.

When I needed to extend the pulse width of an RC channel beyond what the transmitter setup provided I used this
Code:
  yawDuration = pulseIn(yawInPin, HIGH);
  yawDuration = map(yawDuration, 1000, 1800, 980, 2020);
  digitalWrite(yawOutPin, HIGH);
  delayMicroseconds(yawDuration);
  digitalWrite(yawOutPin, LOW); 
140  Using Arduino / Programming Questions / Re: Problem Programming Servo on: September 04, 2014, 02:08:36 am
As has been pointed out you have no control over the position of a continuous rotation servo.  It is in fact not a servo at all but a geared motor with electronic speed control.

Bearing that in mind this code
Code:
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(7000);                       // waits 15ms for the servo to reach the position
  }
will not do what the comments say.  It will increase the speed of the servo rotating in one direction in 180 discrete steps, each of which will take 7 seconds, which will take a total of 21 minutes.

By the way, the code as posted does not compile.
141  Using Arduino / Programming Questions / Re: Arduino Time library and Time alarm on: September 03, 2014, 06:23:35 am
Do you really think it likely that providing 3 volts to an input that expects between 3.3 and 12 volts is going to work ?  Why not try it and see ?  Even if it works will it be reliable working outside of the specified voltage range ?

Exactly what coin cell are you considering using and how long do you expect the Arduino to run on it ?
142  Using Arduino / Programming Questions / Re: Comparing Values on: September 02, 2014, 09:21:11 am
Hmmm.., indeed, but I won't commit the sin of revising my original post and making a nonsense of your comment
143  Using Arduino / Programming Questions / Re: beginner doubt about variables on: September 02, 2014, 09:17:01 am
Quote
If you want to exchange the value of two variables you need to use a third variable to temporarily hold one of the values.
I seem to remember that there are ways of doing it without a third variable.
[Google]
Code:
   a = a + b;
   b = a - b;
   a = a - b;
[/Google]
144  Using Arduino / Programming Questions / Re: code in code on: September 02, 2014, 09:08:29 am
Quote
this is not where i am looking for for this project.
Perhaps you could explain what the project is.  Are you looking to enter arbitrary code in the Serial monitor and have it executed by the Arduino or are there only a limited number of programs that you want to run ?

You seem to have described a solution that you are looking for and found that it is impossible to implement, but if you describe what you are trying to do then there may be a different way to achieve it.
145  Using Arduino / Programming Questions / Re: Individual servo control using flex sensor readings on: September 02, 2014, 07:25:22 am
Code:
byte ServoAngle1 = Serial.read();
byte ServoAngle2 = Serial.read();
byte ServoAngle3 = Serial.read();
byte ServoAngle4 = Serial.read();
byte ServoAngle5 = Serial.read();
Two or more variables with the same name apart from a numerical suffix should always suggest that use of arrays would be appropriate.
146  Using Arduino / Programming Questions / Re: Comparing Values on: September 02, 2014, 07:12:39 am
However you write I would get rid of the 'magic' numbers in the code and make them global constants with meaningful names.  It makes the code easier to understand and maintain.
Code:
const int waterLowPoint = 2500;
const int waterHighPoint = 6000;
const int beerLowPoint = 8000;
const int beerHighPoint = 12000;
const int wineLowPoint = 13000;
const int wineHighPoint = 17000;
const int mercuryLowPoint = 18000;

Code:
if (sensor >= waterLowPoint && sensor <= waterHighPoint) {
  digitalWrite(LED1, HIGH);
} else if (sensor >= beerLowPoint && sensor <= beerHighPoint) {
  digitalWrite(LED2, HIGH);
} else if (sensor >= wineLowPoint && sensor <= wineHighPoint) {
  digitalWrite(LED3, HIGH);
} else if (sensor > mercuryHighPoint) {
  digitalWrite(LED4, HIGH);
}

Obviously you choose meaningful names rather than the ones I made up !
147  Using Arduino / Programming Questions / Re: small help with HTML commands on: September 02, 2014, 05:28:44 am
Code:
client.println("<span style=color:darkolivegreen;font-weight:bold>Test</span>");
I would expect you to be able to split the client.print() into as many sections as you like ***.  Does it actually need to be terminated with the newline provided by client.println() ?
Code:
client.print("<span style=color:darkolivegreen;font-weight:bold>");
client.print("Test");
client.print("</span>");

If that works then you could put
Code:
client.print("<span style=color:darkolivegreen;font-weight:bold>");
in a function and call it when you wanted to change the text colour and weight, or take it one stage further and make the function take parameters for font weight and colour to make it more general purpose.

***Note that this is speculation on my part but it seems logical.
148  Using Arduino / Programming Questions / Re: Need help with GenieArduino! on: September 01, 2014, 06:12:31 am
One end is connected to the ground and the other one to A0.
Hmmmmmm........

As suggested, you need to connect it correctly.
149  Using Arduino / Programming Questions / Re: Need help! on: September 01, 2014, 04:34:59 am
How is the pot wired ?
150  Using Arduino / Programming Questions / Re: small help with HTML commands on: August 31, 2014, 04:14:07 am
Quote
how do I do this with clinet.print?
Why can't you do that with client.print() ? (I assume that clinet is a misspelling of client).

Please post the whole program as it is now.
Pages: 1 ... 8 9 [10] 11 12 ... 295