xfpd
October 13, 2024, 6:24pm
3
@zuczac12 - You downloaded another bad sketch. You need to focus on (1) controlling your robot steering first, then (2) obstacles then (3) "firefighting" with flame-following and waterpump then (4) wifi, and do not use gas sensing, as that needs a lot more power and time (hours of warming up). You keep stopping and starting the same thing.
working on firefighting car ,
currently i am on the car movement.
big idea is front sensor triggered car moves forward up until safe distance from the fire.
and left and right will move the car accordingly until front sensor will face the flame.
// Setting Motor A
int enable1Pin = 14;
int motor1Pin1 = 27;
int motor1Pin2 = 26;
//Settin Motor B
int enable2Pin = 32;
int motor2Pin3 = 25;
int motor2Pin4 = 33;
// define pins for flame sensor
//#define FlamePinForawrd 17
#define FlamePinForawrd…
i a testing this code
// Setting Motor A
int enable1Pin = 14;
int motor1Pin1 = 27;
int motor1Pin2 = 26;
//Settin Motor B
int enable2Pin = 32;
int motor2Pin3 = 25;
int motor2Pin4 = 33;
#define FlamePinForawrd 15
#define RELAY_PIN 12 // pin 13 that connects to the relay to control the pump
void setup() {
//modding motor A
pinMode(enable1Pin, OUTPUT);
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);
//modding Motor B
pinMode(enable2Pin, OUTPUT);
pinMode(motor2Pin3…
#include <ESP32Servo.h>
Servo servo; // create servo object to control a servo
#define trigger_pin 5
#define echo_pin 18
#define SERVO_PIN 12 //seeting servo pin
// Setting Motor A
int enable1Pin = 14;
int motor1Pin1 = 27;
int motor1Pin2 = 26;
//Settin Motor B
int enable2Pin = 32;
int motor2Pin3 = 25;
int motor2Pin4 = 33;
// Setting PWM properties
const int frequency = 3000;
const int pwm_channel = 0;
const int resolution = 8;
long t; //var time to calculate distance
int distance; //va…