30 lines
694 B
C++
30 lines
694 B
C++
/*
|
|
* Blink.cpp
|
|
*
|
|
* Created: 18/12/2018 5:11:34 PM
|
|
* Author : jimmy
|
|
*/
|
|
#define F_CPU 8000000
|
|
#include <avr/io.h>
|
|
#include <avr/interrupt.h>
|
|
#include <util/delay.h>
|
|
#include "../src/TM1637Display.h"
|
|
|
|
int main(void) {
|
|
//*(&PORTA-1) |= (1<<PA0);
|
|
const int CLK = PA0; //Set the display CLK pin PC1
|
|
const int DIO = PA1; //Set the display DIO pin PC0
|
|
TM1637Display display(CLK, DIO, &PORTA); //set up the 4-Digit Display.
|
|
int count = 0;
|
|
// 7-Seg Setup
|
|
display.setBrightness(255); //display to high brightness
|
|
|
|
|
|
while(1){
|
|
display.showNumberDec(count++);
|
|
//PORTA ^= (1<<PA0);
|
|
_delay_ms(1000);
|
|
}
|
|
}
|
|
|