sgreen
Junior Member level 3
- Joined
- Nov 15, 2012
- Messages
- 31
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,288
- Activity points
- 1,481
I would like to transfer ADC result from ADCH through a pin of Atmega32 serially just like bit stream. ADC result is got through sampling analog signal.Here i have included a block of code to get this. But it doesn't work what i want. My task is completed upto ADCH(8-bit data). If anyone has any better idea to transfer bit of ADCH through a pin serially pls share.
Code:
DDRB=0x01;
PORTB|=1<<PINB0;
PCM =ADCH;
for(unsigned int k=0;k<8;k++){
PCM=PCM>>1;
if(0x01 & PCM==0x01)
PORTB|=1<<PINB0;
else PORTB &=~(1<<PINB0);}
Last edited by a moderator: