Git Product home page Git Product logo

Comments (10)

glennblock avatar glennblock commented on August 17, 2024

I've noticed something which maybe matters (or maybe not).

In nrf.c the type declaration for number_of_ms is uint32_t while in LED.cpp, the length param is uint8_t

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

Looks like the underlying nrf_delay_us function is not working. Try this code and both lights will be on continually.

#include <Arduino.h>

LED led;

void setup() {
  animation.rainbows();
}

void loop() {
  led.on(1, "magenta", 100000);
  uint32_t delay = 5000;
  nrf_delay_us(delay);
  led.on(2, "red", 100000);
  nrf_delay_us(delay);
}

from arduino-library.

gortok avatar gortok commented on August 17, 2024

5000 microseconds is not a very long time at all.

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

from arduino-library.

gortok avatar gortok commented on August 17, 2024

nrf_delay_ms is milliseconds, it's in the same nrf_delay.h file.

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

These docs are wrong then

Each LED on the Jewelbot is refferred to by a number 0 through 3, which are called pins (i.e. pin 0, pin 1, etc). There are 4 different LEDs on the Jewelbot to control.

There is a set amount of pre-made color addresses for the Jewelbot.
* orange
* blue
* pink
* red
* violet
* magenta
* green

Time is addressed in milliseconds (i.e. if you want to have the LED on for 2 seconds, you'd write 2000

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

It doesn't appear it is working with microseconds either.

Given this code, I just see one color sometimes magenta, sometimes red.

#include <Arduino.h>

LED led;

void setup() {
}

void loop() {
  led.on(1, "magenta", 1000000);
  led.on(1, "red", 1000000);
}

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

Looks like type conversion / variable layout or something is causing the problem.

If i run this code, I will see different color blips every second.

void loop() {
  uint32_t delay = 1000000;
  led.on(1, "magenta", 1);
  nrf_delay_us(delay);
  led.on(1, "red", 1);
  nrf_delay_us(delay);
}

This code however does not work properly while led.on is calling nrf_delay_us(), the same function.

void loop() {
  uint32_t delay = 1000000;
  led.on(1, "magenta", delay);
  led.on(1, "red", delay);
}

from arduino-library.

glennblock avatar glennblock commented on August 17, 2024

Fixed with #14

from arduino-library.

Related Issues (18)

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.