Sensor ID Code display
-
I use this code header on my project to ID the code in a given device... you might find it useful in your projects...
I use primarily, Moteino and MoteinoMega or equiv with RFM69 radios on my projects...It outputs an hello message to the serial port, with file name, compile date, time, sensor version number and node information
/* Enable debug prints to serial monitor on port 0 */ #define MY_DEBUG // used by MySensor #define SKETCHNAME "Water and Pressure Meter" #define SKETCHVERSION "1.2c" #define MY_RFM69_NETWORKID 200 // Network ID, unique to each network, production = 100, test = 200 #define MY_NODE_ID 7 // My Sensor Node ID real = 6, 7 = test void setup() { // initialize serial communication at 115200bits per second: Serial.begin(115200); #ifdef __AVR_ATmega1284P__ // use for Moteino Mega Note: LED on Mega are 1 = on, 0 = off debug(PSTR("** Hello from the Water Meter on a MoteinoMega **\n") ); #else // we must have a Moteino debug(PSTR("** Hello from the Water Meter on a Moteino **\n") ); #endif const char compile_file[] = __FILE__ ; debug(PSTR(" %s %s\n"), SKETCHNAME, SKETCHVERSION); debug(PSTR(" %s \n"), compile_file); const char compile_date[] = __DATE__ ", " __TIME__; debug(PSTR(" %s \n\n"), compile_date); debug(PSTR(" Network ID: %u Node ID: %u\n\n"), MY_RFM69_NETWORKID, MY_NODE_ID); // your code as needed...... }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login