new to all of this and need a little help with Programming
flysky 6ch transmitter and receiver TO
Arduino UNO R3 ATmega328P CH340 clone i think TO
L298N OP Dual H-Bridge Motor Controller
this is what i have so far
double channel[2];
void setup() {
const byte Ch1 = 2; // rc receiver ch 1
const byte Ch2 = 3; // rc receiver ch 2
const byte IN1 = 12; // L298N OP IN 1
const byte IN2 = 13; // L298N OP IN 2
const byte IN3 = 8; // L298N OP IN 3
const byte IN4 = 9; // L298N OP IN 4
const byte ENA = 11; // L298N OP ENA
const byte ENB = 10; // L298N OP ENB
pinMode(Ch1, INPUT); // rc receiver ch 1
pinMode(Ch2, INPUT); // rc receiver ch 2
pinMode(IN2, OUTPUT); // L298N OP IN 2
pinMode(IN1, OUTPUT); // L298N OP IN 1
pinMode(ENA, OUTPUT); // L298N OP ENA
pinMode(ENB, OUTPUT); // L298N OP ENB
pinMode(IN4, OUTPUT); // L298N OP IN 4
pinMode(IN3, OUTPUT); // L298N OP IN 3
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
channel[0] = pulseIn(2, HIGH);
//receiver ch1 1489 to 1504 low 1146 high 1886
channel[1] = pulseIn(3, HIGH);
//receiver ch2 1504 to 1512 low 1161 high 1819
//channel[2] = pulseIn(4, HIGH);
//receiver ch3 1496 to 1504 low 1190 high 1870
Serial.print(channel[0]);
Serial.print(" - ");
Serial.println(channel[1]);
//Serial.print(" - ");
//Serial.println(channel[2]);
digitalWrite(13, HIGH);
digitalWrite(12, LOW);
digitalWrite(11, 80);
digitalWrite(10, 80);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
}
what i need is for the "receiver to Arduino UNO to L298N OP"
PLEASE HELP