// NeoPixel Flashlight.C // // NeoPixel Flashlight // Brightness goes from 0 (A/D = 0V) to 255 (A/D = 5V) // Input: RA0 // Output: RD0 (NeoPixel DIN) // Global Variables unsigned char PIXEL @ 0x000; const unsigned char MSG0[20] = "Flashlight "; const unsigned char MSG1[20] = " "; // Subroutine Declarationsb #include // Subroutines #include "lcd_portd.c" void NeoPixel_Display(unsigned char RED, unsigned char GREEN, unsigned char BLUE) { PIXEL = GREEN; asm(" call Pixel_8 "); PIXEL = RED; asm(" call Pixel_8 "); PIXEL = BLUE; asm(" call Pixel_8 "); asm(" return"); #asm Pixel_8: call Pixel_1 call Pixel_1 call Pixel_1 call Pixel_1 call Pixel_1 call Pixel_1 call Pixel_1 call Pixel_1 return Pixel_1: bsf ((c:3971)),0 ; PORTD,0 nop btfss ((c:0000)),7 bcf ((c:3971)),0 rlncf ((c:0000)),F nop nop bcf ((c:3971)),0 return #endasm } void Wait(unsigned int X) { unsigned int i, j; for (i=0; i