Servo motor controlled by Joystick using Arduino & Transceiver - Wireles...
Circuit Diagram: Required Components: Arduino uno/nano - 2 Nos Battery - 2 Nos Transceiver - 2 Nos Servo Motor - 2 Nos Joystick - 1 Nos Program Code: Transmitter Code: #include <SPI.h> #include "RF24.h" #include "nRF24L01.h" int potpin1 = A1; int potpin2 = A2; int data[2]; RF24 radio(9,10); const uint64_t pipe=0xE8E8F0F0E1LL; void setup() { Serial.begin(9600); radio.begin(); radio.openWritingPipe(pipe); } void loop(){ data[0] = analogRead(potpin1); data[1] = analogRead(potpin2); data[0] = map(data[0],0,1023,5,175); data[1] = map(data[1],0,1023,5,175); radio.write(data,sizeof(data)); { Serial.println(data[0]); Serial.println(data[1]); } } Receiver Code: #include <SPI.h> #include "RF24.h" #include "nRF24L01.h" #include <Servo.h> Servo servo1; Servo servo2; RF24 radio(9,10); const uint64_t pipe=0xE8E8F0F0E1LL; int data[2]; void setup() { servo1.attach(5); servo2.attach(6); Serial.begin(9
Buy R.F. resistors suppliers
ReplyDelete