Skip to main content.

LED and NIM_out control

 

for i=1,4,1 do
  jn_led(i,0);
  nim_setouts(i,0);
end
 
i=0;
status = 0;
mydelay = 15;
delaycnt = 0;
 
while(1) do
  doevents();
  pause(mydelay);
  i=i+1;
  if(i>4) then
    i=0;
    mydelay = mydelay + 10;
    delaycnt = delaycnt + 1;
    if (delaycnt > 15) then delaycnt = 0; mydelay = 15; end
  end
  for j=1,4,1 do
    if (j == i) then status = 1; else status = 0; end
    nim_setouts(j,status);
    jn_led(j,status);
  end
end