Hello guys
I want to connect my pic18f with arduino mega. when i sent HIGH from the pic i want arduino to read it and and execute a command. Can you help me with the code please.
I tried this code but without result.
int inPin = 22; // choose the input pin
int val = 0; // variable for reading the pin status
void setup()
{
pinMode(inPin, INPUT);
}
void loop()
{
val = digitalRead(inPin); // read input value
if (val == HIGH) {
// execution of this command
}
}