#include <stdio.h>

#include "vu_meter.h"

int 
vu_meter(A0)
{
  if (A0 < 31)
    printf("Led 1");
  
  else if (A0 <= 63)
    printf("Led 1 2");

  else if (A0 <= 95)
    printf("Led 1 - 3");

  else if (A0 <= 127)
    printf("Led 1 - 4");

  else if (A0 <= 159)
    printf("Led 1 - 5");

  else if (A0 <= 191)
    printf("Led 1 - 6");

  else if (A0 <= 223)
    printf("Led 1 - 7");

  else if (A0 <= 255)
    printf("Led 1 - 8");

  
}

void 
light_leds(int num)
{
  for (int i = 2; i < (2 + num); i++){
    digitalWrite(i, HIGH);
  }
  for (int i = (2 + num); i <= 9; i++)
    {
      digitalWrite(i, LOW);
    }
}
