Question
Utilizing the 8x8 dot matrix display the smile face and then rotate the face 90 degrees at a time until the face is back to
Utilizing the 8x8 dot matrix display the smile face and then rotate the face 90 degrees at a time until the face is back to the original position. The face can be rotated clockwise or counter clockwise. Place a 1 second delay for each 90 degree rotation.
---------------- ( here is the code add the missing parts)
int Pin1 = 13;
int Pin2 = 12;
int Pin3 = 11;
int Pin4 = 10;
int Pin5 = 4;
int Pin6 = 5;
int Pin7 = 6;
int Pin8 = 7;
int Pin9 = 2;
int Pin10 = 3;
int Pin11 = 8;
int Pin12 = 9;
int Pin13 = A0;
int Pin14 = A1;
int Pin15 = A2;
int Pin16 = A3;
int r=100;
int c=2;
int d=1000;
void setup() {
// put your setup code here, to run once:
pinMode(Pin1, OUTPUT);
pinMode(Pin2, OUTPUT);
pinMode(Pin3, OUTPUT);
pinMode(Pin4, OUTPUT);
pinMode(Pin5, OUTPUT);
pinMode(Pin6, OUTPUT);
pinMode(Pin7, OUTPUT);
pinMode(Pin8, OUTPUT);
pinMode(Pin9, OUTPUT);
pinMode(Pin10, OUTPUT);
pinMode(Pin11, OUTPUT);
pinMode(Pin12, OUTPUT);
pinMode(Pin13, OUTPUT);
pinMode(Pin14, OUTPUT);
pinMode(Pin15, OUTPUT);
pinMode(Pin16, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(Pin1,HIGH);
digitalWrite(Pin2,HIGH);
digitalWrite(Pin3,HIGH);
digitalWrite(Pin4,HIGH);
digitalWrite(Pin9,HIGH);
digitalWrite(Pin10,HIGH);
digitalWrite(Pin11,HIGH);
digitalWrite(Pin12,HIGH);
for (int a=0; a<=r; a++)
{
digitalWrite(Pin13,HIGH);
digitalWrite(Pin3,LOW);
digitalWrite(Pin4,LOW);
digitalWrite(Pin12,LOW);
digitalWrite(Pin11,LOW);
delay(d);
digitalWrite(Pin13,LOW);
digitalWrite(Pin3,HIGH);
digitalWrite(Pin4,HIGH);
digitalWrite(Pin12,HIGH);
digitalWrite(Pin11,HIGH);
delay(d);
digitalWrite(Pin14,HIGH);
digitalWrite(Pin2,LOW);
digitalWrite(Pin10,LOW);
delay(d);
digitalWrite(Pin14,LOW);
digitalWrite(Pin2,HIGH);
digitalWrite(Pin10,HIGH);
delay(d);
}
//smile
delay(c);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started