Go Down

Topic: PB2 not defined (Read 3754 times) previous topic - next topic

sirus20x6

i think i have the pb2 and portb2 stuff figured out but what cant it figure out what Serial HEX DEC and that stuff is? works with simple sketches but now when i try to build anything complicated like this

sirus20x6

anyone get this working?


DingbatCA

I am also looking for a fix to this issue

DingbatCA

ok, I took a different approach.  Working great in windows, with a 328 chip on V17.

First, you are going to need the working code :-) God bless GPL!
http://github.com/nseidle/OpenLog/tree/master/Code/

Grab sd_raw.c sd_raw.h, sd_raw_config.h
rename sd_raw.c to sd_raw.cpp

Place those 3 files in a new libraries file.  Mine looks like this "C:\Program Files (x86)\arduino-0017\hardware\libraries\sdcard"
And all 3 are in the "sdcard" dir.

Time for hello world!
Code: [Select]

#include "sd_raw_config.h"
#include "sd_raw.h"

void setup()  
{                  
 Serial.begin(9600);
}

void loop()                    
{
 sd_raw_init();
 
 struct sd_raw_info disk_info;
 if(!sd_raw_get_info(&disk_info))
 {
     //return 0;
 }
   
 Serial.println();
 Serial.print("rev:    ");
 Serial.print(disk_info.revision,HEX);
 Serial.println();
 Serial.print("serial: 0x");
 Serial.print(disk_info.serial,HEX);
 Serial.println();
 Serial.print("date:   ");
 Serial.print(disk_info.manufacturing_month,DEC);
 Serial.println();
 Serial.print(disk_info.manufacturing_year,DEC);
 Serial.println();
 Serial.print("size:   ");
 Serial.print(disk_info.capacity,DEC);
 Serial.println();
 Serial.print("copy:   ");
 Serial.print(disk_info.flag_copy,DEC);
 Serial.println();
 Serial.print("wr.pr.: ");
 Serial.print(disk_info.flag_write_protect_temp,DEC);
 Serial.print('/');
 Serial.print(disk_info.flag_write_protect,DEC);
 Serial.println();
 Serial.print("format: ");
 Serial.print(disk_info.format,DEC);
 Serial.println();
 Serial.print("free:   ");
 delay(10000);
}


You should see something like this show up:
Code: [Select]

rev:    3
serial: 0x3032057D
date:   7
5
size:   125698048
copy:   0
wr.pr.: 0/0
format: 0
free:   1


Next on the list.. Round Robin FS(RRFS)!

Crock

Hi.  I've read through everyone's postings, and I'm down to just this one error -- which I can't find a solution to.  Has anyone figured this one out?  Thanks much!!!


C:\Desktop\Arduino\arduino-0018\libraries\SDcard\fat.cpp: In function 'uint8_t fat_dir_entry_read_callback(uint8_t*, offset_t, void*)':

C:\Desktop\Arduino\arduino-0018\libraries\SDcard\fat.cpp:1555: error: invalid conversion from 'void*' to 'fat_read_dir_callback_arg*'

Crock

Okay, following up on my own question.  The problem seems to be that renaming fat.c to fat.cpp actually creates more problems then it solves.  A better way (in my opinion) is to leave it named fat.c and fix all the "for loop" errors by moving the variable declarations outside the loop.  After doing this, I am now able to compile....

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy