Ejemplo n.º 1
0
void Spi_Flash_test(void)
{
    uint8_t count = 5;
    //unsigned int x=10,y=10;
    SpiFlash_Write_Data("NRF", FLASH_BLOCK_NUMBLE, FLASH_PAGE_NUMBLE, FLASH_WRITE_NUMBLE);
    nrf_delay_ms(100);

    SpiFlash_Read_Data(FLASH_Buf, FLASH_BLOCK_NUMBLE , FLASH_PAGE_NUMBLE , FLASH_WRITE_NUMBLE);
    if((FLASH_Buf[0] == 'N') && (FLASH_Buf[1] == 'R') && (FLASH_Buf[2] == 'F'))
    {
        DispColor(0xF800);//blue
        nrf_delay_ms(100);
        DispColor(0x0000);//black
        nrf_delay_ms(100);
        //DispStr(FLASH_Buf,x,y,BLACK,RED);
        //nrf_delay_ms(1000);
        //nrf_gpio_pin_set(IND_LED);
        //nrf_delay_ms(2000);
    }
    else
    {
        for(;;)
            DispColor(0x07E0);//green
        //nrf_delay_ms(100);
    }
}
Ejemplo n.º 2
0
void Bling::RainbowExplosion(){
  for(int i = 0; i<33; i++){
    ClearStrip();
    LightNth(64 -i, 0, 127, 0);
    LightNth(i, 127, 0, 0);
    delay(50);
  }
  for (int i=0; i<=24; i++) {
    DispClear();
  }
  delay(20);
  for (int i=0; i<=14; i++) {
    DispColor(127, 127, 127);
  }
  delay(20);
  for(int i=0;i<=33;i++){ 
    for(int j=0;j<=32-i;j++){
      DispClear();
    }
    delay(20);
    for(int k=0;k<i;k++){
      RainbowColor((i -k)*11);
      DispColor(RBE_R, RBE_G, RBE_B);
    }
    delay(20);
    for(int l=0;l<i;l++){
      RainbowColor((i + l)*3);
      DispColor(RBE_R, RBE_G, RBE_B);
    }
    delay(20);
  ClearStrip();
  }
  delay(20);
}
Ejemplo n.º 3
0
void Bling::LightNth(int n, int r, int g, int b) {
  if (n > num_pixels) {
    return;
  }
  for(int i=0; i<=n-1; i++) {
    DispClear();
    //DispColor(0,127,127);
  }
  DispColor(r, g, b);
  
  SetStrip();
}
Ejemplo n.º 4
0
void Bling::DispClear()
{
	DispColor(0, 0, 0);
}
Ejemplo n.º 5
0
void Bling::SetColor(int r, int g, int b){
  for(int i = 0; i < num_pixels; i++){
    DispColor(r, g, b);
  }
}