//This program displays 07 on the seven segments. The code is in AVR C language. //Connect the 7-segment module to the upper pins of JA and JB. //Use AVR Studio IDE and WinAVR to make the hex file. //For more information see www.microdigitaled.com and www.digilentinc.com #include #define F_CPU 8000000L //In cerebot2 XTAL = 8 MHz. (This definition is used in delay.h for making delays) #include //It provides delay functions int main ( ) { DDRA = 0xFF; //JA (portA) as output DDRC = 0xFF; //JB (portC) as output while (1) { //Display '0' on the left seven segment PORTC = 0x0B; //JB = 0x0B PORTA = 0x0F; //JA = 0x0F _delay_ms(10); //wait 10ms //Display '7' on the right seven segment PORTC = 0x00; //JC = 0 PORTA = 0x07; //JA = 0x07 _delay_ms(10); //wait 10ms } }