Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

RMTT Sensor Sample

ggasteratos

Member
Joined
Jan 18, 2022
Messages
5
Reaction score
1
Hi, I wrote a simple program that turns a LED on when a sensor detects smoke. I have a LED and a smoke sensor MQ-2 connected to RMTT. I upload the code from Arduino IDE to the Expansion module RMTT via USB and it works fine.

void setup() {
pinMode(21, OUTPUT); //led pin
pinMode(4, INPUT); //sensor pin
}

void loop() {
if(analogRead(4)> 500){
digitalWrite(21, HIGH);
//SET THE ALARM HERE...
}else
digitalWrite(21, LOW);
delay(100); // delay between reads
}

What I need is, to be able to sound an alarm on the mobile app which controls the drone. Is it possible?

Thanks in advance,
Greg.
 

New Posts

Members online

No members online now.

Forum statistics

Threads
5,690
Messages
39,934
Members
17,023
Latest member
Repiv

New Posts