Morning @ptillisch
Opened AppLab and it found the updates for CLI and router. Tried a simple ascii test sketch
#include <Arduino_RouterBridge.h>
void setup() {
//Initialize Monitor and wait for port to open:
Monitor.begin();
while (!Monitor) {
; // wait for Monitor port to connect. Needed for native USB port only
}
// prints title with ending line break
Monitor.println("ASCII Table ~ Character Map");
}
// first visible ASCIIcharacter '!' is number 33:
int thisByte = 33;
// you can also write ASCII characters in single quotes.
// for example, '!' is the same as 33, so you could also use this:
// int thisByte = '!';
void loop() {
// prints value unaltered, i.e. the raw binary version of the byte.
// The Monitor Monitor interprets all bytes as ASCII, so 33, the first number,
// will show up as '!'
Monitor.write(thisByte);
Monitor.print(", dec: ");
// prints value as string as an ASCII-encoded decimal (base 10).
// Decimal is the default format for Monitor.print() and Monitor.println(),
// so no modifier is needed:
Monitor.print(thisByte);
// But you can declare the modifier for decimal if you want to.
// this also works if you uncomment it:
// Monitor.print(thisByte, DEC);
Monitor.print(", hex: ");
// prints value as string in hexadecimal (base 16):
Monitor.print(thisByte, HEX);
Monitor.print(", oct: ");
// prints value as string in octal (base 8);
Monitor.print(thisByte, OCT);
Monitor.print(", bin: ");
// prints value as string in binary (base 2) also prints ending line break:
Monitor.println(thisByte, BIN);
// if printed last visible character '~' or 126, stop:
if (thisByte == 126) { // you could also use if (thisByte == '~') {
// This loop loops forever and does nothing
while (true) {
continue;
}
}
// go on to the next character
thisByte++;
}
But formatting to AppLab is a bit strange when it goes to Serial console. Possibly Monitor.prints adding a return at the end?
M
, dec:
77
, hex:
4D
, oct:
115
, bin:
1001101
N
, dec:
78
, hex:
4E
, oct:
116
, bin:
1001110
Tried the same sketch from IDE 2.x and it seems to work no issue
L, dec: 76, hex: 4C, oct: 114, bin: 1001100
M, dec: 77, hex: 4D, oct: 115, bin: 1001101
N, dec: 78, hex: 4E, oct: 116, bin: 1001110
O, dec: 79, hex: 4F, oct: 117, bin: 1001111
P, dec: 80, hex: 50, oct: 120, bin: 1010000
Tried a different sketch that just prints a string to the console and that seems to work
Thread 1 is accessing the shared resource
Thread 2 is accessing the shared resource
Thread 1 is accessing the shared resource
Thread 2 is accessing the shared resource
Thread 1 is accessing the shared resource
Thread 2 is accessing the shared resource