Mike - K8LH
Well-Known Member
Hi Suraj,
Happy to hear your software/hardware is working.
Yes, you can use pwm values of 100.
You need to create a macro for that "Setled 00,00,99,66,20,12,04,01" functionality. The macro needs to be placed ahead of the code that uses it within the source file. Many people place it ahead of the code section.
Happy to hear your software/hardware is working.
Yes, you can use pwm values of 100.
You need to create a macro for that "Setled 00,00,99,66,20,12,04,01" functionality. The macro needs to be placed ahead of the code that uses it within the source file. Many people place it ahead of the code section.
Code:
setled macro p0,p1,p2,p3,p4,p5,p6,p7
movlw p0 ; pwm value 0..99
movwf led+0 ; led[0] = p0
movlw p1 ; pwm value 0..99
movwf led+1 ; led[1] = p1
movlw p2 ; pwm value 0..99
movwf led+2 ; led[2] = p2
movlw p3 ; pwm value 0..99
movwf led+3 ; led[3] = p3
movlw p4 ; pwm value 0..99
movwf led+4 ; led[4] = p4
movlw p5 ; pwm value 0..99
movwf led+5 ; led[5] = p5
movlw p6 ; pwm value 0..99
movwf led+6 ; led[6] = p6
movlw p7 ; pwm value 0..99
movwf led+7 ; led[7] = p7
endm
Last edited: