MySensors Library & Examples  2.3.2-62-ge298769
ShowConfiguration.ino
1 #include <AltSoftSerial.h>
2 
3 // AltSoftSerial show configuration example
4 // Will print library configuration to default serial port
5 // Open your serial monitor to see config for your board
6 // Printout would repeat every 10sec (just in case you missed it somehow)
7 
8 // Print Configuration
9 // -----------------------
10 
11 // Direct include AltSoftSerial internals to obtaion PIN setup (you do not need this in regular code)
12 
13 // This example code is in the public domain.
14 
15 #include <config/AltSoftSerial_Boards.h>
16 
17 void printAltSoftSerialSetup(Stream &port)
18 {
19 #define PRINT_PFX "AltSoftSerial:"
20 #define PRINT_PIN_NAME(pin,name) { char buffer[128+1]; sprintf(buffer, PRINT_PFX "PIN:%2d %s", (int)pin, (const char*)name); port.println(buffer); }
21 
22  port.println(PRINT_PFX "Setup info: begin");
23 
24 #if defined(ALTSS_USE_FTM0)
25  port.println(PRINT_PFX "USE FTM0");
26 #endif
27 
28 #if defined(ALTSS_USE_TIMER1)
29  port.println(PRINT_PFX "USE TIMER1");
30 #endif
31 
32 #if defined(ALTSS_USE_TIMER2)
33  port.println(PRINT_PFX "USE TIMER2");
34 #endif
35 
36 #if defined(ALTSS_USE_TIMER3)
37  port.println(PRINT_PFX "USE TIMER3");
38 #endif
39 
40 #if defined(ALTSS_USE_TIMER4)
41  port.println(PRINT_PFX "USE TIMER4");
42 #endif
43 
44 #if defined(ALTSS_USE_TIMER5)
45  port.println(PRINT_PFX "USE TIMER5");
46 #endif
47 
48 #if defined(INPUT_CAPTURE_PIN)
49  PRINT_PIN_NAME(INPUT_CAPTURE_PIN,"RX");
50 #endif
51 
52 #if defined(OUTPUT_COMPARE_A_PIN)
53  PRINT_PIN_NAME(OUTPUT_COMPARE_A_PIN,"TX");
54 #endif
55 
56 #if defined(OUTPUT_COMPARE_B_PIN)
57  PRINT_PIN_NAME(OUTPUT_COMPARE_B_PIN,"(unused PWM)");
58 #endif
59 
60 #if defined(OUTPUT_COMPARE_C_PIN)
61  PRINT_PIN_NAME(OUTPUT_COMPARE_C_PIN,"(unused PWM)");
62 #endif
63 
64 #if defined(OUTPUT_COMPARE_D_PIN)
65  PRINT_PIN_NAME(OUTPUT_COMPARE_D_PIN,"(unused PWM)");
66 #endif
67 
68 #if defined(OUTPUT_COMPARE_E_PIN)
69  PRINT_PIN_NAME(OUTPUT_COMPARE_E_PIN,"(unused PWM)");
70 #endif
71 
72 #if defined(OUTPUT_COMPARE_F_PIN)
73  PRINT_PIN_NAME(OUTPUT_COMPARE_F_PIN,"(unused PWM)");
74 #endif
75 
76  port.println(PRINT_PFX "Setup info: end");
77 
78 #undef PRINT_PIN_NAME
79 #undef PRINT_PFX
80 }
81 
82 void setup()
83 {
84  // Open default serial to dump config to
85  Serial.begin(9600);
86  while (!Serial) ; // wait for serial monitor
87  printAltSoftSerialSetup(Serial);
88 }
89 
90 void loop()
91 {
92  // Repeat every 10 sec (just in case)
93  delay(10000);
94  Serial.println("");
95  printAltSoftSerialSetup(Serial);
96 }
97 
loop
void loop()
Main loop.
Definition: ShowConfiguration.ino:90
setup
void setup()
Called after node initialises but before main loop.
Definition: ShowConfiguration.ino:82