Hello, try with this modified code:
Code:DEFINE OSC 4 'Change it for your osc DEFINE ADC_CLOCK 3 steps var word stepArray var byte(4) x var byte CMCON = 7 TRISA = %00000011 'Porta.0 and porta.1 as input TRISB = %00000000 'Portb as output, 0=Output, 1=Input PORTB = 0 x=0 'input porta.0 ' You dont need this, just TRISA command 'input porta.1 stepArray[0] = %00001010 stepArray[1] = %00000110 stepArray[2] = %00000101 stepArray[3] = %00001001 pause 500 main: if porta.1 = 1 then for x=0 to 3 PORTB = stepArray[x] pause 20 'Change it for diferent speed next x endif if porta.0 = 1 then for x=0 to 3 PORTB = stepArray[3-x] pause 20 'Change it for diferent speed next x endif goto main




Bookmarks