I think for the most part i have been able to successfully port it, except that the SwitchPin does not work properly on the 16F684. My code is below:
I hope its something simple like my TRIS or PORT registers. Thanks much.Code:SwitchPin var PORTA.2 ' Active low RD CON %00010010 ' red GR CON %00110000 ' green BL CON %00100010 ' blue YL CON GR & RD ' green + red = yellow CY CON GR & BL ' green + blue = cyan PR CON BL & RD ' blue + red = purple WT CON GR & BL & RD ' green + blue + red = white OF con %11111111 ' all LEDs off ButtonCount VAR BYTE ButtonCount = 0 PORTC = %00111010 ' LEDs off TRISC = %00000010 ' PC2: Input, other pin: Output MAIN: IF !SwitchPin THEN WHILE !SwitchPin pAUSE 200 wend ButtonCount = ButtonCount + 1 SELECT CASE ButtonCount CASE 1 PORTC = RD CASE 2 PORTC = GR CASE 3 PORTC = BL CASE 4 PORTC = YL case 5 PORTC = CY case 6 PORTC = PR case 7 PORTC = WT case IS > 7 PORTC = OF ButtonCount = 0 END SELECT ENDIF GOTO MAIN END




Bookmarks