KRITSADA

Encoder Function Test

Oct 8th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Encoder(Cnt:number)  {
  2.     let x = 0
  3.     while (x < Cnt) {
  4.         while (pins.digitalReadPin(DigitalPin.P8) == 0) {}
  5.         x = x + 1
  6.         while (pins.digitalReadPin(DigitalPin.P8) == 1) {}
  7.         x = x + 1
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment