Tema: Re: req: pavyzduko atmegai
Autorius: Vitoldas
Data: 2010-01-13 12:14:05
http://www.artem.ru/cgi-bin/news?c=v&id=738

jei kiek supranti rusiskai.
kodas - anglu kalba :-)

//  input PC0
	DDRC &=0b11111110;
	PORTC&=0b11111110; // pul up - off

	// output pd7
	DDRD |=0b10000000;

	while(1){
		k++;
		r=0; // counter

		// out 0
		PORTD&=0b01111111;
		while(PINC&0b00000001);


		// out 1
		PORTD|=0b10000000;

		while(!(PINC&0b00000001)) r++;
		

		// out 0
		PORTD&=0b01111111;


		//output data to display
		/*
		itoa(r+2, buf,10);
		my44780_command_home(&disp1);		
		my44780_send_string(&disp1,buf);
		my44780_send_string(&disp1," ");
		itoa(k, buf,10);
		my44780_send_string(&disp1,buf);
		my44780_send_string(&disp1,"      ");
		_delay_ms(100);
		*/
	}


On 2010.01.12 20:25, blah wrote:
> gal kas turit pavyzdeli ar koki linka zinot, kur butu pavyzdelis kaip
> padaryti ant atmegos, kad prilietus tam tikra pina butu nuskaityta
> reiksme (na pvz uzsidegtu lempute ar pan.). ta prasme kad butu ne
> mygtukas, o jautru prisilietimui. net nezinau cia matyt su talpa kazka
> reikia burti ?