File tree 1 file changed +8
-2
lines changed
libraries/MySensors/examples/SensebenderMicro
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
58
58
int measureCount = 0 ;
59
59
int sendBattery = 0 ;
60
60
boolean isMetric = true ;
61
+ boolean highfreq = true ;
61
62
62
63
// Storage of old measurements
63
64
float lastTemperature = -100 ;
@@ -73,12 +74,11 @@ RunningAverage raTemp(AVERAGES);
73
74
*
74
75
****************************************************/
75
76
void setup () {
76
- // clock_prescale_set(clock_div_8); // Switch to 1Mhz right after powerup.
77
77
78
78
pinMode (LED_PIN, OUTPUT);
79
79
digitalWrite (LED_PIN, LOW);
80
80
81
- Serial.begin (19200 );
81
+ Serial.begin (115200 );
82
82
Serial.print (F (" Sensebender Micro FW " ));
83
83
Serial.print (RELEASE);
84
84
Serial.flush ();
@@ -131,6 +131,12 @@ void loop() {
131
131
sendBattery ++;
132
132
bool forceTransmit = false ;
133
133
134
+ if ((measureCount == 5 ) && highfreq)
135
+ {
136
+ clock_prescale_set (clock_div_8); // Switch to 1Mhz for the reminder of the sketch, save power.
137
+ highfreq = false ;
138
+ }
139
+
134
140
if (measureCount > FORCE_TRANSMIT_INTERVAL) { // force a transmission
135
141
forceTransmit = true ;
136
142
measureCount = 0 ;
You can’t perform that action at this time.
0 commit comments