Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 1751
61  Using Arduino / Programming Questions / Re: traffic light code on: April 22, 2014, 10:48:22 am
How can we tell?
We're not psychic.
62  Community / Exhibition / Gallery / MOVED: First autonomous drone on: April 22, 2014, 10:41:24 am
This topic has been moved to General Discussion.
It isn't a completed project, so can't be considered for Exhibition/Gallery

http://forum.arduino.cc/index.php?topic=235045.0
63  Using Arduino / Programming Questions / Re: traffic light code on: April 22, 2014, 10:38:15 am
Code:
if (button == 1);
Have you ever seen a conditional written like this?
Lose the semicolon.

64  Using Arduino / Project Guidance / Re: I need help with my Project on: April 22, 2014, 10:34:12 am
Are you saying you need to provide a glass cockpit graphical simulation of those instruments, or you need to drive real electromechanical instruments?
65  Using Arduino / Programming Questions / Re: Making an array element a reference to another variable on: April 22, 2014, 10:22:56 am
Quote
While your statement works in the assignment, I have difficulty seeing a valid use for that syntax.
Me neither, but it is an example of a reference to an array element, which is the closest approach yet to an answer to the original question - if the array element changes, the reference changes, and vice versa.
66  Using Arduino / Programming Questions / Re: auto open/close blinds arduino code i need help on: April 22, 2014, 10:13:31 am
The very simple way is,
Code:
if (condition_for_closing_blind)
{
  if (blindOpen)
  {
    // run sequence to close blind
    blindOpen = false;
  }

I'll leave you to figure out the other part.
Bonus marks for not using delay().
67  Using Arduino / Programming Questions / Re: Making an array element a reference to another variable on: April 22, 2014, 10:00:29 am
On the other hand, take a look at reply #4, which does work.
68  Using Arduino / Programming Questions / Re: traffic light code on: April 22, 2014, 09:45:47 am
Code:
digitalWrite (switch_pin, LOW);
The processor has a built-in pullup which you have deliberately chosen not to use.
Why?
69  Using Arduino / Project Guidance / Re: Collision Avoidance Vehicle on: April 22, 2014, 09:41:07 am
Quote
With three sensors
... you have to be even more careful about making sure there are no returns from previous pings still in flight.
70  Using Arduino / Project Guidance / Re: making switch read throughout LONG if/else sequence on: April 22, 2014, 09:39:10 am
No, I don't think Paul misunderstands.
Take a look at the blink without delay example, without delay.

(Seeing some code would help clear up misunderstandings)
71  Using Arduino / Programming Questions / MOVED: making switch read throughout LONG if/else sequence on: April 22, 2014, 09:26:20 am
This topic has been moved to Project Guidance.
Clearly asking for advice
http://forum.arduino.cc/index.php?topic=235031.0
72  Using Arduino / Programming Questions / Re: How can I correct this function compile error? on: April 22, 2014, 09:11:38 am
Quote
So 255 is the same as 511, is the same as 1023, is the same as 2045, is the same as 4091
{ cough }
sp "2047", "4095"
73  Using Arduino / Programming Questions / Re: Making an array element a reference to another variable on: April 22, 2014, 09:08:53 am
Code:
&str = menuItems[2];
Quote
error: lvalue required as left operand of assignment
That's perfectly correct - you can't assign a value to a constant address.
74  Using Arduino / Programming Questions / Re: "unqualifiied-id expected before"if" error on: April 22, 2014, 09:01:53 am
Code:
  const int nodetect=100;
  const int fardetect=80;
  const int meddetect=60;
  const int closedetect=40;
  const int veryclosedetect=20;
  if (microsecondsToInches >= nodetect){
   digitalWrite(ledpin,HIGH);
   delay(slowflash);
   digitalWrite(ledpin,LOW)
   delay(slowflash);
  }
  if  (microsecondsToInches >= fardetect && (microsecondsToInches <= nodetect))
  {
   digitalWrite(ledpin,HIGH);
   delay(medflash);
   digitalWrite(ledpin,LOW);
   delay(medflash);
  }
  if  (microsecondsToInches >= meddetect && (microsecondsToInches <= fardetect))
  {
   digitalWrite(ledpin, HIGH);
   delay (fastflash);
   digitalWrite(ledpin,LOW);
   delay(fastflash);
  } 
  if (microsecondsToInches >= closedetect && (microsecondsToInches <= meddetect))
  {
   digitalWrite(ledpin,HIGH);
   delay(superfastflash);
   digitalWrite(ledpin,LOW);
   delay(superfastflash);
 }
  if (microsecondsToInches >= veryclosedetect && (microsecondsToInches <= closedetect))
  {
   digitalWrite(beeppin, HIGH);
   delay (superfastflash);
   digitalWrite(beeppin,LOW);
   delay(superfastflash);
 }
All that stuff needs to be inside a function.

You've declared a number of variables inside setup that you never use.

Please use CODE TAGS when posting code, do not use "format for forum" or whatever it is called
75  Using Arduino / Programming Questions / Re: Esc -programming error on: April 22, 2014, 07:46:20 am
The Servo library's PWM is a completely different frequency to analogWrite's frequency - there's almost a 1:10 ratio difference, and the chances are your ESC won't like a 500Hz PWM signal.
Even if it does, your resolution will be much worse than with the Servo library.

Can you say, hand on heart, that the values you are writing are not the source of the jitter? (I only ask that because it is impossible to tell from the snippet of code you posted)
Pages: 1 ... 3 4 [5] 6 7 ... 1751