Commit 63cb47f5 authored by Markéta Jedličková's avatar Markéta Jedličková
Browse files

Control serial monitor prints updated for LITE baseStation and CanSat code

parent a0986877
......@@ -55,14 +55,14 @@ void setup()
// COMMENT OUT FOR USAGE WITHOUT A PC!
while(!Serial);
Serial.println("openCanSat GPS test started");
Serial.println("Base station LITE started");
Serial.print("Node " + static_cast<String>(MYNODEID) + " ready");
// Radio RFM69 init (Frequency, node id and network id needed)
if(!radio.initialize(FREQUENCY, MYNODEID, NETWORKID))
{
isRadioOk = false; // radio init failed flag
Serial.println("RFM69HW initialization failed!");
Serial.println("Could not find a valid RFM69HW sensor, check wiring!");
}
else
{
......@@ -75,7 +75,7 @@ void loop()
// If radio received message print out received data
if (radio.receiveDone())
{
Serial.println("Received from node " + static_cast<String>(radio.SENDERID));
Serial.println("Received from canSat number " + static_cast<String>(radio.SENDERID));
// Convert income data into data structure
incomeMessage = *(message*)radio.DATA;
......
......@@ -80,11 +80,9 @@ void setup()
// COMMENT OUT FOR USAGE WITHOUT A PC!
while(!Serial);
Serial.println("openCanSat LITE");
Serial.println("CanSat LITE started");
Serial.println("CanSat number " + static_cast<String>(MYNODEID) + " ready.");
Serial.print("Node ");
Serial.print(MYNODEID,DEC);
Serial.println(" ready");
// begin communication with the BMP280 on the previously specified address
// print an error to the serial in case the sensor is not found
......@@ -98,12 +96,13 @@ void setup()
if(!radio.initialize(FREQUENCY, MYNODEID, NETWORKID))
{
isRadioOk = false;
Serial.println("RFM69HW initialization failed!");
Serial.println("Could not find a valid RFM69HW sensor, check wiring!");
return;
}
if(isRadioOk)
{
Serial.println("High power was set (needed for RFM69HW).");
radio.setHighPower(true); // Always use this for RFM69HW
}
......@@ -140,11 +139,13 @@ void loop()
Serial.println("Signal = " + static_cast<String>(radio.RSSI));
radio.send(TONODEID, (const void*)&data, sizeof(data));
Serial.println("Data was sended to base station num: " + static_cast<String>(TONODEID));
}
Serial.println();
// Led hart beat
// Led hart beat.
pinMode(M_led_pin, OUTPUT);
digitalWrite(M_led_pin, HIGH);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment