0% found this document useful (0 votes)
4 views2 pages

Ssiii

The document contains an Arduino sketch that defines two 8x8 arrays representing heart shapes, 'biglove' and 'smalllove'. It initializes pins for a display and includes a loop to display the big heart 100 times followed by the small heart 50 times. The 'Display' function controls the output to the pins to visualize the heart shapes on an 8x8 LED matrix.

Uploaded by

alejogaming25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Ssiii

The document contains an Arduino sketch that defines two 8x8 arrays representing heart shapes, 'biglove' and 'smalllove'. It initializes pins for a display and includes a loop to display the big heart 100 times followed by the small heart 50 times. The 'Display' function controls the output to the pins to visualize the heart shapes on an 8x8 LED matrix.

Uploaded by

alejogaming25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//LUIS ALFREDO NAJERA MARTINEZ

int R[] = {2,3,4,5,6,7,8,9};


// 2-dimensional array of column pin numbers:
int C[] = {10,11,12,13,A0,A1,A2,A3};

unsigned char biglove[8][8] = //the big "heart"


{
0,0,0,0,0,0,0,0,
0,1,1,0,0,1,1,0,
1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,
0,1,1,1,1,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
};

unsigned char smalllove[8][8] = //the small "heart"


{
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,0,1,0,0,1,0,0,
0,1,1,1,1,1,1,0,
0,1,1,1,1,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0,
};

void setup()
{
// iterate over the pins:
for(int i = 0;i<8;i++)
// initialize the output pins:
{
pinMode(R[i],OUTPUT);
pinMode(C[i],OUTPUT);
}
}

void loop()
{
for(int i = 0 ; i < 100 ; i++) //Loop display 100 times
{
Display(biglove); //Display the "Big Heart"
}
for(int i = 0 ; i < 50 ; i++) //Loop display 50 times
{
Display(smalllove); //Display the "small Heart"
}
}

void Display(unsigned char dat[8][8])


{
for(int c = 0; c<8;c++)
{
digitalWrite(C[c],LOW);//use thr column
//loop
for(int r = 0;r<8;r++)
{
digitalWrite(R[r],dat[r][c]);
}
delay(1);
Limpiar(); //Remove empty display light
}
}

void Limpiar()
{
for(int i = 0;i<8;i++)
{
digitalWrite(R[i],LOW);
digitalWrite(C[i],HIGH);
}
}

You might also like