greiman / petitfs Goto Github PK
View Code? Open in Web Editor NEWPetit FatFs Arduino Library
Petit FatFs Arduino Library
please add more examples to it.
thanks.
Hi,
I'm trying to write a string to an empty file in the root of SD but the file is empty and all function return FR_OK
here is a simple example
#include "PetitFS.h"
#include "PetitSerial.h"
PetitSerial PS;
#define Serial PS
// The SD chip select pin is currently defined as 10
// in pffArduino.h. Edit pffArduino.h to change the CS pin.
FATFS fs;
void setup()
{
Serial.begin(9600);
char* buf = "Hello World!\r\n";
pf_mount(&fs);
pf_open("TEST.TXT");
UINT n;
Serial.print("Buff:");
Serial.println(buf);
pf_write(buf,strlen(buf),&n);
pf_write(0,0,&n);
Serial.println("Done");
}
void loop() {}
I think I am missing some steps in the manual.
EDIT:
I fixed it with just putting a large dummy text file. but my problem is how can I append to end of file is there any workaround for that?
Thanks.
Do you think it's possible to add exFAT support? I'm interested in using PetitFS, but I need exFAT compatibility.
Is it hard to add the exFAT code from FatFS?
Hi @greiman, is this compatible with Arduino MEGA2560 ?
Hello, I'm trying to use PetitFS in my project. On original Arduino Nano working fine but when I switch to LGT8F328P there is initialization problem even when I switch to 16MHz. Could anyone help me with that?
Hi, I faced the following issue using the zipped version. Arduino simply cannot compile it :((
PetitFS:8:1: error: 'PetitSerial' does not name a type; did you mean 'PetitSerial_h'?
PetitSerial PS;
^~~~~~~~~~~
PetitSerial_h
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino: In function 'void errorHalt(char*)':
PetitFS:10:16: error: 'PS' was not declared in this scope
#define Serial PS
^
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:18:3: note: in expansion of macro 'Serial'
Serial.print("Error: ");
^~~~~~
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:10:16: note: suggested alternative: 'PI'
#define Serial PS
^
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:18:3: note: in expansion of macro 'Serial'
Serial.print("Error: ");
^~~~~~
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino: In function 'void test()':
PetitFS:10:16: error: 'PS' was not declared in this scope
#define Serial PS
^
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:37:5: note: in expansion of macro 'Serial'
Serial.write(buf, nr);
^~~~~~
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:10:16: note: suggested alternative: 'PI'
#define Serial PS
^
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:37:5: note: in expansion of macro 'Serial'
Serial.write(buf, nr);
^~~~~~
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino: In function 'void setup()':
PetitFS:10:16: error: 'PS' was not declared in this scope
#define Serial PS
^
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:42:3: note: in expansion of macro 'Serial'
Serial.begin(9600);
^~~~~~
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:10:16: note: suggested alternative: 'PI'
#define Serial PS
^
C:\Users\Jamesong7822\Documents\Arduino\libraries\PetitFS-master\examples\PetitFS\PetitFS.ino:42:3: note: in expansion of macro 'Serial'
Serial.begin(9600);
^~~~~~
exit status 1
'PetitSerial' does not name a type; did you mean 'PetitSerial_h'?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.