tm1637/src/main.cpp

30 lines
683 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 "TM1637Display.h"
int main(void) {
*(&PORTA-1) |= (1<<PA0);
const int CLK = PC1; //Set the display CLK pin PC1
const int DIO = PC0; //Set the display DIO pin PC0
TM1637Display display(CLK, DIO, &PORTC); //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);
}
}