BANANA-IO-EXTEND Banana Pi & Raspberry Pi  IO extend board, can use on Raspberry Pi
      BANANA-IO-EXTEND Banana Pi & Raspberry Pi  IO extend board, can use on Raspberry Pi
      BANANA-IO-EXTEND Banana Pi & Raspberry Pi  IO extend board, can use on Raspberry Pi

      BANANA-IO-EXTEND Banana Pi & Raspberry Pi IO extend board, can use on Raspberry Pi

      BANANA-IO-EXTEND
      11,88 €

      9.90 € bez DPH

      BANANA-IO-EXTEND Banana Pi & Raspberry Pi  IO extend board, can use on Raspberry Pi

      Množstvo:
      Na sklade 9 ks

      BANANA-IO-EXTEND Banana Pi & Raspberry Pi  IO extend board, can use on Raspberry Pi

       

      Use WiringPi write C code to test .

      #include <wiringPi.h>
      #include <stdio.h>
      int SER   = 12;
      int RCLK  = 10;
      int SRCLK = 14;
      unsigned char LED[8]={0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
      void SIPO(unsigned char byte);
      void pulse(int pin);
      void init() {
          pinMode(SER, OUTPUT);
          pinMode(RCLK, OUTPUT);
          pinMode(SRCLK, OUTPUT);
          digitalWrite(SER, 0);
          digitalWrite(SRCLK, 0);
          digitalWrite(RCLK, 0);    
      }
      void delayMS(int x) {
        usleep(x * 1000);
      }
      int main (void)
      {
          if (-1 == wiringPiSetup()) {
              printf("Setup wiringPi failed!");
              return 1;
          }    
          init();
          int i;
          while(1) {  
            for(i = 0; i < 8; i++)
            {
             SIPO(LED[i]);
             pulse(RCLK);
             delayMS(50);
             printf(" i = %d", i);
            }
            printf("n");
            delayMS(500); // 500 ms
             
            for(i = 7; i >= 0; i--)
            {
             SIPO(LED[i]);
             pulse(RCLK);
             delayMS(50);
             printf(" i = %d", i);
            }
            delayMS(500); // 500 ms
          }
          usleep(1000);
          digitalWrite(RCLK, 1);
      }
      void SIPO(unsigned char byte) 
      {
          int i;
          for (i=0;i<8;i++) 
          {
              digitalWrite(SER,((byte & (0x80 >> i)) > 0));
              pulse(SRCLK);
          }
      }
      void pulse(int pin) 
      {
          digitalWrite(pin, 1);
          digitalWrite(pin, 0);
      }

       

      Banana Pi
      BANANA-IO-EXTEND
      9 Položky

      Špecifické referencie

      BANANA-IO-EXTEND Banana Pi IO extend board, can use on Raspberry Pi

      BANANA-IO-EXTEND Banana Pi & Raspberry Pi IO extend board, can use on Raspberry Pi

      11,88 €

      9.90 € bez DPH