Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* globals.h for SpudSensor94.ino.*/
- */
- uint8_t broadcastAddress[] ={0x98,0xF4,0xAB,0xBF,0xEC,0xCC}; //Mac address of Wemos2
- //{0x18,0xFE,0x34,0xF9,0x2E,0x4A} ; //Mac address of Wemos1
- // Define variables to store Sensor readings to be sent to Master
- float temperature;
- float humidity;
- unsigned long milliSecsA;
- uint8_t orders;
- uint8_t stack[10];
- uint8_t stackPtr;
- uint8_t bufferPtr;
- uint8_t bigBuffer[200];
- // Define variables to store incoming readings from Master
- float incomingTemp;
- float incomingHum;
- unsigned long incomingMillisA;
- uint8_t incomingOrders;
- uint8_t incomingStac[10];
- uint8_t incomingStackPtr;
- uint8_t incomingBufferPtr;
- uint8_t incomingBigBuffer[200];
- int globLen = 0; //holds length of incoming packet
- const long interval = 500; //5000;
- unsigned long previousMillis = 0; // will store last time Sensor was updated
- uint8_t RxFlag =0; //goes high when data packet from SpudMaster received
- char buffer[200]; //intermediate buffer to store readings until big enough to append to log file. Also can send buffer via espNow to boss.
- char text[20]; //might have to be global
- uint16_t numReadings=0; //counts number of times HTU21D read.
- int testing = 1;
- unsigned long onDataRecvMillis=0;
- unsigned long loopCounter=0; //like to see how many times empty loop circulaes before sending espNow packet
- unsigned long stopWatchSettings[10]; //holds times during running of programs.
- //Structure example to send data
- //Must match the receiver structure
- typedef struct struct_message {
- float temp;
- float hum;
- unsigned long millisA; //for timing
- uint8_t ord;
- uint8_t stac[10];
- uint8_t stacPtr;
- uint8_t bufPtr;
- uint8_t bigBuf[200];
- } struct_message;
- // Create a struct_message called sensorReadings to hold sensor readings; to be sent to master
- struct_message sensorReadings;
- // Create a struct_message to hold incoming master readings
- struct_message incomingReadings;
Advertisement
Add Comment
Please, Sign In to add comment