Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. void out7seg(unsigned char c){
  2.     switch(c) {
  3.  
  4.     case 0x0  :
  5.       *GPIO_ODR_LOW = 0×0;
  6.       break; /* optional */
  7.     case 0x1  :
  8.       *GPIO_ODR_LOW = 0×1;
  9.       break; /* optional */
  10.     case 0x2  :
  11.       *GPIO_ODR_LOW = 0×2;
  12.       break; /* optional */
  13.     case 0x3  :
  14.       *GPIO_ODR_LOW = 0×3;
  15.       break; /* optional */
  16.     case 0x4  :
  17.       *GPIO_ODR_LOW = 0×4;
  18.       break; /* optional */
  19.     case 0x5  :
  20.       *GPIO_ODR_LOW = 0×5;
  21.       break; /* optional */
  22.     case 0x6  :
  23.       *GPIO_ODR_LOW = 0×6;
  24.       break; /* optional */
  25.     case 0x7  :
  26.       *GPIO_ODR_LOW = 0×7;
  27.       break; /* optional */
  28.     case 0x8  :
  29.       *GPIO_ODR_LOW = 0×8;
  30.       break; /* optional */
  31.     case 0x9  :
  32.       *GPIO_ODR_LOW = 0×9;
  33.       break; /* optional */
  34.     case 0xA  :
  35.       *GPIO_ODR_LOW = 0×A;
  36.       break; /* optional */
  37.     case 0xB  :
  38.       *GPIO_ODR_LOW = 0×B;
  39.       break; /* optional */
  40.     case 0xC  :
  41.       *GPIO_ODR_LOW = 0×C;
  42.       break; /* optional */
  43.     case 0xD  :
  44.       *GPIO_ODR_LOW = 0×D;
  45.       break; /* optional */
  46.     case 0xE  :
  47.       *GPIO_ODR_LOW = 0×E;
  48.       break; /* optional */
  49.     case 0xF  :
  50.       *GPIO_ODR_LOW = 0×F;
  51.       break; /* optional */
  52.      
  53.    /* you can have any number of case statements */
  54.    default : /* Optional */
  55.    statement(s);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement