Code Monkey home page Code Monkey logo

nrf51-neopixel's People

Contributors

billylindeman avatar ericbarch avatar mathisgerdes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

nrf51-neopixel's Issues

Library does not work with RedBearLab nRF51822

Hi there,

thank you very much for this library. We were hoping to use it in a project with a RBL nRF51822 and a small Neopixel ring, but all it does is turn on all of the LEDs and set them to white. No matter what configuration we tried, the Neopixel ring never showed the colour pattern that we set in code.

Can you give me some hints on how to debug this, or how to change your code to make it work?

Thanks!

Not working with OSHChip

Board reference: http://oshchip.org/

I'm attempting to get a single LED working on the OSHChip board with no Soft Device.

Code

#include "nrf_delay.h"
#include "nrf_gpio.h"
#include "boards.h"
#include "neopixel.h"

int leds[] = { LED_RED, LED_GREEN, LED_BLUE };

neopixel_strip_t m_strip;
uint8_t dig_pin_num = OSHChip_Pin_3;
uint8_t leds_per_strip = 1;
uint8_t error;
uint8_t led_to_enable = 0;
uint8_t red = 0;
uint8_t green = 255;
uint8_t blue = 0;

int main(void)
{
  int i = 0;

  for(; i < 3; i++) {
    nrf_gpio_cfg_output(leds[i]);
    nrf_gpio_pin_set(leds[i]);
  }

  i = 1;

  neopixel_init(&m_strip, dig_pin_num, leds_per_strip);
  neopixel_clear(&m_strip);

  while(i++) {

    error = neopixel_set_color_and_show(&m_strip, led_to_enable, red, i % 255, blue);

    if(error) {
	    nrf_gpio_pin_clear(LED_RED);
    } else {
	    nrf_gpio_pin_set(LED_RED);
    }

    nrf_delay_ms(500);
  }
}

The result is a solid blue/red mix without any changes.

OSHChip_Pin_3 expands to 16 and I've verified signal on the pin.

Not sure what else to provide but I have noticed something interesting compared to the Adafruit NeoPixel library. Using that my scope shows a constant stream of ~8 bits in a span of about 30us where as this library shows (I assume) ~24 over an 80us period.

Not working with nRF52

Presumably there is an assumption about the clock rate of the SoC and that's why.
Tested empirically (adjusting # of NOPs):
nRF51: 9,0,1,8
nRF52: 41,20, 20,41
This works ok for first LED on strip but cracks up after that. Not accurate enough.
On the 52 it may be possible to do this better with interrupts. Not tried yet.

Strange behaviour with micro:bit

Hello,

I am trying to get this to work with micro:bit, but it is behaving strange. The first time I update the pixels, they all show as they are supposed to, but every second time all of the pixels light up yellow-ish.

I have tried to play around with the number of NOPS, but that does not seem to work.

This is the code I am using towards the NeoPixels:

`for (uint16_t lampe = 0; lampe < 64; lampe++) {
neopixel_set_color(&m_strip, lampe, 10, 0, 0);
neopixel_show(&m_strip);
uBit.sleep(200);

}`

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.