Lesson 3. The Serial Monitor Hello World

 

Hello World

The easiest way to start working with ESPcopter with Arduino begins here. You'll learn how to output print statements. The ESPcopte can use a Serial Monitor for displaying information such as print statements, sensor data, and the like. This is a very powerful tool for debugging long codes. Now for your first code!

Code

 

/*

Blink ESPcopter

By Metehan Emlik

*/

void setup() {

Serial.begin(9600);

} void loop() {

Serial.println("Hello World!");

delay(1000);

}


Lesson 2. RGB LEDs

Overview

 

In this lesson, you will learn how to use a RGB (Red Green Blue) LED with an Espcopter.

At first glance, RGB (Red, Green, Blue) LEDs look just like regular LEDs, however, inside the usual LED package, there are actually three LEDs, one red, one green and yes, one blue. By controlling the brightness of each of the individual LEDs you can mix pretty much any color you want.

You will use the analogWrite function of Arduino to control the color of the LED.

Code

int bluePin = 16; // unreverse
int redPin = 2; //reverse
int greenPin = 0; //revers

int wait = 500;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(bluePin, OUTPUT);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(bluePin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(wait); // wait for a second
digitalWrite(bluePin, LOW); // turn the LED off by making the voltage LOW
digitalWrite(redPin, LOW); // turn the LED on (HIGH is the voltage level)
delay(wait); // wait for a second
digitalWrite(redPin, HIGH); // turn the LED off by making the voltage LOW
digitalWrite(greenPin, LOW); // turn the LED on (HIGH is the voltage level)
delay(wait); // wait for a second
digitalWrite(greenPin, HIGH); // turn the LED off by making the voltage LOW
}


Lesson 1. Blink

/*

Blink ESPcopter

By Metehan Emlik

*/

int bluePin = 16; // Düz
int redPin = 2; //Ters
int greenPin = 0; //Ters

int bekleme = 500;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(bluePin, OUTPUT);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(bluePin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(bekleme); // wait for a second
digitalWrite(bluePin, LOW); // turn the LED off by making the voltage LOW

delay(bekleme); // wait for a second
}