Mini Tank Robot

KS0555 Mini Tank Robot V3 tutorial

  • 1. Product introduction
  • 2. Product setup
  • 3. Driver installation
  • 4. Arduino Tutorial
    • Assemble Fire Extinguishing Robot
    • 4.1 Data download
    • 4.2 Software Download
    • 4.3 Set Arduino IDE
    • 4.4 Add Library
    • 4.5 Projects
      • Project 1: LED Blinks
        • (1)Description:
        • (2)Parameters:
        • (3)Components Required:
        • (4)8833 Motor driver expansion board:
        • (5)Connection Diagram:
        • (6)Test Code:
        • (7)Test Results:
        • (8)Code Explanation:
        • (9)Extension Practice:
      • Project 2: Adjust LED Brightness
      • Project 3: Photoresistor
      • Project 4: Line Tracking Sensor
      • Project 5: Servo Control
      • Project 6: Ultrasonic Sensor
      • Project 7: IR Reception
      • Project 8: Motor Driving and Speed Control
      • Project 9: 8*16 Facial Expression LED Dot Matrix
      • Project 10: Light Following Tank
      • Project 11: Ultrasonic Following Tank
      • Project 12: Ultrasonic Obstacle Avoidance Tank
      • Project 13: Move-in-Confined-Space Tank
      • Project 14: Line-tracking Tank
      • Project 15: IR Remote Control Tank
      • Project 16: Bluetooth Remote Control
      • Project 17: Bluetooth Control Tank
      • Project 18: BT Speed Control Robot
      • Project 19: Ultrasonic Tank Robot Multiple Functions
      • Project 20: Flame Sensor
      • Project 21: Fan
      • Project 22: Fire Extinguishing Tank
      • Project 23: Fire Extinguishing Robot Multiple Functions
  • 5. Kidsblock Tutorial
  • 6. Need Technical Support?
Mini Tank Robot
  • 4. Arduino Tutorial
  • Project 1: LED Blinks
  • View page source

Project 1: LED Blinks

(1)Description:

For starters and enthusiasts, LED Blink is a fundamental program. LED, the abbreviation of light emitting diodes, consists of Ga, As, P, N chemical compounds and so on. The LED can flash in diverse colors by altering the delay time in the test code. When in control, power on GND and VCC. The LED will be on if the S end is at a high level; otherwise, it will go off.

(2)Parameters:

  • Control interface: digital port

  • Working voltage: DC 3.3-5V

  • Pin spacing: 2.54mm

  • LED display color: yellow

(3)Components Required:

(4)8833 Motor driver expansion board:

The Keyestudio 8833 motor driver expansion board is compatible with the Arduino UNO development board. Just stack it onto the development board when using it.

(5)Connection Diagram:

NOTE: The LED is connected to the D9 port. Remember to install jumper caps onto the shield.

(6)Test Code:

(Note: Do not connect the Bluetooth module before uploading the code, because uploading the code also uses serial communication, and there may be conflicts with the Bluetooth serial communication, which can cause the upload to fail.)

/*

Keyestudio Mini Tank Robot V3 (Popular Edition)

lesson 1.1

Blink

http://www.keyestudio.com

*/

int LED = 9; //Define the pin of LED to connect with digital port 9

void setup()
{
	pinMode(LED, OUTPUT); //Initialize the LED pin to output mode
}

void loop() //infinite loop
{
	digitalWrite(LED, HIGH); //Output high level and turn on the LED
	delay(1000); //Wait for 1s
	digitalWrite(LED, LOW); //Output low level and turn off the LED
	delay(1000); //Wait for 1s
}

(7)Test Results:

Upload the program, LED blinks at the interval of 1s.

(8)Code Explanation:

pinMode(LED,OUTPUT) - This function can denote that the pin is INPUT or OUTPUT

digitalWrite(LED,HIGH) - When pin is OUTPUT, we can set it to HIGH(output 5V) or LOW(output 0V)

(9)Extension Practice:

We have succeeded in blinking LED. Next, let’s observe what will happen to the LED if we modify pins and delay time.

Test Code

(Note: Do not connect the Bluetooth module before uploading the code, because uploading the code also uses serial communication, and there may be conflicts with the Bluetooth serial communication, which can cause the upload to fail.)

/*

Keyestudio Mini Tank Robot V3 (Popular Edition)

lesson 1.2

Blink

http://www.keyestudio.com

*/

int LED = 9; //Define the pin of the LED as 9

void setup()
{
	pinMode(LED, OUTPUT); //Set the pin of the LED to OUTPUT
}

void loop() //Infinite loop
{
    digitalWrite(LED, HIGH); //output high levels, light up LED
	delay(100); //Wait for 0.1s
	digitalWrite(LED, LOW); //LED output low levels, turn off LED
	delay(100); //Wait for 0.1s

}

The test result shows that the LED flashes faster. Therefore, we can draw a conclusion that pins and time delaying affect flash frequency.

Previous Next

© Copyright keyestudio.

Built with Sphinx using a theme provided by Read the Docs.