This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19d3d44
commit cb7eaa5
Showing
414 changed files
with
16,449 additions
and
16,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Features have been added to support an unmodified Adafruit GPS Shield | ||
or Datalogging Shield on an Arduino Mega. | ||
Define MEGA_SOFT_SPI to be non-zero in SdFatConfig.h to use software SPI | ||
on Mega Arduinos. Pins used are SS 10, MOSI 11, MISO 12, and SCK 13. | ||
Defining MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be | ||
used on Mega Arduinos. Software SPI works well with GPS Shield V1.1 | ||
but many SD cards will fail with GPS Shield V1.0. | ||
Software SPI should work with all Datalogging Shields. | ||
The examples SdFatGPS_CSVSensorLogger.pde and SdFatGPSLogger_v3.pde | ||
Features have been added to support an unmodified Adafruit GPS Shield | ||
or Datalogging Shield on an Arduino Mega. | ||
|
||
Define MEGA_SOFT_SPI to be non-zero in SdFatConfig.h to use software SPI | ||
on Mega Arduinos. Pins used are SS 10, MOSI 11, MISO 12, and SCK 13. | ||
|
||
Defining MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be | ||
used on Mega Arduinos. Software SPI works well with GPS Shield V1.1 | ||
but many SD cards will fail with GPS Shield V1.0. | ||
|
||
Software SPI should work with all Datalogging Shields. | ||
|
||
The examples SdFatGPS_CSVSensorLogger.pde and SdFatGPSLogger_v3.pde | ||
should work on on the Mega when MEGA_SOFT_SPI is defined. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
SdFat has support for multiple SD cards. This requires multiple instances | ||
of SdFat objects. | ||
You must edit SdFatConfig.h to enable multiple instances of SdFat. Set | ||
USE_MULTIPLE_CARDS nonzero like this: | ||
#define USE_MULTIPLE_CARDS 1 | ||
Look at TwoCards.pde in the SdFat/examples folder. This example demonstrates | ||
use of two SD cards. | ||
Read WorkingDirectory.txt for more information on volume working | ||
directories and the current working directory. | ||
SdFat has support for multiple SD cards. This requires multiple instances | ||
of SdFat objects. | ||
|
||
You must edit SdFatConfig.h to enable multiple instances of SdFat. Set | ||
USE_MULTIPLE_CARDS nonzero like this: | ||
|
||
#define USE_MULTIPLE_CARDS 1 | ||
|
||
Look at TwoCards.pde in the SdFat/examples folder. This example demonstrates | ||
use of two SD cards. | ||
|
||
Read WorkingDirectory.txt for more information on volume working | ||
directories and the current working directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
For those who don't like too much documentation. | ||
To use this library place the SdFat folder into the libraries | ||
subfolder in your main sketches folder. You may need to | ||
create the libraries folder. Restart the Arduino IDE if | ||
it was open. | ||
Run the QuickStart.pde sketch from the | ||
libraries/SdFat/examples/QuickStart folder. Click the | ||
IDE up-arrow icon then -> libraries -> SdFat -> QuickStart. | ||
You can also click File -> Examples -> SdFat -> QuickStart. | ||
If problems occur try reading more documentation and use these | ||
forums for help: | ||
http://forums.adafruit.com/ | ||
http://arduino.cc/forum/ | ||
If QuickStart.pde runs successfully try more examples. | ||
For those who don't like too much documentation. | ||
|
||
To use this library place the SdFat folder into the libraries | ||
subfolder in your main sketches folder. You may need to | ||
create the libraries folder. Restart the Arduino IDE if | ||
it was open. | ||
|
||
Run the QuickStart.pde sketch from the | ||
libraries/SdFat/examples/QuickStart folder. Click the | ||
IDE up-arrow icon then -> libraries -> SdFat -> QuickStart. | ||
|
||
You can also click File -> Examples -> SdFat -> QuickStart. | ||
|
||
If problems occur try reading more documentation and use these | ||
forums for help: | ||
|
||
http://forums.adafruit.com/ | ||
|
||
http://arduino.cc/forum/ | ||
|
||
If QuickStart.pde runs successfully try more examples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<html> | ||
<head> | ||
<title>A web page that points a browser to a different page</title> | ||
<meta http-equiv="refresh" content="0; URL=html/index.html"> | ||
<meta name="keywords" content="automatic redirection"> | ||
</head> | ||
<body> | ||
Your browser didn't automatically redirect. Open html/index.html manually. | ||
</body> | ||
</html> | ||
<html> | ||
<head> | ||
<title>A web page that points a browser to a different page</title> | ||
<meta http-equiv="refresh" content="0; URL=html/index.html"> | ||
<meta name="keywords" content="automatic redirection"> | ||
</head> | ||
<body> | ||
Your browser didn't automatically redirect. Open html/index.html manually. | ||
</body> | ||
</html> |
232 changes: 116 additions & 116 deletions
232
libs/SdFatBeta20120108/SdFat/ArduinoStream.h
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,116 @@ | ||
/* Arduino SdFat Library | ||
* Copyright (C) 2009 by William Greiman | ||
* | ||
* This file is part of the Arduino SdFat Library | ||
* | ||
* This Library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This Library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with the Arduino SdFat Library. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef ArduinoStream_h | ||
#define ArduinoStream_h | ||
/** | ||
* \file | ||
* \brief ArduinoInStream and ArduinoOutStream classes | ||
*/ | ||
#include "../../libs/SdFatBeta20120108/SdFat/bufstream.h" | ||
//============================================================================== | ||
/** | ||
* \class ArduinoInStream | ||
* \brief Input stream for Arduino Stream objects | ||
*/ | ||
class ArduinoInStream : public ibufstream { | ||
public: | ||
/** | ||
* Constructor | ||
* \param[in] hws hardware stream | ||
* \param[in] buf buffer for input line | ||
* \param[in] size size of input buffer | ||
*/ | ||
ArduinoInStream(Stream &hws, char* buf, uint16_t size) { | ||
hw_ = &hws; | ||
line_ = buf; | ||
size_ = size; | ||
} | ||
/** read a line. */ | ||
void readline() { | ||
uint16_t i = 0; | ||
uint32_t t; | ||
line_[0] = '\0'; | ||
while (!hw_->available()); | ||
|
||
while (1) { | ||
t = millis(); | ||
while (!hw_->available()) { | ||
if ((millis() - t) > 10) goto done; | ||
} | ||
if (i >= (size_ - 1)) { | ||
setstate(failbit); | ||
return; | ||
} | ||
line_[i++] = hw_->read(); | ||
line_[i] = '\0'; | ||
} | ||
done: | ||
init(line_); | ||
} | ||
protected: | ||
/** Internal - do not use. | ||
* \param[in] off | ||
* \param[in] way | ||
* \return true/false. | ||
*/ | ||
bool seekoff(off_type off, seekdir way) {return false;} | ||
/** Internal - do not use. | ||
* \param[in] pos | ||
* \return true/false. | ||
*/ | ||
bool seekpos(pos_type pos) {return false;} | ||
private: | ||
char *line_; | ||
uint16_t size_; | ||
Stream* hw_; | ||
}; | ||
//============================================================================== | ||
/** | ||
* \class ArduinoOutStream | ||
* \brief Output stream for Arduino Print objects | ||
*/ | ||
class ArduinoOutStream : public ostream { | ||
public: | ||
/** constructor | ||
* | ||
* \param[in] pr Print object for this ArduinoOutStream. | ||
*/ | ||
explicit ArduinoOutStream(Print& pr) : pr_(&pr) {} | ||
protected: | ||
/// @cond SHOW_PROTECTED | ||
/** | ||
* Internal do not use | ||
* \param[in] c | ||
*/ | ||
void putch(char c) { | ||
if (c == '\n') pr_->write('\r'); | ||
pr_->write(c); | ||
} | ||
void putstr(const char* str) {pr_->write(str);} | ||
bool seekoff(off_type off, seekdir way) {return false;} | ||
bool seekpos(pos_type pos) {return false;} | ||
bool sync() {return true;} | ||
pos_type tellpos() {return 0;} | ||
/// @endcond | ||
private: | ||
ArduinoOutStream() {} | ||
Print* pr_; | ||
}; | ||
#endif // ArduinoStream_h | ||
/* Arduino SdFat Library | ||
* Copyright (C) 2009 by William Greiman | ||
* | ||
* This file is part of the Arduino SdFat Library | ||
* | ||
* This Library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This Library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with the Arduino SdFat Library. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef ArduinoStream_h | ||
#define ArduinoStream_h | ||
/** | ||
* \file | ||
* \brief ArduinoInStream and ArduinoOutStream classes | ||
*/ | ||
#include <bufstream.h> | ||
//============================================================================== | ||
/** | ||
* \class ArduinoInStream | ||
* \brief Input stream for Arduino Stream objects | ||
*/ | ||
class ArduinoInStream : public ibufstream { | ||
public: | ||
/** | ||
* Constructor | ||
* \param[in] hws hardware stream | ||
* \param[in] buf buffer for input line | ||
* \param[in] size size of input buffer | ||
*/ | ||
ArduinoInStream(Stream &hws, char* buf, uint16_t size) { | ||
hw_ = &hws; | ||
line_ = buf; | ||
size_ = size; | ||
} | ||
/** read a line. */ | ||
void readline() { | ||
uint16_t i = 0; | ||
uint32_t t; | ||
line_[0] = '\0'; | ||
while (!hw_->available()); | ||
|
||
while (1) { | ||
t = millis(); | ||
while (!hw_->available()) { | ||
if ((millis() - t) > 10) goto done; | ||
} | ||
if (i >= (size_ - 1)) { | ||
setstate(failbit); | ||
return; | ||
} | ||
line_[i++] = hw_->read(); | ||
line_[i] = '\0'; | ||
} | ||
done: | ||
init(line_); | ||
} | ||
protected: | ||
/** Internal - do not use. | ||
* \param[in] off | ||
* \param[in] way | ||
* \return true/false. | ||
*/ | ||
bool seekoff(off_type off, seekdir way) {return false;} | ||
/** Internal - do not use. | ||
* \param[in] pos | ||
* \return true/false. | ||
*/ | ||
bool seekpos(pos_type pos) {return false;} | ||
private: | ||
char *line_; | ||
uint16_t size_; | ||
Stream* hw_; | ||
}; | ||
//============================================================================== | ||
/** | ||
* \class ArduinoOutStream | ||
* \brief Output stream for Arduino Print objects | ||
*/ | ||
class ArduinoOutStream : public ostream { | ||
public: | ||
/** constructor | ||
* | ||
* \param[in] pr Print object for this ArduinoOutStream. | ||
*/ | ||
explicit ArduinoOutStream(Print& pr) : pr_(&pr) {} | ||
protected: | ||
/// @cond SHOW_PROTECTED | ||
/** | ||
* Internal do not use | ||
* \param[in] c | ||
*/ | ||
void putch(char c) { | ||
if (c == '\n') pr_->write('\r'); | ||
pr_->write(c); | ||
} | ||
void putstr(const char* str) {pr_->write(str);} | ||
bool seekoff(off_type off, seekdir way) {return false;} | ||
bool seekpos(pos_type pos) {return false;} | ||
bool sync() {return true;} | ||
pos_type tellpos() {return 0;} | ||
/// @endcond | ||
private: | ||
ArduinoOutStream() {} | ||
Print* pr_; | ||
}; | ||
#endif // ArduinoStream_h |
Oops, something went wrong.