Show Posts
Pages: [1]
1  Using Arduino / Storage / Re: sd.h causing output pins to stop working on: March 11, 2012, 05:55:19 pm
Just adding SD.h takes over 500 bytes of additional RAM and this may cause your program to fail if you are already using a lot of RAM.
So if this is the case, how do you free up some ram without affecting my functional program.
I just checked when I compile that my program is saying "Binary sketch size: 9378 bytes (of a 32256 byte maximum)" and when I add the include SD.h the output is "Binary sketch size: 13412 bytes (of a 32256 byte maximum)"

I have also the same problem smiley-cry smiley-cry smiley-cry  when i'm trying to combine tvout(which uses output pin)with the sd.h or other sd libraries.
When i put the sd library,the tvout demoPAL stop playing.After searching a lot,i found that someone found a solution
to make the output pins working the output pins
but i can't understand what is he saying...Could anyone help???

link:http://code.google.com/p/arduino-tvout/issues/detail?id=40
I checked that out and I understand what he is doing but I don't know what parts of the SD library he changed.
2  Using Arduino / Storage / Re: sd.h causing output pins to stop working on: February 28, 2012, 07:25:36 pm
Quote
I am changing it in my program here
#define LEDPin 2
after I call the include
Saying "I am going to talk to pin 2" and saying "pinMode(2, OUTPUT);" are not quite the same thing, are they?

If you want to turn an LED on, you must connect it to a pin whose mode is OUTPUT. The pins are all INPUT by default.

you don't know what I am talking about and your starting to get off topic. I am having a problem with #include <SD.h>

In my program I use #define LEDPin 2 as a constant so I am not repeating changes several times in my program. So be more specific:

At the start I have
Code:
#include <SD.h>
#define LEDPin 2

In setup() I have
Code:
pinMode(LEDPin, OUTPUT);
pinMode(10, OUTPUT);
if (!SD.begin(4)) {
  Serial.println("initialization failed!");
}

And in loop() I have a bunch of things that make the LED go ON and OFF

Now to get back on topic the problem is that as soon as I add any code related to the SD Library (even the include statement) my led will stop working no matter what pin I have it on.
3  Using Arduino / Storage / Re: sd.h causing output pins to stop working on: February 28, 2012, 02:55:22 pm
I meant to say in that sentence "... flashes but it I add it the led ..." it is suppose to be "when"

I am changing it in my program here
#define LEDPin 2
after I call the include

When I said changed to pin 2 I meant that that is the current pin that it is on as of now.

I know this is hard to understand without me showing you my whole code but I prefer not to display it yet.
4  Using Arduino / Storage / sd.h causing output pins to stop working on: February 28, 2012, 02:01:43 am
I have been working on a morse code program that will flash an led on pin 13 and also connect to my phone via bluetooth (pin 0/1) to send a new message for the program to decode and flash.
I recently got the Ethernet shield and was excited about the SD card slot. I put it on and tried a few of the examples first to get a feel for it, then all I did was add a few lines to my original program and now any pin that I setup will not flash the LED. I changed the led pin to 2 now and found out that by removing the (#include <SD.h>) from the program the led flashes but it I add it the led stops working. And this will happen for any pin that I select. Now it seems odd just by adding one line to a program will stop all output pin traffic.

All I added to my program was:
Code:
#include <SD.h>
void setup(){
 pinMode(10, OUTPUT);
 if (!SD.begin(4)) {
  Serial.println("initialization failed!");
 }
}

And if you must know I am using the Arduino Uno R3, Ethernet Shield R3, Developer Software 1.0

Any ideas of why this might be happening please. I wanna take this in and show the guys at work.
Pages: [1]