Skip to content

Commit 55df7ec

Browse files
author
Nathan Seidle
committed
Rewriting examples.
1 parent e4bdee0 commit 55df7ec

File tree

15 files changed

+441
-330
lines changed

15 files changed

+441
-330
lines changed

.gitignore

Lines changed: 39 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,42 @@
1-
#################
2-
## Eclipse
3-
#################
4-
5-
*.pydevproject
6-
.project
7-
.metadata
8-
bin/
9-
tmp/
10-
*.tmp
11-
*.bak
12-
*.swp
13-
*~.nib
14-
local.properties
15-
.classpath
16-
.settings/
17-
.loadpath
18-
19-
# External tool builders
20-
.externalToolBuilders/
21-
22-
# Locally stored "Eclipse launch configurations"
23-
*.launch
24-
25-
# CDT-specific
26-
.cproject
27-
28-
# PDT-specific
29-
.buildpath
30-
31-
32-
#############
33-
## Eagle
34-
#############
35-
36-
# Ignore the board and schematic backup files
37-
*.b#?
38-
*.s#?
39-
40-
41-
#################
42-
## Visual Studio
43-
#################
44-
45-
## Ignore Visual Studio temporary files, build results, and
46-
## files generated by popular Visual Studio add-ons.
47-
48-
# User-specific files
49-
*.suo
50-
*.user
51-
*.sln.docstates
52-
53-
# Build results
54-
[Dd]ebug/
55-
[Rr]elease/
56-
*_i.c
57-
*_p.c
58-
*.ilk
59-
*.meta
60-
*.obj
61-
*.pch
62-
*.pdb
63-
*.pgc
64-
*.pgd
65-
*.rsp
66-
*.sbr
67-
*.tlb
68-
*.tli
69-
*.tlh
70-
*.tmp
71-
*.vspscc
72-
.builds
73-
*.dotCover
74-
75-
## TODO: If you have NuGet Package Restore enabled, uncomment this
76-
#packages/
77-
78-
# Visual C++ cache files
79-
ipch/
80-
*.aps
81-
*.ncb
82-
*.opensdf
83-
*.sdf
84-
85-
# Visual Studio profiler
86-
*.psess
87-
*.vsp
88-
89-
# ReSharper is a .NET coding add-in
90-
_ReSharper*
91-
92-
# Installshield output folder
93-
[Ee]xpress
94-
95-
# DocProject is a documentation generator add-in
96-
DocProject/buildhelp/
97-
DocProject/Help/*.HxT
98-
DocProject/Help/*.HxC
99-
DocProject/Help/*.hhc
100-
DocProject/Help/*.hhk
101-
DocProject/Help/*.hhp
102-
DocProject/Help/Html2
103-
DocProject/Help/html
104-
105-
# Click-Once directory
106-
publish
107-
108-
# Others
109-
[Bb]in
110-
[Oo]bj
111-
sql
112-
TestResults
113-
*.Cache
114-
ClientBin
115-
stylecop.*
116-
~$*
117-
*.dbmdl
118-
Generated_Code #added for RIA/Silverlight projects
119-
120-
# Backup & report files from converting an old project file to a newer
121-
# Visual Studio version. Backup files are not needed, because we have git ;-)
122-
_UpgradeReport_Files/
123-
Backup*/
124-
UpgradeLog*.XML
125-
126-
127-
############
128-
## Windows
129-
############
130-
131-
# Windows image file caches
132-
Thumbs.db
133-
134-
# Folder config file
135-
Desktop.ini
136-
137-
138-
#############
139-
## Python
140-
#############
141-
142-
*.py[co]
143-
144-
# Packages
145-
*.egg
146-
*.egg-info
147-
dist
148-
build
149-
eggs
150-
parts
151-
bin
152-
var
153-
sdist
154-
develop-eggs
155-
.installed.cfg
156-
157-
# Installer logs
158-
pip-log.txt
159-
160-
# Unit test / coverage reports
161-
.coverage
162-
.tox
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
5+
#Eagle Backup files
6+
*.s#?
7+
*.b#?
8+
*.l#?
9+
*.lck
10+
11+
# Folder config file
12+
Desktop.ini
13+
14+
# Recycle Bin used on file shares
15+
$RECYCLE.BIN/
16+
17+
# Windows Installer files
18+
*.cab
19+
*.msi
20+
*.msm
21+
*.msp
22+
23+
# =========================
24+
# Operating System Files
25+
# =========================
26+
27+
# OSX
28+
# =========================
29+
30+
.DS_Store
31+
.AppleDouble
32+
.LSOverride
16333

164-
#Translations
165-
*.mo
34+
# Icon must ends with two \r.
35+
Icon
16636

167-
#Mr Developer
168-
.mr.developer.cfg
37+
# Thumbnails
38+
._*
16939

170-
# Mac crap
171-
.DS_Store
40+
# Files that might appear on external disk
41+
.Spotlight-V100
42+
.Trashes
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Recording to OpenLog example
3+
By: Nathan Seidle
4+
SparkFun Electronics
5+
Date: February 8th, 2018
6+
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
7+
8+
This is an example of basic recording to OpenLog using software serial. This example is best for users who
9+
want to use OpenLog with an Uno or other platform capable of softwareSerial.
10+
11+
Connect the following OpenLog to Arduino:
12+
RXI of OpenLog to pin 5 on Arduino
13+
VCC to 5V
14+
GND to GND
15+
16+
This example records whatever the user OpenLog.prints(). This uses software serial on pin 5 instead
17+
of hardware serial (TX/RX pins). Nearly any pin can be used for software serial.
18+
*/
19+
20+
#include <SoftwareSerial.h>
21+
22+
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
23+
//Connect RXI of OpenLog to pin 5 on Arduino
24+
SoftwareSerial OpenLog(0, 5); // 0 = Soft RX pin (not used), 5 = Soft TX pin
25+
//5 can be changed to any pin. See limitation section on https://www.arduino.cc/en/Reference/SoftwareSerial
26+
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
27+
28+
int statLED = 13;
29+
30+
float dummyVoltage = 3.50; //This just shows to to write variables to OpenLog
31+
32+
void setup() {
33+
pinMode(statLED, OUTPUT);
34+
Serial.begin(9600);
35+
36+
OpenLog.begin(9600); //Open software serial port at 9600bps
37+
38+
Serial.println("This serial prints to the COM port");
39+
OpenLog.println("This serial records to the OpenLog text file");
40+
41+
//Write something to OpenLog
42+
OpenLog.println("Hi there! How are you today?");
43+
OpenLog.print("Voltage: ");
44+
OpenLog.println(dummyVoltage);
45+
dummyVoltage++;
46+
OpenLog.print("Voltage: ");
47+
OpenLog.println(dummyVoltage);
48+
49+
Serial.println("Text written to file. Go look!");
50+
}
51+
52+
void loop() {
53+
digitalWrite(statLED, HIGH);
54+
delay(1000);
55+
digitalWrite(statLED, LOW);
56+
delay(1000);
57+
}
58+
59+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
Recording to OpenLog example
3+
By: Nathan Seidle
4+
SparkFun Electronics
5+
Date: February 8th, 2018
6+
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
7+
8+
This is an example of basic recording to OpenLog using hardware serial. This example is best for users who
9+
are plugging the OpenLog directly onto the programming connector on an Arduino Pro Mini or Arduino Pro.
10+
11+
We DON'T recommend this method for beginners. See Example 1 for an easier software serial example.
12+
The reason is if you upload a sketch to an Arduino with OpenLog attached then OpenLog will log the
13+
uploading of your sketch. This may cause the OpenLog to become reconfigured. No harm will be
14+
caused but it can corrupt the log file.
15+
16+
Connect the following OpenLog to Arduino:
17+
RXI of OpenLog to TX on Arduino
18+
VCC to 5V
19+
GND to GND
20+
21+
This example records whatever the user Serial.prints(). This is the easiest but NOTE: You cannot
22+
upload sketches to your Arduino with the OpenLog attached (because of bus contention). Upload this
23+
sketch first, and then connect the OpenLog to the TX pin on the Arduino.
24+
*/
25+
26+
int statLED = 13;
27+
28+
float dummyVoltage = 3.50; //This just shows to to write variables to OpenLog
29+
30+
void setup() {
31+
pinMode(statLED, OUTPUT);
32+
Serial.begin(9600);
33+
34+
Serial.println("Example print to OpenLog");
35+
36+
Serial.println("Anything printed to COM port gets logged!");
37+
38+
//Write something to OpenLog
39+
Serial.println("Hi there! How are you today?");
40+
Serial.print("Voltage: ");
41+
Serial.println(dummyVoltage);
42+
dummyVoltage++;
43+
Serial.print("Voltage: ");
44+
Serial.println(dummyVoltage);
45+
}
46+
47+
void loop() {
48+
digitalWrite(statLED, HIGH);
49+
delay(1000);
50+
digitalWrite(statLED, LOW);
51+
delay(1000);
52+
}
53+

firmware/Arduino_Sketches/OpenLog_ReadExample/OpenLog_ReadExample.ino renamed to firmware/Arduino_Examples/Example3_ReadFile/Example3_ReadFile.ino

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

0 commit comments

Comments
 (0)