Coder Social home page Coder Social logo

Comments (10)

ladyada avatar ladyada commented on July 25, 2024 1

@hathach will try to replicate when there's some time :) a lot i2c changed recently

from adafruit_seesaw.

ladyada avatar ladyada commented on July 25, 2024

if the i2c is disconnected, it will cause undefined behavior so while this is worth looking at...plz do not disconnect cables :)

from adafruit_seesaw.

adrienp avatar adrienp commented on July 25, 2024

Haha good to know! I just assumed that because of the following code in the basic example I should expect trellis.begin() to return and not hang even if the cable is disconnected, and then print the appropriate message.

  if (!trellis.begin()) {
    Serial.println("Could not start trellis, check wiring?");
    while(1);
  } else {
    Serial.println("NeoPixel Trellis started");
  }

But interesting to know that if i2c is disconnected it could cause undefined behavior, thanks for explaining that!

from adafruit_seesaw.

hathach avatar hathach commented on July 25, 2024

I will try to reproduce it and post update

from adafruit_seesaw.

hathach avatar hathach commented on July 25, 2024

@adrienp could you confirm the issue still exists with Arduino IDE and also post your Arduino compile log as attached txt here for analysis. Since I only test and familiar with Arduino, I would like to make sure we are testing with the same setup as well as same version of BSP and used libraries.

from adafruit_seesaw.

adrienp avatar adrienp commented on July 25, 2024

@hathach Yes this issue also exists with Arduino IDE. When the trellis is properly connected, the "basic" example compiles and uploads and I get the expected message NeoPixel Trellis started in the Serial Monitor. When the trellis is not connected, it compiles and uploads, but nothing is printed to the serial monitor because it seems to hang on trellis.begin().
Apologies for the long copy-pastes below, but here's my compile log:

60_upload.txt
60_compile.txt

from adafruit_seesaw.

hathach avatar hathach commented on July 25, 2024

thank for the confirmation and log, please post it as attached txt, should you have to do it again for readibility.

from adafruit_seesaw.

hathach avatar hathach commented on July 25, 2024

@adrienp sorry for late response, I got my time to try this out. Device is not actually hanged, the Serial.print() does not appear because of while(1) ; blocking 100% CPU. TinyUSB stack run in the background and requires a delay()/yield() in order to send/receive data from/to USB bus. This is quite typical pitfall when using with TinyUSB. I will update the example to also add delay(1).

Note: You could also force serial immediately by using Serial.flush().

void setup() {
  Serial.begin(9600);
  while(!Serial) delay(1);
  
  if (!trellis.begin()) {
    Serial.println("Could not start trellis, check wiring?");
    while(1) delay(1);
  } else {
    Serial.println("NeoPixel Trellis started");
  }

PS: will be fixed by #62

from adafruit_seesaw.

adrienp avatar adrienp commented on July 25, 2024

Oh wow! Thanks for digging into this and responding @hathach !

from adafruit_seesaw.

hathach avatar hathach commented on July 25, 2024

no problem at all, I am glad it makes sense to you.

from adafruit_seesaw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.