led matrix

void setup()
{
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  
}

void loop() 
{
  int ldr1 = analogRead(A0);
  int ldr2 = analogRead(A1);
  int ldr3 = analogRead(A2);
  int ldr4 = analogRead(A3);
  
  if(ldr1 < 140)
  {
    digitalWrite(10, LOW);
  }
  else
  {
   digitalWrite(10, HIGH); 
  }
  
  if(ldr2 < 140)
  {
    digitalWrite(11, LOW);
  }
  else
  {
   digitalWrite(11, HIGH); 
  }
  
  if(ldr3 < 140)
  {
    digitalWrite(12, LOW);
  }
  else
  {
   digitalWrite(12, HIGH); 
  }
  
  if(ldr4 < 140)
  {
    digitalWrite(13, LOW);
  }
  else
  {
   digitalWrite(13, HIGH); 
  }
  
}


Eagle kopplingsschema

wilma led matrix eagle schematic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s