I am trying to create a wireless weather station, but am having a lot of trouble with the virtual wire library. Whenever I try to use this program I get the error code:
expected primary-expression before ')' token
on the line of:
vw_send(pressure,uint8_t);
If someone would please look at this code and tell me what I am doing wrong that would be very helpful. Also, I am a complete newbie and know next to nothing about C or Arduino coding, so heavy commenting would help me a lot.
#include <VirtualWire.h> // Library for radio transmitting
#include "cactus_io_BME280_I2C.h" // Library for BME280 Weather Sensor
#include <Wire.h>
int pressure = 0;
int humidity = 0;
int tempc = 0;
int temp = 0;
int pressurevalue = 0;
int humidityvalue = 0;
int tempvalue = 0; // Variables for the sensor values
BME280_I2C bme;
void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT); // Testing Indicator setup
pinMode(12,OUTPUT); // Default transmitter pin
vw_setup(4000); // Radio Setup
if (!bme.begin()) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
}
void loop() {
bme.readSensor();
pressure = bme.getPressure_MB();
humidity = bme.getHumidity();
temp = bme.getTemperature_F();
tempc = bme.getTemperature_C();
delay(500);
vw_send(temp,uint8_t);
delay(500);
vw_send(tempc,uint8_t);
delay(500);
vw_send(humidity,uint8_t);
delay(500);
vw_send(pressure,uint8_t);
delay(500);
}
P.S. If someone could roughly sketch a receiver code that would write the information to variables as well, I would appreciate it, Thanks.