Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with OSHChip #3

Open
morganrallen opened this issue Jul 13, 2017 · 1 comment
Open

Not working with OSHChip #3

morganrallen opened this issue Jul 13, 2017 · 1 comment

Comments

@morganrallen
Copy link

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.

@morganrallen
Copy link
Author

Adafruit NeoPixel on WeMos D1 Mini
dsc_1232

nrf51-neopixel on OSHChip
dsc_1233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant