Skip to content

Commit

Permalink
Rewriting examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Seidle committed Feb 9, 2018
1 parent e4bdee0 commit 55df7ec
Show file tree
Hide file tree
Showing 15 changed files with 441 additions and 330 deletions.
207 changes: 39 additions & 168 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,171 +1,42 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#############
## Eagle
#############

# Ignore the board and schematic backup files
*.b#?
*.s#?


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover

## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML


############
## Windows
############

# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
# Windows image file caches
Thumbs.db
ehthumbs.db

#Eagle Backup files
*.s#?
*.b#?
*.l#?
*.lck

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

#Translations
*.mo
# Icon must ends with two \r.
Icon

#Mr Developer
.mr.developer.cfg
# Thumbnails
._*

# Mac crap
.DS_Store
# Files that might appear on external disk
.Spotlight-V100
.Trashes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
Recording to OpenLog example
By: Nathan Seidle
SparkFun Electronics
Date: February 8th, 2018
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
This is an example of basic recording to OpenLog using software serial. This example is best for users who
want to use OpenLog with an Uno or other platform capable of softwareSerial.
Connect the following OpenLog to Arduino:
RXI of OpenLog to pin 5 on Arduino
VCC to 5V
GND to GND
This example records whatever the user OpenLog.prints(). This uses software serial on pin 5 instead
of hardware serial (TX/RX pins). Nearly any pin can be used for software serial.
*/

#include <SoftwareSerial.h>

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//Connect RXI of OpenLog to pin 5 on Arduino
SoftwareSerial OpenLog(0, 5); // 0 = Soft RX pin (not used), 5 = Soft TX pin
//5 can be changed to any pin. See limitation section on https://www.arduino.cc/en/Reference/SoftwareSerial
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

int statLED = 13;

float dummyVoltage = 3.50; //This just shows to to write variables to OpenLog

void setup() {
pinMode(statLED, OUTPUT);
Serial.begin(9600);

OpenLog.begin(9600); //Open software serial port at 9600bps

Serial.println("This serial prints to the COM port");
OpenLog.println("This serial records to the OpenLog text file");

//Write something to OpenLog
OpenLog.println("Hi there! How are you today?");
OpenLog.print("Voltage: ");
OpenLog.println(dummyVoltage);
dummyVoltage++;
OpenLog.print("Voltage: ");
OpenLog.println(dummyVoltage);

Serial.println("Text written to file. Go look!");
}

void loop() {
digitalWrite(statLED, HIGH);
delay(1000);
digitalWrite(statLED, LOW);
delay(1000);
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
Recording to OpenLog example
By: Nathan Seidle
SparkFun Electronics
Date: February 8th, 2018
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
This is an example of basic recording to OpenLog using hardware serial. This example is best for users who
are plugging the OpenLog directly onto the programming connector on an Arduino Pro Mini or Arduino Pro.
We DON'T recommend this method for beginners. See Example 1 for an easier software serial example.
The reason is if you upload a sketch to an Arduino with OpenLog attached then OpenLog will log the
uploading of your sketch. This may cause the OpenLog to become reconfigured. No harm will be
caused but it can corrupt the log file.
Connect the following OpenLog to Arduino:
RXI of OpenLog to TX on Arduino
VCC to 5V
GND to GND
This example records whatever the user Serial.prints(). This is the easiest but NOTE: You cannot
upload sketches to your Arduino with the OpenLog attached (because of bus contention). Upload this
sketch first, and then connect the OpenLog to the TX pin on the Arduino.
*/

int statLED = 13;

float dummyVoltage = 3.50; //This just shows to to write variables to OpenLog

void setup() {
pinMode(statLED, OUTPUT);
Serial.begin(9600);

Serial.println("Example print to OpenLog");

Serial.println("Anything printed to COM port gets logged!");

//Write something to OpenLog
Serial.println("Hi there! How are you today?");
Serial.print("Voltage: ");
Serial.println(dummyVoltage);
dummyVoltage++;
Serial.print("Voltage: ");
Serial.println(dummyVoltage);
}

void loop() {
digitalWrite(statLED, HIGH);
delay(1000);
digitalWrite(statLED, LOW);
delay(1000);
}

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Example of reading the disk properties on OpenLog
Example of creating a file, reading a file, and reading the disk properties on OpenLog
By: Nathan Seidle
SparkFun Electronics
Date: September 22nd, 2013
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
This is an example of issuing the 'disk' command and seeing how big the current SD card is.
This example creates a new file, writes to it, then reads it back, then reports the SD card details.
Connect the following OpenLog to Arduino:
RXI of OpenLog to pin 2 on the Arduino
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Example of reading of a large file
Example of reading of a large file and outputting to a different software serial port (like Bluetooth)
By: Nathan Seidle
SparkFun Electronics
Date: September 22nd, 2013
Expand Down
Loading

0 comments on commit 55df7ec

Please sign in to comment.