fork download
  1. // ルーレットが完成
  2.  
  3. /* pin assign
  4. * Digital_0 DATA (NJU3711)
  5. * Digital_1 CK (NJU3711)
  6. * Digital_2 SW(interrputing)
  7. * Digital_3 NC
  8. * Digital_4 STR (NJU3711)
  9. * Digital_5 NC
  10. * Digital_6 Kathode_1 (Tr)
  11. * Digital_7 Kathode_2 (Tr)
  12. * Digital_8 Kathode_3 (Tr)
  13. * Digital_9 Kathode_4 (Tr)
  14. * Digital_10 Kathode_5 (Tr)
  15. * Digital_11 Kathode_6 (Tr)
  16. * Digital_12 Kathode_7 (Tr)
  17. * Digital_13 Kathode_8 (Tr)
  18. */
  19.  
  20.  
  21. /**************************************************
  22. *   端子、定数の定義 と ヘッダのインクルード *
  23. ***************************************************/
  24. #include <math.h> // sin, cos
  25.  
  26. #define DATA 0 // シフトレジスタの制御ピンを定義
  27. #define CK 1 //
  28. #define STR 4 //
  29. #define WIDTH_ 8 // マトリクスLEDのドット数
  30. #define HIGH_ 8 //
  31. #define Y0 6 // Y軸0~7列目に対応するピンを定義
  32. #define Y1 7 //
  33. #define Y2 8 //
  34. #define Y3 9 //
  35. #define Y4 10 //
  36. #define Y5 11 //
  37. #define Y6 12 //
  38. #define Y7 13 //
  39.  
  40. #define UPBUTTON 14
  41. #define DOWNBUTTON 15
  42. #define LEFTBUTTON 16
  43. #define RIGHTBUTTON 17
  44.  
  45. #define MODENUM 3 // 登録モードの数
  46.  
  47. #define MENU 0 // メニュー
  48. #define ROULETTE 1 // ルーレット(ツール)
  49. #define HAYAOSHI 2 // 早押し(ゲーム)
  50.  
  51. //#define M_PI 3.14159265358979323846
  52. #define SIN(x) sin(x * (M_PI/180))
  53. #define COS(x) cos(x * (M_PI/180))
  54.  
  55. /**************************************************
  56. *       グローバル変数 *
  57. ***************************************************/
  58. const char zero[HIGH_][WIDTH_] = { // 0
  59. {0,0,1,1,1,1,0,0},
  60. {0,1,0,0,0,0,1,0},
  61. {0,1,0,0,0,0,1,0},
  62. {0,1,0,0,0,0,1,0},
  63. {0,1,0,0,0,0,1,0},
  64. {0,1,0,0,0,0,1,0},
  65. {0,1,0,0,0,0,1,0},
  66. {0,0,1,1,1,1,0,0}
  67. };
  68. const char one[HIGH_][WIDTH_] = { // 1
  69. {0,0,0,0,0,0,0,0},
  70. {0,0,0,0,0,0,1,0},
  71. {0,0,0,0,0,0,1,0},
  72. {0,0,0,0,0,0,1,0},
  73. {0,0,0,0,0,0,1,0},
  74. {0,0,0,0,0,0,1,0},
  75. {0,0,0,0,0,0,1,0},
  76. {0,0,0,0,0,0,0,0}
  77. };
  78. const char two[HIGH_][WIDTH_] = { // 2
  79. {0,0,1,1,1,1,0,0},
  80. {0,0,0,0,0,0,1,0},
  81. {0,0,0,0,0,0,1,0},
  82. {0,0,0,0,0,0,1,0},
  83. {0,0,1,1,1,1,0,0},
  84. {0,1,0,0,0,0,0,0},
  85. {0,1,0,0,0,0,0,0},
  86. {0,0,1,1,1,1,0,0}
  87. };
  88. const char three[HIGH_][WIDTH_] = { // 3
  89. {0,0,1,1,1,1,0,0},
  90. {0,0,0,0,0,0,1,0},
  91. {0,0,0,0,0,0,1,0},
  92. {0,0,0,0,0,0,1,0},
  93. {0,0,1,1,1,1,0,0},
  94. {0,0,0,0,0,0,1,0},
  95. {0,0,0,0,0,0,1,0},
  96. {0,0,1,1,1,1,0,0}
  97. };
  98.  
  99. const char yajirusi[HIGH_][WIDTH_] = { // 矢印
  100. {0,0,0,1,1,0,0,0},
  101. {0,0,1,1,1,1,0,0},
  102. {0,1,0,1,1,0,1,0},
  103. {1,0,0,1,1,0,0,1},
  104. {0,0,0,1,1,0,0,0},
  105. {0,0,0,1,1,0,0,0},
  106. {0,0,0,1,1,0,0,0},
  107. {0,0,0,1,1,0,0,0}
  108. };
  109.  
  110. char ground[HIGH_][WIDTH_] = { // グラウンド
  111. {0,0,0,0,0,0,0,0},
  112. {0,0,0,0,0,0,0,0},
  113. {0,0,0,0,0,0,0,0},
  114. {0,0,0,0,0,0,0,0},
  115. {0,0,0,0,0,0,0,0},
  116. {0,0,0,0,0,0,0,0},
  117. {0,0,0,0,0,0,0,0},
  118. {0,0,0,0,0,0,0,0}
  119. };
  120.  
  121. int i = 0;
  122. int num = 0, flag = 0;
  123. unsigned long time = 0;// 起動後の時間を記録する変数
  124. int state; // メニューの選択画面の状態を記憶
  125. int mode = 0; // 実行中のモードを記憶(メニュー、ルーレット…)
  126. int i_hayaosi = 0; // 早押:何個目の表示かを記憶する
  127. int muki[10]; // 早押:ランダムな矢印の向きを記憶
  128. int content_haya = 0; // 早押:状態を記憶(クリア・ミス入力)
  129. // 0:初期値, 1:クリア, 2:ミス
  130.  
  131. /**************************************************
  132. *     GPIO等の初期設定 *
  133. ***************************************************/
  134. void setup()
  135. {
  136. pinMode(DATA, OUTPUT); // DATA
  137. pinMode(CK, OUTPUT); // CK
  138. pinMode(STR, OUTPUT); // STR
  139. pinMode(2, INPUT); // 変化割り込み 左右スイッチの論理和
  140.  
  141. pinMode(Y0, OUTPUT); // LEDアノード側制御ピン
  142. pinMode(Y1, OUTPUT); //
  143. pinMode(Y2, OUTPUT); //
  144. pinMode(Y3, OUTPUT); //
  145. pinMode(Y4, OUTPUT); //
  146. pinMode(Y5, OUTPUT); //
  147. pinMode(Y6, OUTPUT); //
  148. pinMode(Y7, OUTPUT); //
  149.  
  150. pinMode(14, INPUT); // スイッチ(上)
  151. pinMode(15, INPUT); // スイッチ(下)
  152. pinMode(16, INPUT); // スイッチ(左)
  153. pinMode(17, INPUT); // スイッチ(右)
  154. pinMode(18, INPUT); // ランダム関数の種
  155.  
  156. //-- 変化割り込みの初期設定
  157. attachInterrupt(0, interrupt, RISING); // 2番ピンを割り込みで使用
  158. //--
  159.  
  160. //-- シフトレジスタの初期設定
  161. digitalWrite(STR, HIGH); // シフトレジスタを出力しない
  162. digitalWrite(DATA, LOW); // シフトレジスタ データを0クリア
  163. clock(); clock(); clock(); clock();//
  164. clock(); clock(); clock(); clock();//
  165. digitalWrite(STR, LOW); // シフトレジスタを出力する
  166. //--
  167. time = millis(); // プログラム開始時間を記録
  168. roll(ground, zero, 0); // 起動直後のメニューは0を表示
  169. state = 0; // 表示が0であることを記憶
  170. }
  171.  
  172. /**************************************************
  173. *       loop関数 *
  174. ***************************************************/
  175. void loop()
  176. {
  177. switch(state){
  178. case MENU:
  179. menu(); //メニューを実行
  180. break;
  181. case ROULETTE:
  182. roulette(); // ルーレットを実行
  183. break;
  184. case HAYAOSHI:
  185. hayaoshi(); // 早押しゲームを実行
  186. break;
  187. default:
  188. break;
  189. }
  190. }
  191.  
  192. /**************************************************
  193. *       ユーザー定義関数 *
  194. ***************************************************/
  195.  
  196. //================= メ ニ ュ ー ===================
  197. void menu()
  198. {
  199. static int state1 = 0; // 初期状態は'0'を表示しているので0を代入
  200. while(flag == 0){ // メニューが選択されない限りループ
  201. if(state1 != state){ // 現在の表示データと異なる場合
  202. switch(state){
  203. case 0: // メニュー0ならば
  204. state1 = 0; // 現在の数字を '0' に変更
  205. roll(ground, zero, 0);// 表示データを '0' に変更
  206. break;
  207. case 1:
  208. state1 = 1; // 現在の数字を '1' に変更
  209. roll(ground, one, 0); // 表示データを '1' に変更
  210. break;
  211. case 2:
  212. state1 = 2; // 現在の数字を '2' に変更
  213. roll(ground, two, 0); // 表示データを '2' に変更
  214. break;
  215. }
  216. }
  217. draw_ground(); // 選択中の番号を表示する
  218. }
  219.  
  220. return;
  221. }
  222.  
  223. //=============== ル ー レ ッ ト の 処 理 ===================
  224. void roulette()
  225. {
  226. int angle;
  227. int i, time;
  228.  
  229. randomSeed(analogRead(18)); // ランダム関数の種まき
  230. angle = 90 * random(0, 4); // 停止角度を決める(90~360)
  231. time = millis();
  232. roll(ground, yajirusi, 0);
  233. while(millis() - time < 2000){ // 2秒間めちゃくちゃな表示
  234. roll(ground, yajirusi, 90 * random(0,4));
  235. draw_ground();
  236. }
  237. roll(ground, yajirusi, angle);
  238.  
  239. for(i = 0; i < 100; i++){ // 決定した状態をしばらく表示
  240. draw_ground();
  241. }
  242. flag = 0; // メニュー画面をループするようフラグを立てる
  243. state = MENU; // メニュー画面へ移行
  244. return;
  245. }
  246.  
  247. //=============== 早 押 し ゲ ー ム の 処 理 ===================
  248. void hayaoshi()
  249. {
  250. int time, content, i;
  251. randomSeed(analogRead(18)); // ランダム関数の種まき
  252. //-- 矢印を決めるパラメータを10個得る
  253. for(i = 0; i < 10; i++){
  254. muki[i] = random(0, 4); // 0~3の値を得る
  255. }
  256.  
  257. //-- 開始までのカウント処理
  258. time = millis(); // 現在の時間を記録
  259. while(1){
  260. content = millis() - time; // 経過時間を得る(ms)
  261. if(content > 3000){ // 3秒以上経過
  262. break; // ゲームへ移行
  263. }else if(content > 2000){ // 2秒以上経過(1を表示)
  264. roll(ground, one, 0);
  265. }else if(content > 1000){ // 1秒以上経過(2を表示)
  266. roll(ground, two, 0); // 表示データに2をセット
  267. }else{ // 0秒以上経過(3を表示)
  268. roll(ground, three, 0); // 表示データに3をセット
  269. }
  270. draw_ground(); //
  271. }
  272.  
  273. //-- ゲーム開始
  274. // time = millis(); // ゲーム開始の時間を得る
  275. muki[0] = 0; //デバッグ用に必ず上向きで出るよう設定
  276. roll(ground, yajirusi, muki[i_hayaosi] * 90); // 最初の矢印を表示
  277.  
  278. while(1){ // このループ内でゲームを処理する
  279. if(content_haya == 1){ // ゲームクリアの場合
  280. //gameclear(); // クリアした時間を出力 引数はタイム
  281. break;
  282. }else if(content_haya == 2){ // ゲーム失敗の場合
  283. //gameretired(); // 失敗の表示
  284. break;
  285. }
  286. draw_ground();
  287. }
  288.  
  289. //-- 後処理
  290. flag = 0; // メニュー画面をループするようフラグを立てる
  291. state = MENU; // メニュー画面へ移行
  292. i_hayaosi = 0; // ゲームのプレイ情報を初期化
  293. content_haya = 0;
  294. }
  295.  
  296. //=================== スイッチ 割 り 込 み 処 理 ===================
  297. void interrupt()
  298. {
  299. static int angle = 0;
  300. unsigned long time2 = millis(); // チャタリング防止の処理
  301. if(time2 - time < 50) return; //
  302.  
  303. if(digitalRead(UPBUTTON)){ //-----上ボタンが押されたならば-----
  304. // メニュー表示中の処理
  305. if(flag != 1 && state != 0){ // メニュー画面以外のゲームが終了していれば実行
  306. // 選択中のメニューを決定する
  307. flag = 1; // メニュー画面を抜けるフラグを立てる
  308. return;
  309. }else if(state == HAYAOSHI){ // ○早押しゲームでの処理
  310. if(muki[i_hayaosi] == 0){
  311. i_hayaosi += 1; // 次の矢印のパラメータへ加算
  312. roll(ground, yajirusi, muki[i_hayaosi] * 90); //矢印を次の矢印に更新
  313. if(i_hayaosi == 10) content_haya = 1; // ゲームクリアを教える
  314. }else{
  315. content_haya = 2; // ゲーム失敗を教える
  316. }
  317. }
  318. }else if(digitalRead(DOWNBUTTON)){ //-----下ボタンが押されたならば-----
  319. if( flag == 0 ) return; // メニュー画面上での入力は無効
  320.  
  321. if( state == HAYAOSHI){ // ○早押しゲームでの処理
  322. if(muki[i_hayaosi] == 2){
  323. i_hayaosi ++; // 次の矢印のパラメータへ加算
  324. roll(ground, yajirusi, muki[i_hayaosi] * 90); //矢印を次の矢印に更新
  325. if(i_hayaosi == 10) content_haya = 1; // ゲームクリアを教える
  326. }else{
  327. content_haya = 2; // ゲーム失敗を教える
  328. }
  329. }
  330. }else if(digitalRead(LEFTBUTTON)){ //-----左ボタンが押されたならば-----
  331. if(flag != 1 && state > 0){ // メニュー表示中の処理
  332. state --; // メニューを-1する
  333. }else if(state == HAYAOSHI){ // ○早押しゲームでの処理
  334. if(muki[i_hayaosi] == 3){
  335. i_hayaosi ++; // 次の矢印のパラメータへ加算
  336. roll(ground, yajirusi, muki[i_hayaosi] * 90); //矢印を次の矢印に更新
  337. if(i_hayaosi == 10) content_haya = 1; // ゲームクリアを教える
  338. }else{
  339. content_haya = 2; // ゲーム失敗を教える
  340. }
  341. }
  342. }else if(digitalRead(RIGHTBUTTON)){//-----右ボタンが押されたならば-----
  343. if(flag != 1 && state < MODENUM-1){ // メニュー表示中の処理
  344. state ++; // メニューを+1する
  345. }else if(state == HAYAOSHI){ // ○早押しゲームでの処理
  346. if(muki[i_hayaosi] == 1){
  347. i_hayaosi ++; // 次の矢印のパラメータへ加算
  348. roll(ground, yajirusi, muki[i_hayaosi] * 90); //矢印を次の矢印に更新
  349. if(i_hayaosi == 10) content_haya = 1; // ゲームクリアを教える
  350. }else{
  351. content_haya = 2; // ゲーム失敗を教える
  352. }
  353. }
  354. }
  355. time = time2;
  356. }
  357.  
  358. //===================ground配列をマトリクスLEDに描画===================
  359. void draw_ground()
  360. {
  361. for(int i = 0; i < 8; i++){ // 8列分列アノード側をシフトさせる。
  362. if(i==0){ // 1列目が参照されていたならば
  363. digitalWrite(DATA, HIGH); // HIGHをセットしてシフト
  364. clock();
  365. }else{ // 2列目以降が参照されていたならば
  366. digitalWrite(DATA, LOW); // 順次LOWをセットしてシフト
  367. clock();
  368. }
  369. digitalWrite(Y0, (ground[0][i]==1)?HIGH:LOW);
  370. digitalWrite(Y1, (ground[1][i]==1)?HIGH:LOW);
  371. digitalWrite(Y2, (ground[2][i]==1)?HIGH:LOW);
  372. digitalWrite(Y3, (ground[3][i]==1)?HIGH:LOW);
  373. digitalWrite(Y4, (ground[4][i]==1)?HIGH:LOW);
  374. digitalWrite(Y5, (ground[5][i]==1)?HIGH:LOW);
  375. digitalWrite(Y6, (ground[6][i]==1)?HIGH:LOW);
  376. digitalWrite(Y7, (ground[7][i]==1)?HIGH:LOW);
  377. delay(2);
  378. wipe_out_shadow(); // 列を切り替える前に表示を消すことで残像処理
  379. }
  380. }
  381.  
  382. //===================シフトレジスタへのクロック処理===================
  383. void clock()
  384. {
  385. digitalWrite(CK, LOW);
  386. delayMicroseconds(5);
  387. digitalWrite(CK, HIGH);
  388. delayMicroseconds(5);
  389. digitalWrite(CK, LOW);
  390. }
  391.  
  392. //===================ドットマトリクスLEDの残像処理===================
  393. void wipe_out_shadow()
  394. {
  395. digitalWrite(Y0, LOW);
  396. digitalWrite(Y1, LOW);
  397. digitalWrite(Y2, LOW);
  398. digitalWrite(Y3, LOW);
  399. digitalWrite(Y4, LOW);
  400. digitalWrite(Y5, LOW);
  401. digitalWrite(Y6, LOW);
  402. digitalWrite(Y7, LOW);
  403. }
  404.  
  405. //======引数の表示データを任意の角度に回転してground配列にセット=====
  406. void roll(char to[][8], const char from[][8], int angle)
  407. {
  408. int x, y;
  409. double x1 = 0.0, y1 = 0.0;
  410. if(angle == 0){ // 回転角度が0なら回転処理は行わない
  411. for (y = 0; y < 8; y++){
  412. for (x = 0; x < 8; x++){
  413. to[y][x] = from[y][x];
  414. }
  415. }
  416. }else{ // 回転処理
  417. for (y = 0; y < 8; y++){
  418. for (x = 0; x < 8; x++){
  419. x1 = ((x - 3.5) * COS(angle) - (y - 3.5) * SIN(angle));
  420. y1 = ((x - 3.5) * SIN(angle) + (y - 3.5) * COS(angle));
  421. x1 = x1 + 3.5; // ずらした座標を修正
  422. y1 = y1 + 3.5; //
  423.  
  424. if (from[y][x] == 1){
  425. if ((int)(x1 + 0.5) < WIDTH_ && (int)(y1 + 0.5) < HIGH_) to[(int)(y1 + 0.5)][(int)(x1 + 0.5)] = 1;
  426. }else{
  427. if ((int)(x1 + 0.5) < WIDTH_ && (int)(y1 + 0.5) < HIGH_) to[(int)(y1 + 0.5)][(int)(x1 + 0.5)] = 0;
  428. }
  429. }
  430. }
  431. }
  432. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'setup':
prog.c:136:3: warning: implicit declaration of function 'pinMode' [-Wimplicit-function-declaration]
   pinMode(DATA, OUTPUT);  // DATA
   ^
prog.c:136:17: error: 'OUTPUT' undeclared (first use in this function)
   pinMode(DATA, OUTPUT);  // DATA
                 ^
prog.c:136:17: note: each undeclared identifier is reported only once for each function it appears in
prog.c:139:14: error: 'INPUT' undeclared (first use in this function)
   pinMode(2, INPUT);      // 変化割り込み 左右スイッチの論理和
              ^
prog.c:157:3: warning: implicit declaration of function 'attachInterrupt' [-Wimplicit-function-declaration]
   attachInterrupt(0, interrupt, RISING);  // 2番ピンを割り込みで使用
   ^
prog.c:157:22: error: 'interrupt' undeclared (first use in this function)
   attachInterrupt(0, interrupt, RISING);  // 2番ピンを割り込みで使用
                      ^
prog.c:157:33: error: 'RISING' undeclared (first use in this function)
   attachInterrupt(0, interrupt, RISING);  // 2番ピンを割り込みで使用
                                 ^
prog.c:161:3: warning: implicit declaration of function 'digitalWrite' [-Wimplicit-function-declaration]
   digitalWrite(STR, HIGH);           // シフトレジスタを出力しない
   ^
prog.c:161:21: error: 'HIGH' undeclared (first use in this function)
   digitalWrite(STR, HIGH);           // シフトレジスタを出力しない
                     ^
prog.c:162:22: error: 'LOW' undeclared (first use in this function)
   digitalWrite(DATA, LOW);           // シフトレジスタ データを0クリア
                      ^
prog.c:163:3: warning: implicit declaration of function 'clock' [-Wimplicit-function-declaration]
   clock(); clock(); clock(); clock();//
   ^
prog.c:167:3: warning: implicit declaration of function 'millis' [-Wimplicit-function-declaration]
   time = millis();                   // プログラム開始時間を記録
   ^
prog.c:168:3: warning: implicit declaration of function 'roll' [-Wimplicit-function-declaration]
   roll(ground, zero, 0);             // 起動直後のメニューは0を表示
   ^
prog.c: In function 'loop':
prog.c:179:7: warning: implicit declaration of function 'menu' [-Wimplicit-function-declaration]
       menu();      //メニューを実行
       ^
prog.c:182:7: warning: implicit declaration of function 'roulette' [-Wimplicit-function-declaration]
       roulette();  // ルーレットを実行
       ^
prog.c:185:7: warning: implicit declaration of function 'hayaoshi' [-Wimplicit-function-declaration]
       hayaoshi();  // 早押しゲームを実行
       ^
prog.c: At top level:
prog.c:197:6: warning: conflicting types for 'menu'
 void menu()
      ^
prog.c:179:7: note: previous implicit declaration of 'menu' was here
       menu();      //メニューを実行
       ^
prog.c: In function 'menu':
prog.c:217:5: warning: implicit declaration of function 'draw_ground' [-Wimplicit-function-declaration]
     draw_ground();              // 選択中の番号を表示する
     ^
prog.c: At top level:
prog.c:224:6: warning: conflicting types for 'roulette'
 void roulette()
      ^
prog.c:182:7: note: previous implicit declaration of 'roulette' was here
       roulette();  // ルーレットを実行
       ^
prog.c: In function 'roulette':
prog.c:229:3: warning: implicit declaration of function 'randomSeed' [-Wimplicit-function-declaration]
   randomSeed(analogRead(18));     // ランダム関数の種まき
   ^
prog.c:229:3: warning: implicit declaration of function 'analogRead' [-Wimplicit-function-declaration]
prog.c:230:3: warning: implicit declaration of function 'random' [-Wimplicit-function-declaration]
   angle = 90 * random(0, 4);      // 停止角度を決める(90~360)
   ^
prog.c: At top level:
prog.c:248:6: warning: conflicting types for 'hayaoshi'
 void hayaoshi()
      ^
prog.c:185:7: note: previous implicit declaration of 'hayaoshi' was here
       hayaoshi();  // 早押しゲームを実行
       ^
prog.c: In function 'interrupt':
prog.c:303:3: warning: implicit declaration of function 'digitalRead' [-Wimplicit-function-declaration]
   if(digitalRead(UPBUTTON)){          //-----上ボタンが押されたならば-----
   ^
prog.c:299:14: warning: unused variable 'angle' [-Wunused-variable]
   static int angle = 0;
              ^
prog.c: At top level:
prog.c:359:6: warning: conflicting types for 'draw_ground'
 void draw_ground()
      ^
prog.c:217:5: note: previous implicit declaration of 'draw_ground' was here
     draw_ground();              // 選択中の番号を表示する
     ^
prog.c: In function 'draw_ground':
prog.c:361:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for(int i = 0; i < 8; i++){      // 8列分列アノード側をシフトさせる。
   ^
prog.c:361:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
prog.c:363:26: error: 'HIGH' undeclared (first use in this function)
       digitalWrite(DATA, HIGH);    // HIGHをセットしてシフト
                          ^
prog.c:366:26: error: 'LOW' undeclared (first use in this function)
       digitalWrite(DATA, LOW);     // 順次LOWをセットしてシフト
                          ^
prog.c:377:5: warning: implicit declaration of function 'delay' [-Wimplicit-function-declaration]
     delay(2);
     ^
prog.c:378:5: warning: implicit declaration of function 'wipe_out_shadow' [-Wimplicit-function-declaration]
     wipe_out_shadow();              // 列を切り替える前に表示を消すことで残像処理
     ^
prog.c: At top level:
prog.c:383:6: warning: conflicting types for 'clock'
 void clock()
      ^
prog.c:163:3: note: previous implicit declaration of 'clock' was here
   clock(); clock(); clock(); clock();//
   ^
prog.c: In function 'clock':
prog.c:385:20: error: 'LOW' undeclared (first use in this function)
   digitalWrite(CK, LOW);
                    ^
prog.c:386:3: warning: implicit declaration of function 'delayMicroseconds' [-Wimplicit-function-declaration]
   delayMicroseconds(5);
   ^
prog.c:387:20: error: 'HIGH' undeclared (first use in this function)
   digitalWrite(CK, HIGH);
                    ^
prog.c: At top level:
prog.c:393:6: warning: conflicting types for 'wipe_out_shadow'
 void wipe_out_shadow()
      ^
prog.c:378:5: note: previous implicit declaration of 'wipe_out_shadow' was here
     wipe_out_shadow();              // 列を切り替える前に表示を消すことで残像処理
     ^
prog.c: In function 'wipe_out_shadow':
prog.c:395:22: error: 'LOW' undeclared (first use in this function)
     digitalWrite(Y0, LOW);
                      ^
prog.c: At top level:
prog.c:406:6: warning: conflicting types for 'roll'
 void roll(char to[][8], const char from[][8], int angle)
      ^
prog.c:168:3: note: previous implicit declaration of 'roll' was here
   roll(ground, zero, 0);             // 起動直後のメニューは0を表示
   ^
stdout
Standard output is empty