#include <stdlib.h>
#include <avr/io.h>
 
 
#define SETTO(value, bit, to) value = ((to) ? value | BIT(bit) : value & ~BIT(bit)) 
#define ISSET(value, bit) ((value) & (BIT(bit)))
#define BIT(x) (1 << (x))
#define SET(x) |=  BIT(x)
#define CLR(x) &= ~BIT(x)
 
void nop_delay(unsigned int count)
{	
	for (unsigned int i = 0; i < count; i++)
	{
		asm volatile ("nop");
	}
}
 
int main(void)
{
	// Initialize display, cursor off
 
	// Clear display and home cursor
 
 
   	//Clear 7-seg
	DDRC |= 0xCF; 	
	DDRG |= 0x04;
 
	PORTC |= 0x38;
 	PORTG CLR(2);
 
	for (signed char i = 7; i >= 0; i--){ 
		PORTC CLR(6);
		// Clock high for certain period
		PORTC SET(7); 
		nop_delay(8);
		// Clock low for certain period
		PORTC CLR(7);
		nop_delay(8);
	}
	PORTG SET(2); 
}

andurid_4_termistor.hex

andurid_2_kaugus_algeline.hex

et/examples/setup/off.txt · Last modified: 2020/07/20 09:00 by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0