SHARE
TWEET

Untitled

a guest Mar 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. void disp2(int num)
  3. {
  4.   if(num == 0)//0000
  5.   {
  6.     digitalWrite(b1, LOW);//
  7.     digitalWrite(b2, LOW);//0
  8.     digitalWrite(b3, LOW);//0
  9.     digitalWrite(b4, LOW);//0
  10.   }
  11.   if(num == 1)//0001
  12.   {
  13.     digitalWrite(b1, HIGH);//1
  14.     digitalWrite(b2, LOW);//0
  15.     digitalWrite(b3, LOW);//0
  16.     digitalWrite(b4, LOW);//0
  17.   }
  18.   if(num == 2)//0010
  19.   {
  20.     digitalWrite(b1, LOW);//0
  21.     digitalWrite(b2, HIGH);//1
  22.     digitalWrite(b3, LOW);//0
  23.     digitalWrite(b4, LOW);//0
  24.   }
  25.   if(num == 3)//0011
  26.   {
  27.     digitalWrite(b1, HIGH);//1
  28.     digitalWrite(b2, HIGH);//1
  29.     digitalWrite(b3, LOW);//0
  30.     digitalWrite(b4, LOW);//0
  31.   }
  32.   if(num == 4)//0100
  33.   {
  34.     digitalWrite(b1, LOW);//0
  35.     digitalWrite(b2, LOW);//0
  36.     digitalWrite(b3, HIGH);//1
  37.     digitalWrite(b4, LOW);//0
  38.   }
  39.   if(num == 5) //0101
  40.   {
  41.     digitalWrite(b1, HIGH);//1
  42.     digitalWrite(b2, LOW);//0
  43.     digitalWrite(b3, HIGH);//1
  44.     digitalWrite(b4, LOW);//0
  45.   }
  46.   if(num == 6) //0110
  47.   {
  48.     digitalWrite(b1, LOW);//0
  49.     digitalWrite(b2, HIGH);//1
  50.     digitalWrite(b3, HIGH);//1
  51.     digitalWrite(b4, LOW);//0
  52.   }
  53.   if(num == 7) //0111
  54.   {
  55.     digitalWrite(b1, HIGH);//1
  56.     digitalWrite(b2, HIGH);//1
  57.     digitalWrite(b3, HIGH);//1
  58.     digitalWrite(b4, LOW);//0
  59.   }
  60.   if(num == 8) //1000
  61.   {
  62.     digitalWrite(b1, LOW);//0
  63.     digitalWrite(b2, LOW);//0
  64.     digitalWrite(b3, LOW);//0
  65.     digitalWrite(b4, HIGH);//1
  66.   }
  67.   if(num == 9)//1001
  68.   {
  69.     digitalWrite(b1, HIGH);//1
  70.     digitalWrite(b2, LOW);//0
  71.     digitalWrite(b3, LOW);//0
  72.     digitalWrite(b4, HIGH);//1
  73.   }
  74. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top