Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

CLUE Serial seems not to work correctly
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CLUE Serial seems not to work correctly

by johnsondavies on Thu Apr 23, 2020 10:20 am

Printing to the serial port on CLUE holds up the output for some reason. Here's a program to demonstrate:

Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  while ( !Serial ) delay(10);
  Serial.println("Goodnight moon!");
  for (int i=0; i<10; i++) {
    Serial.println("Wait...");
  }
  delay(5000);
  Serial.println("Hello sun!");
}

void loop() {}

Running this from the Arduino IDE, and then opening the Serial Monitor, should display "Goodnight moon!" and "Wait..." etc, followed by "Hello sun!" after five seconds.

On the CLUE it displays nothing for five seconds, and then displays all the text. It also gives the incorrect result on the Adafruit ItsyBitsy nRF52840.

On all other boards I've tried, such as Grand Central M4, it works correctly.

It's a problem because it makes my Lisp interpreter, uLisp, unusable on these nRF52840 boards.

I'm using Adafruit nRF52 boards file 0.19.0. on Arduino IDE 1.8.9 on a Mac Powerbook.

johnsondavies
 
Posts: 47
Joined: Wed Sep 06, 2017 11:24 am

Re: CLUE Serial seems not to work correctly

by kevinjwalters on Thu Apr 23, 2020 10:24 am

If you stick a counter inside the while loop how many times is that running on the nRF52840 boards?

kevinjwalters
 
Posts: 982
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE Serial seems not to work correctly

by johnsondavies on Thu Apr 23, 2020 10:29 am

Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  int n = 0;
  while ( !Serial ) { n++; delay(10); }
  Serial.println(n);
}

prints 664.

johnsondavies
 
Posts: 47
Joined: Wed Sep 06, 2017 11:24 am

Re: CLUE Serial seems not to work correctly

by kevinjwalters on Thu Apr 23, 2020 10:55 am

So all the output does appear, it just appears in one lump?

For experimentation purposes, you could add a Serial.flush() after each println to see what it does.

kevinjwalters
 
Posts: 982
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE Serial seems not to work correctly

by johnsondavies on Thu Apr 23, 2020 11:28 am

So all the output does appear, it just appears in one lump?


Yes, after five seconds.

johnsondavies
 
Posts: 47
Joined: Wed Sep 06, 2017 11:24 am

Please be positive and constructive with your questions and comments.