Show Posts
Pages: [1] 2 3 ... 3235
1  Using Arduino / Programming Questions / Re: Arduino Program Stop Working after 1 sec on: Today at 08:25:29 am
Code:
Motor::Motor(int pin)
    {
        pinMode(pin, OUTPUT);
        _pin = pin;
    }
When is your constructor called? Before init()? Or after init()? If you don't know, don't diddle with the hardware in the constructor.

Code:
QueueArray <Node> Pattern::setPattern(int amplitude[4],unsigned long duration[4]){
    QueueArray <Node> queue;
    unsigned long nodeDurationSum = 0;
    for (int i=0;i<4;i++){
    Node node;
    nodeDurationSum = nodeDurationSum + duration[i]; //the reference for duration calculation is patternStartTime
    node.setPatternNode(amplitude[i],nodeDurationSum);
    queue.enqueue(node);
    }
    return queue;
}
What happens to the Node instance when this function ends? What effect does that have on the queued data?

This is really complicated, memory intensive code for use on a limited memory Arduino.
2  Using Arduino / Programming Questions / Re: TFT connected = no IP from DHCP. Not connected = Get IP. on: Today at 08:16:44 am
Quote
Might be something totaly different but eh, better to much then to little info.
Like maybe running out of memory?

http://playground.arduino.cc/Code/AvailableMemory
3  Using Arduino / Programming Questions / Re: TFT connected = no IP from DHCP. Not connected = Get IP. on: Today at 06:52:03 am
Quote
I am tinkering around with the arduino ethernet shield and the TFT LCD.
Perhaps a peek at the Arduino product page is in order. Notice that there are LOTS of Arduinos available, with different speeds, number of pins, and amount of memory.

Which one are YOU using?
4  Using Arduino / Programming Questions / Re: RGB strip brightness problem controlled via IR remote on: Today at 06:29:38 am
Code:
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
    // sets the value (range from 0 to 255):
    analogWrite(ledg, fadeValue);   

  }
How long do you think it will take this code to execute?
5  Using Arduino / Programming Questions / Re: Combining Codes - LED with pushbutton and timer interrupt on: Today at 06:25:24 am
Quote
Ideally, I should be able to push the button down once, and have the LED turn on for half a second.
The state change detection example also bears looking at. It shows how to do stuff when a switch BECOMES pressed (or released) rather than when the switch IS pressed or released.
6  Using Arduino / Programming Questions / Re: Performance: F("string") in a function on: Today at 06:22:31 am
Quote
No, there is a definite advantage to putting the string in flash.
The string is in flash, too. That's where it would be copied to SRAM from.

What I think you mean is that there is a definite advantage, by using F(), in keeping the string out of SRAM.
7  Using Arduino / Programming Questions / Re: Toggle an LED using 2 Xbees on: Today at 06:19:53 am
Ok, I fixed it!

It was getting all of these multiple sends of 'S', so what I tried doing was not filtering it on the slave side, but rather I added a 200ms delay after the 'S' button was pushed on the master RC side .  When I used the serial monitor on the slave, it then showed  only 1 instance coming through for 'S' per button push.

I originally had the delay only at 20 ms, but that apparently was too small.

Thanks for you help - it led me to try out some different ideas and got it working now 100% per toggle!

You don't need ANY delays on the sender. What you DO need is to look at the state change detection example. Send a value only when the switch BECOMES pressed.
8  Using Arduino / Programming Questions / Re: Using Leonardo and getting absolute x,y Mouse values on: Today at 06:15:49 am
Quote
and no matter what permutation of values I use with the native map method, I can't get it to work properly.
Can't get what to work properly? I don't see any code. All I see is a whine. Can't help you with that.
9  Using Arduino / Programming Questions / Re: aquarium auto fertilizer code check on: Today at 06:09:32 am
You've got a real-time clock and a bunch of delays in your code. I really don't understand that. You know, to the second, when to turn the first pump on and off, when to turn the second pump on and off, and when to turn the third pump on and off.

Make use of now.second() and ditch all those delay()s.
10  Using Arduino / Programming Questions / Re: Interrupts & Servos on: Today at 05:51:50 am
Quote
Yes but the rest does not. OP needs to learn to read the code ne has writen.
Among other things, you misspelled stolen.
11  Using Arduino / Programming Questions / Re: Demo of merging the code from two sketches on: Today at 05:48:29 am
Quote
There are many other changes that could be considered but I have deliberately stayed as close as possible to the original code from the examples.
The thing that you did that separates you from those that can't figure out how to merge two sketches was to start with an understanding of:
1) What the original sketches do
2) What the merged sketch should do.

Without those two items, no amount of explanation is useful.

Nice try, though.
12  Using Arduino / Programming Questions / Re: Controlling an actuator using arduino CAN shield on: Today at 05:29:55 am
Quote
I was thinking that I could somehow apply this code to achieve it by incorporating CAN code.
You need to start with defining your requirements better. Controlling an actuator using a CAN shield is meaningless. What value(s) from the CAN shield should "control" the actuator? What is the relationship between the CAN shield value and the position of the actuator?

Can you control that actuator in any fashion now?
13  Using Arduino / Programming Questions / Re: Is there something wrong with gsm shield ?? on: Today at 05:24:13 am
Quote
Do you know someone what problem  ist here ??
No code.
No description of how the device is powered.
No mention of where in the world you are.

So, I really don't expect anything to work. Your mileage may vary.
14  Using Arduino / Programming Questions / Re: Time.h compiling error on: July 11, 2014, 12:02:21 pm
Quote
Exactly the same as I'm using.  But it isn't compiling.
In the interest of complete disclosure, I'm using Win7 64 bit. You?
15  Using Arduino / Programming Questions / Re: Out of memory, how to reduce this program's size on: July 11, 2014, 12:00:22 pm
Code:
  Serial.print("ArduinoIMU starting using device "); Serial.println(imu->IMUName());
The string literals end up in SRAM, unless you take action to keep them out. Fortunately, that is very easy:
  Serial.print(F("ArduinoIMU starting using device ")); Serial.println(imu->IMUName());
Pages: [1] 2 3 ... 3235