This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
Distancer/Distancer.cpp

37 lines
435 B
C++

#define F_CPU 1000000
#include <avr/io.h>
#include <util/delay.h>
#include "LcdShiftReg.h"
void setupStatusLed()
{
DDRB |= (1 << PB0);
}
void flashStatusLed()
{
PORTB |= (1 << PB0);
_delay_ms(100);
PORTB &= ~(1 << PB0);
}
int main()
{
setupStatusLed();
LcdShiftReg lcdShiftReg;
while (true)
{
flashStatusLed();
_delay_ms(400);
lcdShiftReg.set(1);
_delay_ms(100);
lcdShiftReg.set(0);
_delay_ms(400);
}
}