witam,
jak odczytać stan kilku pinów - przykładowo pb.1, pb.2, pd.6, pd.7 do jednej zmiennej byte?
jak odczytać stan kilku pinów - przykładowo pb.1, pb.2, pd.6, pd.7 do jednej zmiennej byte?
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam
dim x as byte
do
x.0=pinb.1
shift x, left, 3
x.0=pinb.2
shift x.0 , left, 2
x.0=pind.6
shift x.0 , left, 1
x.0=pind.7
loop
end
config portb=input:portb=255
dim stan as byte
stan.0=pinb.0
stan.1=pinb.1
stan.2=pinb.2
.............itd
dim xx as byte
dim yy as byte
xx = pinb
yy = pind
xx = xx and &b00000110
shift xx, right, 1
yy = yy and &b11000000
shift yy, right, 4
xx = xx or yy