Skip to content

Commit 311c251

Browse files
committed
initial commit
1 parent ffcd2d8 commit 311c251

2 files changed

+117
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
**Contributed by Kevin Smith of Stroud Research Center**
2+
3+
If you look at the SoftwareSerial library -
4+
https://github.com/arduino/Arduino/blob/master/libraries/SoftwareSerial/SoftwareSerial.cpp
5+
6+
- you will see a section of code copied below:
7+
8+
#if defined(PCINT0_vect)
9+
ISR(PCINT0_vect)
10+
{
11+
SoftwareSerial::handle_interrupt();
12+
}
13+
#endif
14+
15+
#if defined(PCINT1_vect)
16+
ISR(PCINT1_vect)
17+
{
18+
SoftwareSerial::handle_interrupt();
19+
}
20+
#endif
21+
22+
#if defined(PCINT2_vect)
23+
ISR(PCINT2_vect)
24+
{
25+
SoftwareSerial::handle_interrupt();
26+
}
27+
#endif
28+
29+
#if defined(PCINT3_vect)
30+
ISR(PCINT3_vect)
31+
{
32+
SoftwareSerial::handle_interrupt();
33+
}
34+
#endif
35+
36+
37+
It basically says, if the hardware has something called PCINT0, PCINT1, PCINT2, or PCINT3,
38+
claim it for the SoftwareSerial library to use. ArduinoUNO only has up to PCINT2, but
39+
other models have more PCINTs available.
40+
41+
Anyway, we do not need to be so greedy. We only need pins 2 and 3 for SoftwareSerial, which
42+
is PCINT2. So we simply "comment out" the sections in the SoftwareSerial library that
43+
we aren't using for SoftwareSerial. Commenting out is better than deleting, since you
44+
may want to get this functionality back later.
45+
46+
//#if defined(PCINT0_vect)
47+
//ISR(PCINT0_vect)
48+
//{
49+
// SoftwareSerial::handle_interrupt();
50+
//}
51+
//#endif
52+
53+
//#if defined(PCINT1_vect)
54+
//ISR(PCINT1_vect)
55+
//{
56+
// SoftwareSerial::handle_interrupt();
57+
//}
58+
//#endif
59+
60+
#if defined(PCINT2_vect)
61+
ISR(PCINT2_vect)
62+
{
63+
SoftwareSerial::handle_interrupt();
64+
}
65+
#endif
66+
67+
//#if defined(PCINT3_vect)
68+
//ISR(PCINT3_vect)
69+
//{
70+
// SoftwareSerial::handle_interrupt();
71+
//}
72+
//#endif
73+
74+
Next, we are going to do the complementary action in the SDI-12 Library, which is also
75+
being greedy. Since we are using pin 9 for SDI-12, we give it to PCINT0:
76+
77+
//6.3
78+
#if defined(PCINT0_vect)
79+
ISR(PCINT0_vect){ SDI12::handleInterrupt(); }
80+
#endif
81+
82+
//#if defined(PCINT1_vect)
83+
//ISR(PCINT1_vect){ SDI12::handleInterrupt(); }
84+
//#endif
85+
86+
//#if defined(PCINT2_vect)
87+
//ISR(PCINT2_vect){ SDI12::handleInterrupt(); }
88+
//#endif
89+
90+
//#if defined(PCINT3_vect)
91+
//ISR(PCINT3_vect){ SDI12::handleInterrupt(); }
92+
//#endif
93+
94+
Restart the Arduino IDE, and it should recognize the changes to the libraries and your
95+
code should compile without issue.

implementation instructions.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
This package was designed to automatically insert sensor data using HTTP requests from a GPRS Sim900 Shield attached to an Arduino code.
2+
The Arduino code is called 'sensorToHSL'
3+
4+
To use the package, do the following:
5+
6+
1. put inputSensorData.php into the 'client' folder of HydroServerLite
7+
8+
2. in 'sensorToHSL.ino' modify these variables found at the top of the sketch:
9+
- the 'SourceID' variable to the ID of the desired source (created in HSL)
10+
- 'SiteID' to the ID of the desired site (created in HSL)
11+
- 'VarID1' to the ID of the desired variable (created in HSL)
12+
- 'VarID2' to the ID of the desired variable (created in HSL)
13+
- and the 'url' of the 'inputSensorData.php' file
14+
15+
3. modify the 'sensors()' function in 'sensorToHSL.ino' to read the data from YOUR sensor(s)
16+
17+
4. modify 'recTime' and 'recIntv' to change when the first reading occurs (what minute) and at how often respectively
18+
19+
5. upload sketch to Arduino
20+
21+
22+
written by Jeff Sadler

0 commit comments

Comments
 (0)