/*Declare L298N Dual H-Bridge Motor Controller directly since there is not a library to load.*/ //Define L298N Dual H-Bridge Motor Controller Pins #define dir1PinL 2 //Motor direction #define dir2PinL 4 //Motor direction #define speedPinL 6 // Needs to be a PWM pin to be able to control motor speed #define dir1PinR 7 //Motor direction #define dir2PinR 8 //Motor direction #define speedPinR 5 // Needs to be a PWM pin to be able to control motor speed #define IR_PIN 3 //IR receiver Signal pin connect to Arduino pin 3 #define IR_ADVANCE 0x00FF18E7 //code from IR controller "▲" button #define IR_BACK 0x00FF4AB5 //code from IR controller "▼" button #define IR_RIGHT 0x00FF5AA5 //code from IR controller ">" button #define IR_LEFT 0x00FF10EF //code from IR controller "<" button #define IR_STOP 0x00FF38C7 //code from IR controller "OK" button #define IR_turnsmallleft 0x00FFB04F //code from IR controller "#" button enum DN { GO_ADVANCE, //go forward GO_LEFT, //left turn GO_RIGHT,//right turn GO_BACK,//backward STOP_STOP, DEF }Drive_Num=DEF; bool stopFlag = true;//set stop flag bool JogFlag = false; uint16_t JogTimeCnt = 0; uint32_t JogTime=0; uint8_t motor_update_flag = 0;