Keyestudio ESP32 Manual page 115

Starter kit
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

3. Test Code
When a large heart and a small heart switch display according to a certain time will give people a feeling of beating.
/*
keyestudio ESP32 Inventor Learning Kit
Project 18 Beating Heart
http://www.keyestudio.com
*/
#include
"LedControl.h"
int
DIN
=
23;
int
CLK
=
18;
int
CS
=
15;
LedControl lc=LedControl(DIN,CLK,CS,1);
const
byte IMAGES1[]
const
byte IMAGES2[]
void
setup() {
lc.shutdown(0,false);
// Set brightness to a medium value
lc.setIntensity(0,8);
// Clear the display
lc.clearDisplay(0);
}
void
loop(){
for(int
i=0; i
<
8; i++){
lc.setRow(0,i,IMAGES1[i]);
}
delay(1000);
for(int
i=0; i
<
8; i++){
lc.setRow(0,i,IMAGES2[i]);
}
delay(1000);
}
4. Test Result
After connecting the wiring and uploading code, the two sizes of hearts are displayed alternately.
8.5. Arduino Project
=
{0x30, 0x78, 0x7c, 0x3e, 0x3e, 0x7c, 0x78, 0x30};
=
{0x00, 0x10, 0x38, 0x1c, 0x1c, 0x38, 0x10, 0x00};
ESP32 Starter Kit
// a big heart
//a small heart
111

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Related Products for Keyestudio ESP32

Table of Contents

Save PDF