7 Segment LED

COURSE FEATURES

  • Duration 14:45
  • Hardware Wire
  • Hardware 7 Segment LED

ABOUT THE COURSE

Hopefully, you were able to complete 101 with some ease. Now we will use more LED's in a 7 segment LED to make numbers.

What You Will Learn

In this video you will learn how to do a basic program with a 7 segment LED.

The seven segment LED is used on the betting stations. If you only allow up to 9 bets, you will use 10 on each board. If you do as the real machine and allow up to 20 bets, you will need 20 on each betting station.

Video #2

int count = 0;
void setup()
{
	pinMode(13, OUTPUT);
	pinMode(12, OUTPUT);
	pinMode(11, OUTPUT);
	pinMode(10, OUTPUT);
	pinMode(9, OUTPUT);
	pinMode(8, OUTPUT);
	pinMode(7, OUTPUT);

}

void loop()
{
	if (count == 0)	
	{
		digitalWrite(13, HIGH);
		digitalWrite(12, HIGH);
		digitalWrite(11, HIGH);
		digitalWrite(10, HIGH);
		digitalWrite(9, HIGH);
		digitalWrite(8, LOW);
		digitalWrite(7, HIGH);
	}
	
	if (count == 1)
	{
		digitalWrite(13, LOW);
		digitalWrite(12, LOW);
		digitalWrite(11, LOW);
		digitalWrite(10, LOW);
		digitalWrite(9, HIGH);
		digitalWrite(8, LOW);
		digitalWrite(7, HIGH);
	}
	
	if (count == 2)
	{
		digitalWrite(13, HIGH);
		digitalWrite(12, LOW);
		digitalWrite(11, HIGH);
		digitalWrite(10, HIGH);
		digitalWrite(9, LOW);
		digitalWrite(8, HIGH);
		digitalWrite(7, HIGH);
	}
	
	if (count == 3)
	{
		digitalWrite(13, HIGH);
		digitalWrite(12, LOW);
		digitalWrite(11, LOW);
		digitalWrite(10, HIGH);
		digitalWrite(9, HIGH);
		digitalWrite(8, HIGH);
		digitalWrite(7, HIGH);
	}
	
	count = count + 1;
	
	delay(1000);
	
	if (count > 3)
	{
		count = 0;
	}
	
	
}


Review

Below is a photo of 10 7-segment LED's on a bet station.