arduino側 #include <Arduino.h> #define led1 PA8 #define led2 PA12 #define led3 PA0 #define in7 PB7 void setup() { // put your setup code here, to run once: pinMode(led1,OUTPUT); pinMode(led2,OUTPUT); pinMode(led3,OUTPUT); pinMode(in7,INPUT_PULLUP); } int a; int b; int c; int d; void loop() { //a=digitalRead(in7); //digitalWrite(led1,0); //digitalWrite(led2,1); //digitalWrite(led3,1); //delay(1000); //digitalWrite(led1,1); //digitalWrite(led2,0); //digitalWrite(led3,1); //delay(1000); //digitalWrite(led1,1); //digitalWrite(led2,1); //digitalWrite(led3,0); //delay(1000); // init led digitalWrite(led1,0); digitalWrite(led2,1); digitalWrite(led3,1); delay(500); while(1) { while( digitalRead(in7) == 1 ) {} delay(35); a=!(digitalRead(in7)); delay(35); b=!(digitalRead(in7)); delay(35); c=!(digitalRead(in7)); delay(35); d=!(digitalRead(in7)); delay(35); digitalWrite(led1, !(a) ); digitalWrite(led2, !(b) ); digitalWrite(led3, !(c) ); } } ichigojam 側 10 'SINNGOUKI 20 FOR I=0 TO 2 30 S=1<<I 40 WAIT 60:GOSUB 100 50 NEXT 60 GOTO 20 100 ' 110 OUT 11,0 120 WAIT 1 130 FOR J=0 TO 3 140 OUT 11,!( (S>>J)&1 ) 150 WAIT 2 160 NEXT 170 OUT 11,1 180 WAIT 2 190 RETURN