Hello, everyone in this section we are to learn about how to make robot eyes with Arduino, LED matrix. This is a very interesting project. Why I am doing this project, the reason is that I am making an obstacle-avoiding robot with eye expressions so that's why I am doing this project.
Components :
- Arduino uno BuyNow
- 8x8 LED matrix BuyNow
- bread board and wires BuyNow
If you want to buy Arduino components, I am giving you my affiliate links. If you buy the components using my affiliate links, it will help our channel and website growth. so do this small help.
Making video of Robot eyes with Arduino, LED matrix:
Watch the below video. This video will help to make Robot eyes with Arduino, LED matrix
CODE:
#include "LedControl.h"
LedControl lc=LedControl(11, 13, 3, 2);
const int addrL = 0; // first LED matrix - Left robot eye
const int addrR = 1; // second LED matrix - Right robot eye
void setup() {
/*The MAX72XX is in power-saving mode on startup*/
lc.shutdown(addrL,false);
lc.shutdown(addrR,false);
/* Set the brightness to max values */
lc.setIntensity(addrL,15);
lc.setIntensity(addrR,15);
/* and clear the display */
lc.clearDisplay(addrL);
lc.clearDisplay(addrR);
// turn on all LEDs for a test
for(int row=0;row<8;row++) {
lc.setRow(addrL, row, 255);
lc.setRow(addrR, row, 255);
delay(100);
}
delay(300);
}
void showNeutral() {
byte left[8] = {
B00000000,
B00111100,
B01000010,
B01011010,
B01011010,
B01000010,
B00111100,
B00000000};
displayEmotion(left, left);
}
void left1(){
byte left[8] = {
0b00000000,
0b00111100,
0b01001110,
0b01001110,
0b01111110,
0b01111110,
0b00111100,
0b00000000};
displayEmotion(left, left);
}
void right1(){
byte left[8] = {
0b00000000,
0b00111100,
0b01111110,
0b01111110,
0b01001110,
0b01001110,
0b00111100,
0b00000000
};
displayEmotion(left, left);
}
void he(){
byte left[8] = {
0b01000000,
0b10011000,
0b10100100,
0b10111100,
0b10111100,
0b10100100,
0b10011000,
0b01000000
};
displayEmotion(left, left);
}
void hec(){
byte left[8] = {
0b01000000,
0b10011000,
0b10111100,
0b10111100,
0b10111100,
0b10111100,
0b10011000,
0b01000000};
displayEmotion(left,left);
}
void displayEmotion(byte left[8], byte right[8]) {
lc.clearDisplay(addrL);
lc.clearDisplay(addrR);
for(int row=0;row<8;row++) {
lc.setRow(addrL,row,left[row]);
lc.setRow(addrR,row,right[row]);
}
}
void loop() {
// showNeutral();
// delay(4000);
left1();
delay(4000);
right1();
delay(4000);
he();
delay(4000);
hec();
delay(4000);
}
BITS MAPPING WEBSITE :
if you have any doubts regarding to this project, contact me on Instagram or comment on YouTube video. I will help my best.
0 Comments