Click here to Skip to main content
15,885,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,

I write a c# mini program that sends 0-1 signal to arduino1 via com port. I found some libraries about NRF24L01 but almost all of them works when you write some numbers or words on arduino software. All i need is turn on green and red leds on arduino2 through arduino 1. arduino 1 communicates with my software and according to software i want to turn on leds on arduino 2.

this is my working code when i work with single arduino;

C#
#define BaudRate 9600

char incomingOption;

void setup()
{
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  Serial.begin(BaudRate);
}
void loop()
{
     incomingOption = Serial.read();
     switch(incomingOption){
        case '1':
          // Turn ON GREEN LED
          digitalWrite(2, HIGH);
          delay(5000);
          digitalWrite(2, LOW);
          
          break;
        case '0':
          // Turn ON RED LED
          digitalWrite(3, HIGH);
          delay(5000);
          digitalWrite(3, LOW);


          break;

          case 'OFF':
          digitalWrite(2, LOW);
          digitalWrite(3, LOW);
          break;
     }
}


how do i seperate this code for using nrf24L01 for 2 arduinos?
Posted

1 solution

As far as I know you have to use a specific library in order to obtain meaningful data from such devices. Have a llok at this page "nRF24L01"[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900