Thanks
I'm using an Arduino Nano
I also have a BMP280 temp/humidity/pressure sensor and a pair of HC-12 wireless modules to transmit the output to the pc and recieve it on the pc
Connecting the BMP280 directly to the com port on the pc I get the expected output and it works perfectly
However when I connect the HC-12 to pins 2 and 3 of the arduino (TX and RX) and the other HC-12 to the pc I get nothing at all
I know my com cable is working perfectly, I know the HC-12's are working properly because using another utility I was able to talk to them and set the channel they are using.
Any ideas why the output from the Nano isn't being transmitted through the wireless modules?
My code is this (borrowed and edited) to just get the output I want.
/******************************************************************************
I2C_and_SPI_Multisensor.ino
BME280 Arduino and Teensy example
Marshall Taylor @ SparkFun Electronics
May 20, 2015
https://github.com/sparkfun/SparkFun_BME280_Arduino_Library
This sketch configures two BME280 breakouts. One is configured as I2C and
the other as SPI. Data from both are displayed.
Sensor A is I2C and connected through A4 and A5 (SDA/SCL)
Resources:
Uses Wire.h for I2C operation
Development environment specifics:
Arduino IDE 1.6.4
Teensy loader 1.23
This code is released under the [MIT License](http://opensource.org/licenses/MIT).
Please review the LICENSE.md file included with this example. If you have any questions
or concerns with licensing, please contact techsupport@sparkfun.com.
Distributed as-is; no warranty is given.
******************************************************************************/
#include <stdint.h>
#include "SparkFunBME280.h"
#include "Wire.h"
//Global sensor object
BME280 mySensorA;
void setup()
{
//***Set up sensor 'A'******************************//
//commInterface can be I2C_MODE or SPI_MODE
mySensorA.settings.commInterface = I2C_MODE;
mySensorA.settings.I2CAddress = 0x77;
mySensorA.settings.runMode = 3; // 3, Normal mode
mySensorA.settings.tStandby = 0; // 0, 0.5ms
mySensorA.settings.filter = 0; // 0, filter off
//tempOverSample can be:
// 0, skipped
// 1 through 5, oversampling *1, *2, *4, *8, *16 respectively
mySensorA.settings.tempOverSample = 1;
//pressOverSample can be:
// 0, skipped
// 1 through 5, oversampling *1, *2, *4, *8, *16 respectively
mySensorA.settings.pressOverSample = 1;
//humidOverSample can be:
// 0, skipped
// 1 through 5, oversampling *1, *2, *4, *8, *16 respectively
mySensorA.settings.humidOverSample = 1;
//***Initialize the things**************************//
delay(2000);
Serial.begin(9600);
Serial.print("Program Started\n");
Serial.println("Starting BME280s... result of .begin():");
delay(10); //Make sure sensor had enough time to turn on. BME280 requires 2ms to start up.
//Calling .begin() causes the settings to be loaded
Serial.print("Sensor A: 0x");
Serial.println(mySensorA.begin(), HEX);
}
void loop()
{
//Start with temperature, as that data is needed for accurate compensation.
//Reading the temperature updates the compensators of the other functions
//in the background.
Serial.print("Temperature: ");
Serial.print(mySensorA.readTempC(), 2);
Serial.print((char)178); // degree symbol
Serial.println("C"); // C character
Serial.print("Pressure: ");
Serial.print(mySensorA.readFloatPressure(), 2);
Serial.println(" Pa");
Serial.print("Altitude: ");
Serial.print(mySensorA.readFloatAltitudeMeters(), 2);
Serial.println("m");
Serial.print("Altitude: ");
Serial.print(mySensorA.readFloatAltitudeFeet(), 2);
Serial.println("ft");
Serial.print("%RH: ");
Serial.print(mySensorA.readFloatHumidity(), 2);
Serial.println(" %");
Serial.println();
delay(1000);
}