Coder Social home page Coder Social logo

arduino-libraries / arduino_pro_tutorials Goto Github PK

View Code? Open in Web Editor NEW
20.0 19.0 2.0 135 KB

This library contains the complete Arduino sketches from the Arduino Pro Tutorials found on the Arduino docs website under the Tutorials title of the corresponding product.

Home Page: https://docs.arduino.cc#pro-family

C 100.00%

arduino_pro_tutorials's Introduction

Arduino_Pro_Tutorials Library for Arduino

Check Arduino status Compile Examples status Spell Check status

This library contains the complete Arduino sketches from the Arduino Pro Tutorials found on the Arduino docs website under the Tutorials title of the corresponding product.

License

Copyright (c) 2021 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

arduino_pro_tutorials's People

Contributors

aentinger avatar alrvid avatar dependabot[bot] avatar hpssjellis avatar marqdevx avatar per1234 avatar sebromero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino_pro_tutorials's Issues

Bug report: Nicla is disconnecting/crashing after ~30 min of I2C com

@giulcioffi
@facchinm
I wanted to post this as an issue under arduino-libraries/Arduino_BHY2Host, as it pertains to your example code referenced by marqdevx in his tutorial, but it seems you've disabled it? I've tested the example located here (Arduino_Pro_Tutorials/examples/Nicla Sense ME as a MKR Shield) and it suffers from the same bug.

@marqdevx
I am trying to get your basic tutorial working for the Nicla and Portenta H7 connected over ESLOV. The bug in your example is that it only works for a little over half an hour before crashing.

I modified your code for debugging purposes:
Arduino_BHY2Host/examples/Accelerometer/Accelerometer_copy.ino:

#include "Arduino.h"
#include "Arduino_BHY2Host.h"
#include <LandoRGBLedPortenta.h>

SensorXYZ accel(SENSOR_ID_ACC);
LandoRGBLedPortenta portentaLeds;

const int MAX_DUPLICATE_READINGS = 10;
String colorToToggle = "white";
int duplicateReadings = 0;

static unsigned long printTime = 0;
static unsigned long startTime = 0;
static String timeToCrash = "";
static String lastAccelReading = "";

void setup()
{
  Serial.begin(115200);
  while(!Serial);
  Serial.println("Serial started!");
  portentaLeds.setColor("red");
  BHY2Host.begin(false, NICLA_VIA_ESLOV);
  Serial.println("BHY2HostSuccess!");
  portentaLeds.setColor("green");
  accel.begin();
  Serial.println("Leaving setup!");
  portentaLeds.setColor("blue");
  
  printTime = millis();
  startTime = printTime;
}

void loop()
{
  BHY2Host.update();

  if (millis() - printTime >= 1000) {
    printTime = millis();
    String accelReading = accel.toString();
    if(accelReading == lastAccelReading) {
      duplicateReadings++;
      if(duplicateReadings == MAX_DUPLICATE_READINGS) {
        timeToCrash = " " + String(printTime - startTime) + " ms";
        colorToToggle = "red";
      }
    }
    else {
      duplicateReadings = 0;
    }
    Serial.println(String("Acceleration values: ") + String(accelReading) + String(timeToCrash));
    portentaLeds.toggleColor(colorToToggle);
    lastAccelReading = accelReading;
  }
}

Arduino_BHY2/examples/App/App_copy.ino:

#include "Nicla_System.h"
#include "Arduino.h"
#include "Arduino_BHY2.h"

void colorCycle(int loops) {
  for(int i = 0; i < loops; i++) {
    nicla::leds.setColor(red);
    delay(1000);
    nicla::leds.setColor(green);
    delay(1000);
    nicla::leds.setColor(blue);
    delay(1000);
  }
  nicla::leds.setColor(off);
}

void setup(){
  BHY2.begin(NICLA_I2C, NICLA_VIA_ESLOV);
  nicla::leds.begin();
  colorCycle(5);
}

void loop(){
  // Update and then sleep
  nicla::leds.setColor(blue);
  BHY2.update(500);
  nicla::leds.setColor(off);
}

After 1,881,243–2,398,485 ms, the Nicla stops updating…

  • The blue led on Nicla stops flashing indicating that the BHY2.update(500); line in the loop probably caused an exception.

Pasted Graphic

If I reset just the Portenta and relaunch the serial printer, the Portenta halts at the accel.begin(); line in the setup...

Pasted Graphic 1

Portenta H7: USB_CORE_ID_HS core only runs as usbhost for ~30s then hangs (LEDKeyboardController)

Running the LEDKeyboardController.ino example, only runs for ~30seconds (sometimes shorter), then hangs when running on the USB-C (HS) core. Sometimes shows the message "RHUB HS:0 Disable 4", sometimes not.

The FS core appears to work fine (USB-A connector requiring a breakout board).

Portenta H7, connected a USB keyboard directly (no-hub) via USB-C -> USB-A adapter, and enabling supplyPowerOnVBUS.

RHUB HS:0      Connect
RHUB HS:0      Enable
DEV  HS.00     Allocate pipe, in = 0, out = 1
DEV  HS.01     Re-allocate pipe, in = 0, out = 1
DEV  HS.01     LS device, VID:413c PID:2113
ITF  HS.01.0-0 HID interface init
ITF  HS.01.0-0 Ep in 81
ITF  HS.01.1-1 HID interface init
ITF  HS.01.1-1 Ep in 82
DEV  HS.01     Device has 2 interfaces
....
r


r

r

r
RHUB HS:0      Disable 4

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.