Advertisement
Guest User

neopixel

a guest
Mar 30th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. void getZero()
  2.  {
  3.  
  4.     print("Zero \b \n");
  5.     XGpio_DiscreteWrite(&GpioOutput, LED_CHANNEL,
  6.                                     1 << 12);
  7.    
  8.     usleep(0.35);
  9.  
  10.     XGpio_DiscreteWrite(&GpioOutput, LED_CHANNEL,
  11.                                     0 << 12);
  12.  
  13.     usleep(0.8);
  14.  }
  15.  void getOne()
  16.  
  17.  {
  18.     print("One \b \n");
  19.         XGpio_DiscreteWrite(&GpioOutput, LED_CHANNEL,
  20.                                         1 << 12);
  21.        
  22.         usleep(0.7);
  23.  
  24.         XGpio_DiscreteWrite(&GpioOutput, LED_CHANNEL,
  25.                                         0 << 12);
  26.        
  27.         usleep(0.6);
  28.  }
  29.  int main()
  30. {
  31.     int Status,status;
  32.     Status = XGpio_Initialize(&GpioOutput, XPAR_AXI_GPIO_0_DEVICE_ID);
  33.     XGpio_SetDataDirection(&GpioOutput, LED_CHANNEL, 0x0);
  34.  
  35.     while(1)
  36.     {
  37.  
  38.                    
  39.                     for (int i =0 ; i< 24 ;i++) getOne();
  40.                     //I want to send all ONE to get white
  41.     }
  42.  
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement