Hi everybody!
I have a problem with the combination of OpenLog (Sparkfun) and Arduino Micro!
The communication with Arduino Micro to OpenLog is on Serial1 (Pin 0 and 1)
The status led (blue) on OpenLog is indicating that serial data is received (test code see below)
the problem:
sd card is empty!
Settings:
micro sd card, formatted to Fat32 with windows8, 3.64 GB
TX (Ard) -> RXI (OpenLog)
Pin5(Ard) -> VCC (OpenLog)
GND(Ard) -> GND
A similar code was working with Arduino Uno.
Any ideas whats the problem?
int ledPin = 13; //Status LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(5,OUTPUT); //power for open log
digitalWrite(5,HIGH); //power for open log
delay(1000); //Wait a second for OpenLog to init
Serial1.begin(9600); //9600bps is default for OpenLog
delay(1000);
Serial1.println();
Serial1.println("Run OpenLog Test");
delay(500);
}
void loop()
{
int testAmt = 4;
//Each test is 100 lines. 10 tests is 1000 lines (11,000 characters)
for(int numofTests = 0 ; numofTests < testAmt ; numofTests++)
{
//This loop will print 100 lines of 110 characters each
for(int k = 33; k < 43 ; k++)
{
//Print one line of 110 characters with marker in the front (markers go from '!' to '*')
Serial1.write(k); //Print the ASCII value directly: ! then " then #, etc
Serial1.println(":abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-!#");
//Then print 9 lines of 110 characters with new line at the end of the line
for(int i = 1 ; i < 10 ; i++)
{
Serial1.print(i, DEC);
Serial1.println(":abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-!#");
delay(500);
}
if(digitalRead(ledPin) == 0) //Turn the status LED on/off as we go
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
}
} //End numofTests loop
delay(500);
unsigned long totalCharacters = (long)testAmt * 100 * 110;
Serial1.print("Characters pushed: ");
Serial1.println(totalCharacters);
Serial1.print("Time taken (s): ");
Serial1.println(millis()/1000);
Serial1.println("Done!");
while(true)
{
//Blink the Status LED because we're done!
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
delay(100);
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
delay(5000);
}
}