Show Posts
Pages: [1] 2 3 ... 542
1  Using Arduino / Programming Questions / Re: Changing the code to run faster - direct port manipulation HELP! on: April 24, 2014, 06:29:12 am
You might be interested in the "digitalwritefast" header: https://code.google.com/p/digitalwritefast/

It can change your pinMode(), digitalRead() and digitalWrite() calls into direct port manipulation whenever the pin number is a compile-time constant.  Just include the header and change the pinMode(), digitalRead() and digitalWrite() calls to pinModeFast(), digitalReadFast() and digitalWriteFast().  This will make your code just as fast and more readable.
2  Using Arduino / Programming Questions / Re: Changing the code to run faster - direct port manipulation HELP! on: April 24, 2014, 05:53:22 am
All of your declarations and your ISR routines are missing so the code won't compile.
3  Using Arduino / Sensors / Re: Using Accelerometer to turn off blinking LED help. on: April 24, 2014, 05:46:49 am
To get rid of the delays you can use the BlinkWithoutDelay example as a base.
4  Using Arduino / Sensors / Re: Problems with Ultrasonic Range Finder - Maxbotix LV-EZ1 on: April 24, 2014, 05:44:34 am
The former, unless I can use the sequential one without having to resolder. My solder connections is a chain of the RX wires.

"The former" (works for most instances) has all the RX pins connected together.  It's the latter version (Always Works) that has the boards chained TX to RX:
--->RX  TX---->RX TX--->RX  TX

I am guessing that by "chain of RX wires" you mean you have all the RX pins connected together.  In that case you pulse the output pin connected to the RX pins every 50 milliseconds or more and read the analog inputs whenever you want.
5  Using Arduino / Installation & Troubleshooting / Re: Problem interfacing ArduinoMega-2560 with laptop on: April 24, 2014, 05:31:46 am
Sir I have gone through the link you suggested.
But, to update/check the firmware,  I could not find the board in the device manager.
When it was fine, Port -COM42 was my Arduino's port .
Now it is not being shown in the device manager.

At what step in the instructions did you look for and fail to find the Arduino in Device Manager?
6  Using Arduino / Installation & Troubleshooting / Re: Can´t upload any code. Help please. on: April 23, 2014, 02:36:05 pm
Is there a way that by only downloading the DFU programmer the problem was solved?

I don't think so.  o.0
7  Using Arduino / Installation & Troubleshooting / Re: cannot select Arduino Board under Tools/Board on: April 23, 2014, 09:24:05 am
Sounds like someone put a Galileo boards.txt file over the one that came with the Arduino software.  The easiest way to fix it is to re-download the Arduino 1.0.5 software: http://arduino.cc/en/Main/Software#toc2
8  Using Arduino / Installation & Troubleshooting / Re: Can´t upload any code. Help please. on: April 23, 2014, 09:05:07 am
Is the "Arduino" an UNO or MEGA?  If so you may need to re-install the USB-to-Serial firmware:

http://arduino.cc/en/Hacking/DFUProgramming8U2
9  Using Arduino / Programming Questions / Re: Question about how sketch code is executed: on: April 23, 2014, 09:02:24 am
Just note the time when the pin goes low.  Each time through loop() you can then check to see if the time since then has been more than 5 seconds and act accordingly.
Code:
void loop() {
    static unsigned long timeInterrupterWentLow = 0;
.
.
.
    if (digitalRead(interrupterPin) == LOW) {
        if (timeInterrupterWentLow == 0)
            timeInterrupterWentLow = millis();
        if (millis() - timeInterrupterWentLow > 5UL*60UL*1000UL) {
           // Do Whatever You Need To Do When This Fault Occurs
        }
    } else {
        timeInterrupterWentLow = 0;
    }
.
.
.
}
10  Using Arduino / Installation & Troubleshooting / Re: Problem interfacing ArduinoMega-2560 with laptop on: April 23, 2014, 08:52:18 am
Sounds like something has gone wrong with the firmware on the ATmega8u2 used as the USB-to-Serial converter.  Here are the instructions for refreshing that firmware:

http://arduino.cc/en/Hacking/DFUProgramming8U2

11  Using Arduino / Installation & Troubleshooting / Re: Help with bootoader on a Leonardo. on: April 23, 2014, 08:49:19 am
> Yes, I just tried the process using a 10k to 5v on the reset pin of the uno. Still the same thing.
10K might not be a strong enough pull-up to prevent auto-reset.  Try 1K or go with the recommendation in the instructions you pointed to: 10 uF capacitor between Reset (+)  and Gnd (-).

> What is the -F thing it mentions,  and how can I try that?
You can't and it wouldn't help because it just suppresses the error.  You'd still be talking to the wrong processor and would get an error somewhere else.

> It's wired as per this: http://arduino.cc/en/Tutorial/ArduinoISP
They don't show the required 10 uF capacitor in the diagrams but they do mention it in two places in the instructions.
12  Using Arduino / Sensors / Re: Problems with Ultrasonic Range Finder - Maxbotix LV-EZ1 on: April 23, 2014, 08:39:39 am
Are you going for:
Quote
Control the MaxSonar Sensors to Range Simultaneously
(works for most instances)
or
Quote
Sequentially Read Each MaxSonar®
(Always Works)
?
13  Using Arduino / Programming Questions / Re: error: expected unqualified-id before '{' token on: April 22, 2014, 03:13:12 pm
Unlike some other programming languages, C++ doesn't allow functions declared inside other functions or blocks.  Look at the line being flagged and if it is the start of a new function you may not have put a close bracket on the previous function.
14  Using Arduino / Sensors / Re: Using Accelerometer to turn off blinking LED help. on: April 22, 2014, 03:07:17 pm
Code:
  if (xRead > 350 && ledPin == HIGH)
  {
  digitalWrite(ledPin, LOW);
  }

You are using ledPin wrong and not using ledOn at all.  Try this:
Code:
  if (xRead > 350)
  {
  ledOn = false;
  }
15  Using Arduino / Installation & Troubleshooting / Re: Help with bootoader on a Leonardo. on: April 22, 2014, 07:25:19 am
Did you disable reset on the UNO with a resistor (to +5)  or capacitor (to Gnd)?  If not, you end up trying to talk to the UNO which has a different signature.
Pages: [1] 2 3 ... 542