code receiver
byte RECEIVER_PIN = 12 ;
int LEDSHOW = 11;
int val = 0;
void setup()
{
Serial.begin(9600);
pinMode(RECEIVER_PIN,INPUT);
pinMode(LEDSHOW,OUTPUT);
Serial.println("GET");
}
void loop()
{ val= digitalRead(RECEIVER_PIN);
Serial.println(val);
if(val != 0){
digitalWrite(LEDSHOW,HIGH);
}
else{
digitalWrite(LEDSHOW,LOW);
}
}
code send
byte IR_SEND_PIN = A5; //
void setup() {
Serial.begin(9600 );
pinMode( IR_SEND_PIN, OUTPUT );
Serial.println("Ready...");
}
byte test_code_sequence[] = { 1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,255};
void burst( int cycles ) {
for( int i=0; i < cycles; i++ ) {
digitalWrite( IR_SEND_PIN, HIGH );
delayMicroseconds( 10 );
digitalWrite( IR_SEND_PIN, LOW );
delayMicroseconds( 10 ); //
}
}
void loop() {
Serial.println( "P" );
byte b;
uint16_t j = 0;
while (1) {
b = test_code_sequence[ j ];
if (b == 255) break;
burst( 10 );
j++;
}
delay(10);
}
I want to send the English alphabet such as A B C.
And the receiver will get the English alphabet.
that code can't be done as needed.