Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michal Rybka
openCanSat-2.0-library
Commits
77cf2c2b
Commit
77cf2c2b
authored
Sep 17, 2018
by
Markéta Jedličková
Browse files
Examples clean up
parent
414b3152
Changes
8
Hide whitespace changes
Inline
Side-by-side
examples/3-Each-module-examples/BME280_test/BME280_test.ino
View file @
77cf2c2b
...
@@ -15,32 +15,31 @@
...
@@ -15,32 +15,31 @@
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
"Adafruit_BME280.h"
// Include Adafruit BME280 library
#
include
"Adafruit_BME280.h"
// include Adafruit BME280 library
#
define Serial SerialUSB // Change default serial to SAMD USB serial
#define Serial SerialUSB // change default serial to SAMD USB serial
#define BME280_ADDRESS_OPEN_CANSAT 0x77 // Set BME's address (according to the circuit)
#define SEALEVELPRESSURE_HPA (1013.25) // Set sea level pressure value(see: https://en.wikipedia.org/wiki/Atmospheric_pressure)
#define BME280_ADDRESS_OPEN_CANSAT 0x77 // set BME's address (according to the circuit)
// Create object 'bme' from the library, which will
#define SEALEVELPRESSURE_HPA (1013.25) // set sea level pressure value(see: https://en.wikipedia.org/wiki/Atmospheric_pressure)
// create object 'bme' from the library, which will
// be used to access the library methods by a dot notation
// be used to access the library methods by a dot notation
Adafruit_BME280
bme
;
Adafruit_BME280
bme
;
int
ms_delay
=
500
;
// Number of milliseconds between each two measurements
int
ms_delay
=
500
;
// Number of milliseconds between each two measurements
//
e
pty variables for measured values
//
Em
pty variables for measured values
float
temperature_bme280
=
0
;
float
temperature_bme280
=
0
;
float
pressure_bme280
=
0
;
float
pressure_bme280
=
0
;
float
altitude_bme280
=
0
;
float
altitude_bme280
=
0
;
float
humidity_bme280
=
0
;
float
humidity_bme280
=
0
;
//
t
his will only run once
//
T
his will only run once
void
setup
()
void
setup
()
{
{
Serial
.
begin
(
57600
);
//
s
tart serial comm with baud rate of 57600Bd
Serial
.
begin
(
57600
);
//
S
tart serial comm with baud rate of 57600Bd
//
w
ait for the Arduino serial (on your PC) to connect
//
W
ait for the Arduino serial (on your PC) to connect
// please, open the Arduino serial console (right top corner)
// please, open the Arduino serial console (right top corner)
// note that the port may change after uploading the sketch
// note that the port may change after uploading the sketch
// COMMENT OUT FOR USAGE WITHOUT A PC!
// COMMENT OUT FOR USAGE WITHOUT A PC!
...
@@ -48,7 +47,7 @@ void setup()
...
@@ -48,7 +47,7 @@ void setup()
Serial
.
println
(
"openCanSat BME280 test started"
);
Serial
.
println
(
"openCanSat BME280 test started"
);
//
b
egin communication with the BME280 on the previously specified address
//
B
egin communication with the BME280 on the previously specified address
// print an error to the serial in case the sensor is not found
// print an error to the serial in case the sensor is not found
if
(
!
bme
.
begin
(
BME280_ADDRESS_OPEN_CANSAT
))
if
(
!
bme
.
begin
(
BME280_ADDRESS_OPEN_CANSAT
))
{
{
...
@@ -56,24 +55,24 @@ void setup()
...
@@ -56,24 +55,24 @@ void setup()
return
;
return
;
}
}
Serial
.
println
();
//
p
rint new line on serial to make the output look better :-;
Serial
.
println
();
//
P
rint new line on serial to make the output look better :-;
}
}
//
c
ode in this function will run repeatedly
//
C
ode in this function will run repeatedly
void
loop
()
void
loop
()
{
{
//
r
ead values from BME280 into the variables
//
R
ead values from BME280 into the variables
temperature_bme280
=
bme
.
readTemperature
();
temperature_bme280
=
bme
.
readTemperature
();
pressure_bme280
=
bme
.
readPressure
()
/
100.0
F
;
pressure_bme280
=
bme
.
readPressure
()
/
100.0
F
;
altitude_bme280
=
bme
.
readAltitude
(
SEALEVELPRESSURE_HPA
);
altitude_bme280
=
bme
.
readAltitude
(
SEALEVELPRESSURE_HPA
);
humidity_bme280
=
bme
.
readHumidity
();
humidity_bme280
=
bme
.
readHumidity
();
//
p
rint the measured variables to serial
//
P
rint the measured variables to serial
Serial
.
println
(
"Temperature = "
+
(
String
)
temperature_bme280
+
" °C"
);
Serial
.
println
(
"Temperature = "
+
(
String
)
temperature_bme280
+
" °C"
);
Serial
.
println
(
"Pressure = "
+
(
String
)
pressure_bme280
+
" hPa"
);
Serial
.
println
(
"Pressure = "
+
(
String
)
pressure_bme280
+
" hPa"
);
Serial
.
println
(
"Approx altitude = "
+
(
String
)
altitude_bme280
+
" m"
);
Serial
.
println
(
"Approx altitude = "
+
(
String
)
altitude_bme280
+
" m"
);
Serial
.
println
(
"Humidity = "
+
(
String
)
humidity_bme280
+
" %"
);
Serial
.
println
(
"Humidity = "
+
(
String
)
humidity_bme280
+
" %"
);
Serial
.
println
();
Serial
.
println
();
delay
(
ms_delay
);
//
w
ait a while (defined at the beginning)
delay
(
ms_delay
);
//
W
ait a while (defined at the beginning)
}
}
examples/3-Each-module-examples/BMP280_test/BMP280_test.ino
View file @
77cf2c2b
...
@@ -14,9 +14,7 @@
...
@@ -14,9 +14,7 @@
http://www.gnu.org/licenses/gpl-3.0.txt
http://www.gnu.org/licenses/gpl-3.0.txt
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
<Adafruit_BMP280.h>
// include Adafruit BMP280 library
#include
<Adafruit_BMP280.h>
// include Adafruit BMP280 library
#define Serial SerialUSB // change default serial to SAMD USB serial
#define Serial SerialUSB // change default serial to SAMD USB serial
...
@@ -34,12 +32,12 @@ float temperature_bmp280 = 0;
...
@@ -34,12 +32,12 @@ float temperature_bmp280 = 0;
float
pressure_bmp280
=
0
;
float
pressure_bmp280
=
0
;
float
altitude_bmp280
=
0
;
float
altitude_bmp280
=
0
;
//
t
his will only run once
//
T
his will only run once
void
setup
()
void
setup
()
{
{
Serial
.
begin
(
57600
);
//
s
tart serial comm with baud rate of 57600Bd
Serial
.
begin
(
57600
);
//
S
tart serial comm with baud rate of 57600Bd
//
w
ait for the Arduino serial (on your PC) to connect
//
W
ait for the Arduino serial (on your PC) to connect
// please, open the Arduino serial console (right top corner)
// please, open the Arduino serial console (right top corner)
// note that the port may change after uploading the sketch
// note that the port may change after uploading the sketch
// COMMENT OUT FOR USAGE WITHOUT A PC!
// COMMENT OUT FOR USAGE WITHOUT A PC!
...
@@ -47,7 +45,7 @@ void setup()
...
@@ -47,7 +45,7 @@ void setup()
Serial
.
println
(
"openCanSat BMP280 test started"
);
Serial
.
println
(
"openCanSat BMP280 test started"
);
//
b
egin communication with the BMP280 on the previously specified address
//
B
egin communication with the BMP280 on the previously specified address
// print an error to the serial in case the sensor is not found
// print an error to the serial in case the sensor is not found
if
(
!
bmp
.
begin
(
BMP280_ADDRESS
))
if
(
!
bmp
.
begin
(
BMP280_ADDRESS
))
{
{
...
@@ -55,22 +53,22 @@ void setup()
...
@@ -55,22 +53,22 @@ void setup()
return
;
return
;
}
}
Serial
.
println
();
//
p
rint new line on serial to make the output look better
:-;
Serial
.
println
();
//
P
rint new line on serial to make the output look better
}
}
//
c
ode in this function will run repeatedly
//
C
ode in this function will run repeatedly
void
loop
()
void
loop
()
{
{
//
r
ead values from BME280 into the variables
//
R
ead values from BME280 into the variables
temperature_bmp280
=
bmp
.
readTemperature
();
temperature_bmp280
=
bmp
.
readTemperature
();
pressure_bmp280
=
bmp
.
readPressure
();
pressure_bmp280
=
bmp
.
readPressure
();
altitude_bmp280
=
bmp
.
readAltitude
(
1013.25
);
altitude_bmp280
=
bmp
.
readAltitude
(
1013.25
);
//
p
rint the measured variables to serial
//
P
rint the measured variables to serial
Serial
.
println
(
"Temperature = "
+
(
String
)
temperature_bmp280
+
" *C"
);
Serial
.
println
(
"Temperature = "
+
(
String
)
temperature_bmp280
+
" *C"
);
Serial
.
println
(
"Pressure = "
+
(
String
)
pressure_bmp280
+
" Pa"
);
Serial
.
println
(
"Pressure = "
+
(
String
)
pressure_bmp280
+
" Pa"
);
Serial
.
println
(
"Approx altitude = "
+
(
String
)
altitude_bmp280
+
" m"
);
Serial
.
println
(
"Approx altitude = "
+
(
String
)
altitude_bmp280
+
" m"
);
Serial
.
println
();
Serial
.
println
();
delay
(
ms_delay
);
//
w
ait a while (defined at the beginning)
delay
(
ms_delay
);
//
W
ait a while (defined at the beginning)
}
}
examples/3-Each-module-examples/GPS_i2c_test/GPS_i2c_test.ino
View file @
77cf2c2b
...
@@ -15,15 +15,16 @@
...
@@ -15,15 +15,16 @@
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
"Open_Cansat_GPS.h"
#include
<Wire.h>
#include
<Wire.h>
#include
"../../libraries/Open_Cansat_GPS/src/Open_Cansat_GPS.h"
#define Serial SerialUSB
#define Serial SerialUSB
OpenCansatGPS
gps
;
OpenCansatGPS
gps
;
int
ms_delay
=
250
;
// Number of milliseconds for scan and between another scan is done
void
setup
()
void
setup
()
{
{
while
(
!
SerialUSB
)
{}
while
(
!
SerialUSB
)
{}
...
@@ -40,10 +41,11 @@ void setup()
...
@@ -40,10 +41,11 @@ void setup()
void
loop
()
void
loop
()
{
{
//
s
ave start time in millisec
//
S
ave start time in millisec
uint32_t
start
=
millis
();
uint32_t
start
=
millis
();
if
(
gps
.
scan
(
250
))
// Printing gps values if scan is successful
if
(
gps
.
scan
(
ms_delay
))
{
{
Serial
.
println
(
String
(
" time to find fix: "
)
+
(
millis
()
-
start
)
+
String
(
"ms"
));
Serial
.
println
(
String
(
" time to find fix: "
)
+
(
millis
()
-
start
)
+
String
(
"ms"
));
Serial
.
println
(
String
(
" datetime = "
)
+
gps
.
getDateTimeString
());
Serial
.
println
(
String
(
" datetime = "
)
+
gps
.
getDateTimeString
());
...
@@ -53,5 +55,6 @@ void loop()
...
@@ -53,5 +55,6 @@ void loop()
Serial
.
println
();
Serial
.
println
();
}
}
delay
(
250
);
// Wait before next measurement
delay
(
ms_delay
);
}
}
examples/3-Each-module-examples/INA219_test/INA219_test.ino
View file @
77cf2c2b
...
@@ -15,30 +15,29 @@
...
@@ -15,30 +15,29 @@
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
<Adafruit_INA219.h>
// Include Adafruit INA219 library
#include
<Adafruit_INA219.h>
// include Adafruit INA219 library
#define Serial SerialUSB
//
c
hange default serial to SAMD USB serial
#define Serial SerialUSB
//
C
hange default serial to SAMD USB serial
//
c
reate object 'ina219' from the library with address 0x40
//
C
reate object 'ina219' from the library with address 0x40
// (according to the circuit, which will be used to access the
// (according to the circuit, which will be used to access the
// library methods by a dot notation
// library methods by a dot notation
Adafruit_INA219
ina219
(
0x40
);
Adafruit_INA219
ina219
(
0x40
);
int
ms_delay
=
500
;
// Number of milliseconds between each two readings
int
ms_delay
=
500
;
// Number of milliseconds between each two readings
//
e
mpty variables for measured values
//
E
mpty variables for measured values
float
voltage_shunt
=
0
;
float
voltage_shunt
=
0
;
float
voltage_bus
=
0
;
float
voltage_bus
=
0
;
float
current_mA
=
0
;
float
current_mA
=
0
;
float
voltage_load
=
0
;
float
voltage_load
=
0
;
//
t
his will only run once
//
T
his will only run once
void
setup
(
void
)
void
setup
(
void
)
{
{
Serial
.
begin
(
57600
);
// start serial comm with baud rate of 57600Bd
Serial
.
begin
(
57600
);
// start serial comm with baud rate of 57600Bd
//
w
ait for the Arduino serial (on your PC) to connect
//
W
ait for the Arduino serial (on your PC) to connect
// please, open the Arduino serial console (right top corner)
// please, open the Arduino serial console (right top corner)
// note that the port may change after uploading the sketch
// note that the port may change after uploading the sketch
// COMMENT OUT FOR USAGE WITHOUT A PC!
// COMMENT OUT FOR USAGE WITHOUT A PC!
...
@@ -46,26 +45,25 @@ void setup(void)
...
@@ -46,26 +45,25 @@ void setup(void)
Serial
.
println
(
"openCanSat INA219 test started"
);
Serial
.
println
(
"openCanSat INA219 test started"
);
//
b
egin communication with the INA219
//
B
egin communication with the INA219
ina219
.
begin
();
ina219
.
begin
();
}
}
//
c
ode in this function will run repeatedly
//
C
ode in this function will run repeatedly
void
loop
(
void
)
void
loop
(
void
)
{
{
//
r
ead values from INA219 into the variables
//
R
ead values from INA219 into the variables
voltage_shunt
=
ina219
.
getShuntVoltage_mV
();
voltage_shunt
=
ina219
.
getShuntVoltage_mV
();
voltage_bus
=
ina219
.
getBusVoltage_V
();
voltage_bus
=
ina219
.
getBusVoltage_V
();
current_mA
=
ina219
.
getCurrent_mA
();
current_mA
=
ina219
.
getCurrent_mA
();
voltage_load
=
voltage_bus
+
(
voltage_shunt
/
1000
);
voltage_load
=
voltage_bus
+
(
voltage_shunt
/
1000
);
//
p
rint the measured variables to serial
//
P
rint the measured variables to serial
Serial
.
println
(
"Shunt Voltage: "
+
(
String
)
voltage_shunt
+
" mV"
);
Serial
.
println
(
"Shunt Voltage: "
+
(
String
)
voltage_shunt
+
" mV"
);
Serial
.
println
(
"Bus Voltage: "
+
(
String
)
voltage_bus
+
" V"
);
Serial
.
println
(
"Bus Voltage: "
+
(
String
)
voltage_bus
+
" V"
);
Serial
.
println
(
"Current: "
+
(
String
)
current_mA
+
" mA"
);
Serial
.
println
(
"Current: "
+
(
String
)
current_mA
+
" mA"
);
Serial
.
println
(
"Load Voltage: "
+
(
String
)
voltage_load
+
" V"
);
Serial
.
println
(
"Load Voltage: "
+
(
String
)
voltage_load
+
" V"
);
Serial
.
println
();
Serial
.
println
();
delay
(
ms_delay
);
//
w
ait a while (defined at the beginning)
delay
(
ms_delay
);
//
W
ait a while (defined at the beginning)
}
}
examples/3-Each-module-examples/LED_test/LED_test.ino
View file @
77cf2c2b
...
@@ -15,21 +15,21 @@
...
@@ -15,21 +15,21 @@
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
<Arduino.h>
#include
<Arduino.h>
#define Serial SerialUSB // change default serial to SAMD USB serial
// set LED pins
#define Serial SerialUSB // Change default serial to SAMD USB serial
// Set LED pins
#define D13_LED 42
#define D13_LED 42
#define M_LED 36
#define M_LED 36
int
ms_delay
=
2000
;
// Number of milliseconds between each two LED changes
int
ms_delay
=
2000
;
// Number of milliseconds between each two LED changes
void
setup
()
void
setup
()
{
{
Serial
.
begin
(
57600
);
//
s
tart serial comm with baud rate of 57600Bd
Serial
.
begin
(
57600
);
//
S
tart serial comm with baud rate of 57600Bd
//
w
ait for the Arduino serial (on your PC) to connect
//
W
ait for the Arduino serial (on your PC) to connect
// please, open the Arduino serial console (right top corner)
// please, open the Arduino serial console (right top corner)
// note that the port may change after uploading the sketch
// note that the port may change after uploading the sketch
// COMMENT OUT FOR USAGE WITHOUT A PC!
// COMMENT OUT FOR USAGE WITHOUT A PC!
...
@@ -37,43 +37,42 @@ void setup()
...
@@ -37,43 +37,42 @@ void setup()
Serial
.
println
(
"openCanSat kit LED test started"
);
Serial
.
println
(
"openCanSat kit LED test started"
);
pinMode
(
D13_LED
,
OUTPUT
);
// configure D13 pin as output
pinMode
(
D13_LED
,
OUTPUT
);
// Configure D13 pin as output
}
}
void
loop
()
void
loop
()
{
{
pinMode
(
M_LED
,
OUTPUT
);
//
c
onfigure MLED as output (it is not, after every loop)
pinMode
(
M_LED
,
OUTPUT
);
//
C
onfigure MLED as output (it is not, after every loop)
//
p
rint the LEDs' status to serial
//
P
rint the LEDs' status to serial
Serial
.
println
(
"D13: ON"
);
Serial
.
println
(
"D13: ON"
);
Serial
.
println
(
"MLED: ON, RED"
);
Serial
.
println
(
"MLED: ON, RED"
);
Serial
.
println
();
Serial
.
println
();
//
t
urn D13 and MLED-red on
//
T
urn D13 and MLED-red on
digitalWrite
(
D13_LED
,
HIGH
);
digitalWrite
(
D13_LED
,
HIGH
);
digitalWrite
(
M_LED
,
HIGH
);
digitalWrite
(
M_LED
,
HIGH
);
delay
(
ms_delay
);
//
w
ait a while (defined at the beginning)
delay
(
ms_delay
);
//
W
ait a while (defined at the beginning)
//
p
rint the LEDs' status to serial
//
P
rint the LEDs' status to serial
Serial
.
println
(
"D13: OFF"
);
Serial
.
println
(
"D13: OFF"
);
Serial
.
println
(
"MLED: ON, BLUE"
);
Serial
.
println
(
"MLED: ON, BLUE"
);
Serial
.
println
();
Serial
.
println
();
//
t
urn D13 off and MLED-blue on
//
T
urn D13 off and MLED-blue on
digitalWrite
(
D13_LED
,
LOW
);
digitalWrite
(
D13_LED
,
LOW
);
digitalWrite
(
M_LED
,
LOW
);
digitalWrite
(
M_LED
,
LOW
);
delay
(
ms_delay
);
//
w
ait a while (defined at the beginning)
delay
(
ms_delay
);
//
W
ait a while (defined at the beginning)
//
p
rint the LEDs' status to serial
//
P
rint the LEDs' status to serial
Serial
.
println
(
"D13: OFF"
);
Serial
.
println
(
"D13: OFF"
);
Serial
.
println
(
"MLED: OFF"
);
Serial
.
println
(
"MLED: OFF"
);
Serial
.
println
();
Serial
.
println
();
// D13 is already off
// D13 is already off
pinMode
(
M_LED
,
INPUT
);
//
c
onfigure MLED as input to turn off voltage supply on the pin
pinMode
(
M_LED
,
INPUT
);
//
C
onfigure MLED as input to turn off voltage supply on the pin
delay
(
ms_delay
);
//
w
ait a while (defined at the beginning)
delay
(
ms_delay
);
//
W
ait a while (defined at the beginning)
}
}
examples/3-Each-module-examples/RFM69_receive_test/RFM69_receive_test.ino
View file @
77cf2c2b
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
<RFM69.h>
// include RFM69 library
#include
<RFM69.h>
// include RFM69 library
#define Serial SerialUSB // change default serial to SAMD USB serial
#define Serial SerialUSB // change default serial to SAMD USB serial
...
@@ -66,10 +65,13 @@ void setup()
...
@@ -66,10 +65,13 @@ void setup()
// code in this function will run repeatedly
// code in this function will run repeatedly
void
loop
()
void
loop
()
{
{
if
(
radio
.
receiveDone
())
// Got one!
// When receive from radio is done
if
(
radio
.
receiveDone
())
// Got one message
{
{
// Print node number
Serial
.
println
(
"Received from node "
+
static_cast
<
String
>
(
radio
.
SENDERID
));
Serial
.
println
(
"Received from node "
+
static_cast
<
String
>
(
radio
.
SENDERID
));
// transfer data into structure
data
=
*
(
message
*
)
radio
.
DATA
;
data
=
*
(
message
*
)
radio
.
DATA
;
Serial
.
println
(
"Id of received message: "
+
static_cast
<
String
>
(
data
.
messageId
));
Serial
.
println
(
"Id of received message: "
+
static_cast
<
String
>
(
data
.
messageId
));
...
...
examples/3-Each-module-examples/RFM69_send_test/RFM69_send_test.ino
View file @
77cf2c2b
...
@@ -15,19 +15,18 @@
...
@@ -15,19 +15,18 @@
Please maintain this license information along with authorship
Please maintain this license information along with authorship
and copyright notices in any redistribution of this code
and copyright notices in any redistribution of this code
*/
*/
#include
<RFM69.h>
// Include RFM69 library
#include
<RFM69.h>
// include RFM69 library
#define Serial SerialUSB // Change default serial to SAMD USB serial
#define Serial SerialUSB // change default serial to SAMD USB serial
// RFM69
// RFM69
#define NETWORKID 0 // Must be the same for all nodes (0 to 255)
#define NETWORKID 0
// Must be the same for all nodes (0 to 255)
#define MYNODEID 1 // My node ID (0 to 255)
#define MYNODEID 1
// My node ID (0 to 255)
#define TONODEID 2 // Destination node ID (0 to 254, 255 = broadcast)
#define TONODEID 2
// Destination node ID (0 to 254, 255 = broadcast)
#define FREQUENCY RF69_433MHZ
#define FREQUENCY RF69_433MHZ
#define CHIP_SELECT_PIN 43
//r
adio chip select
#define CHIP_SELECT_PIN 43
// R
adio chip select
#define INTERUP_PIN 9
//r
adio interrupt
#define INTERUP_PIN 9
// R
adio interrupt
#define MS_DELAY 300 // Number of milliseconds between data sending and LED signalization
#define MS_DELAY 300
// Number of milliseconds between data sending and LED signalization
// Local
// Local
#define PC_BAUDRATE 56700
#define PC_BAUDRATE 56700
...
@@ -42,14 +41,14 @@ typedef struct
...
@@ -42,14 +41,14 @@ typedef struct
int
messageId
;
int
messageId
;
}
message
;
}
message
;
message
data
;
//
c
reate the struct
variable
message
data
;
//
C
reate the struct
object
//
t
his will only run once
//
T
his
setup loop
will only run once
void
setup
()
void
setup
()
{
{
Serial
.
begin
(
PC_BAUDRATE
);
//
s
tart serial comm with baud rate of 57600Bd
Serial
.
begin
(
PC_BAUDRATE
);
//
S
tart serial comm with baud rate of 57600Bd
//
w
ait for the Arduino serial (on your PC) to connect
//
W
ait for the Arduino serial (on your PC) to connect
// please, open the Arduino serial console (right top corner)
// please, open the Arduino serial console (right top corner)
// note that the port may change after uploading the sketch
// note that the port may change after uploading the sketch
// COMMENT OUT FOR USAGE WITHOUT A PC!
// COMMENT OUT FOR USAGE WITHOUT A PC!
...
@@ -66,22 +65,24 @@ void setup()
...
@@ -66,22 +65,24 @@ void setup()
Serial
.
println
(
"RFM69HW initialization failed!"
);
Serial
.
println
(
"RFM69HW initialization failed!"
);
}
}
Serial
.
println
();
//
p
rint new line on serial to make the output look better :-;
Serial
.
println
();
//
P
rint new line on serial to make the output look better :-;
}
}
//
c
ode in this function will run repeatedly
//
C
ode in this function will run repeatedly
void
loop
()
void
loop
()
{
{