File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ int printf(const char* fmt, ...) {
15
15
va_end (arg_ptr);
16
16
17
17
// output to the serial console through the 'Serial'
18
- #if 1
18
+ #if defined(ARDUINO_UNOR4_MINIMA)
19
+
19
20
len = Serial.write ((uint8_t *)buf, (size_t )len);
20
- #else
21
+
22
+ #else // ARDUINO_UNOR4_WIFI
23
+
21
24
len = Serial.print (buf);
22
- #endif
23
25
24
- #if defined(ARDUINO_UNOWIFIR4) && 1
25
- delay (2 ); // UNO R4 WiFi needs some delay to fix buffer overrun
26
26
#endif
27
27
28
28
return len;
Original file line number Diff line number Diff line change @@ -9,12 +9,21 @@ void setup() {
9
9
Serial.begin (9600 );
10
10
while (!Serial);
11
11
12
+ #ifdef ARDUINO_UNOR4_WIFI
13
+ // UNO R4 WiFi needs to wait for a while to complete Serial initialization.
14
+ delay (1000 ); // It requires at least 600 ms.
15
+ #endif
16
+
17
+ u_int32_t t = micros ();
18
+
12
19
#define EPSILON 0.00001
13
20
14
21
for (float f = 0.0 ; f <= 1.0 + EPSILON; f += 0.01 ) {
15
22
printf (" f = %5.3f\n " , f);
16
23
printf (" e = %5.3e\n " , f);
17
24
}
25
+
26
+ Serial.println (micros () - t);
18
27
}
19
28
20
29
void loop () {
You can’t perform that action at this time.
0 commit comments