Created
July 25, 2018 08:12
-
-
Save nandenjin/6c42bfa1107acf5744cfb9d2a9094e29 to your computer and use it in GitHub Desktop.
情報メディア特別演習
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <wiringPi.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main(void) { | |
int STROBE = 15; | |
int DATA = 16; | |
int CLK = 1; | |
if (wiringPiSetup() == -1) | |
exit(1); | |
pinMode( STROBE, OUTPUT ); | |
pinMode( DATA, OUTPUT ); | |
pinMode( CLK, OUTPUT ); | |
int c = 0; | |
//digitalWrite(STROBE,1); | |
//digitalWrite(CLK,1); | |
//digitalWrite(DATA,1); | |
//while(1){} | |
while(1){ | |
digitalWrite(STROBE,1); | |
digitalWrite(CLK,0); | |
sleep(1); | |
digitalWrite(DATA,1); | |
sleep(1); | |
digitalWrite(CLK,1); | |
sleep(1); | |
if(c%8==7){digitalWrite(STROBE,0);sleep(1);} | |
c++; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment