Keyestudio Smart Little Turtle Robot V3 Manual page 177

Table of Contents

Advertisement

www.keyestudio.com
obtained from the modulus tool
uint8_t matrix_heart[8]={0x66,0x99,0x81,0x81,0x42,0x24,0x18,0x00};
uint8_t matrix_smile[8]={0x42,0xa5,0xa5,0x00,0x00,0x24,0x18,0x00};
uint8_t matrix_front2[8]={0x18,0x24,0x42,0x99,0x24,0x42,0x81,0x00};
uint8_t matrix_back2[8]={0x00,0x81,0x42,0x24,0x99,0x42,0x24,0x18};
uint8_t matrix_left2[8]={0x48,0x24,0x12,0x09,0x09,0x12,0x24,0x48};
uint8_t matrix_right2[8]={0x12,0x24,0x48,0x90,0x90,0x48,0x24,0x12};
uint8_t matrix_stop2[8]={0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18};
uint8_t LEDArray[8];
const int left_ctrl =
2;//define direction control pin of A motor
const int left_pwm =
9;//define PWM control pin of A motor
const int right_ctrl =
4;//define direction control pin of B motor
const int right_pwm =
5;//define PWM control pin of B motor
#include
"SR04.h"//define the library of ultrasonic sensor
#define TRIG_PIN 12//
set the signal input of ultrasonic sensor to D12
#define ECHO_PIN
13//set the signal output of ultrasonic sensor to D13
SR04 sr04 = SR04(ECHO_PIN,TRIG_PIN);
long
distance1,distance2,distance3;//define three distance
const int servopin =
10;//set the pin of servo to D10
int myangle;
int pulsewidth;
int val;
177

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents