Hi - Im using NRF wireless with an arduino UNO. I'm able to send signals from UNO to UNO, but for whatever reason I cant get the servo thats on the receiving UNO to respond to anything. I suspect its some type of interference from the NRF? If the servo is plugged into the UNO and running off of the UNO 5v, then the receiver wont get any data over serial. I plugged the servo ground and 5V into its own power pack and the servo will hum quite loudly but not move. The serial does show that data is coming into the UNO. Currently I'm using no capacitors but suspect that Ill need to add some - and looking for some advice.
The receiver is definitely recognizing the "start button" going to 0.
Thanks very much
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "Servo.h"
int joystick[2];
int button[1];
int startButton;
int stopButton;
Servo myservo;
RF24 radio(7, 8);
const uint64_t pipe = 0xE8E8F0F0E1LL; //this is the pipe address for the radios
void setup()
{
myservo.attach(9);
myservo.write(90);
Serial.begin(9600);
Serial.println("NRF STARTING SON");
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
//radio.printDetails();
//pinMode(led, OUTPUT);
}
void loop()
{
if ( radio.available() )
{
{
//payload_t payload;
radio.read( &joystick, sizeof(joystick) );
//done = radio.read( &joystick, sizeof(joystick) );
Serial.print(joystick[0]);
Serial.print(joystick[1]);
//parse the string up and store into variables
startButton = joystick[1]; //load the 1 spot from the array
if (startButton == 0)
{
Serial.println("start button is 0");
myservo.write(90);
delay(20);
}
else
{
myservo.write(45);
delay(20);
}
// }
}
}
}
}/