Skip to content

Instantly share code, notes, and snippets.

@prasant1010
Created August 24, 2016 06:52
Show Gist options
  • Save prasant1010/4565162f556381647fb10111098209d9 to your computer and use it in GitHub Desktop.
Save prasant1010/4565162f556381647fb10111098209d9 to your computer and use it in GitHub Desktop.
void digital_value(int value)
{
if(value==0)
{
PORTC=0x00;
}
if ((value>0) & (value < 100))
{
PORTC=0x01;
}
{
if ((value >=100 )& (value < 200))
PORTC =0x02;
}
if ((value >=200) & (value <300))
{
PORTC=0x03;
}
if ((value>=300) & (value < 400) )
{
PORTC =0x04;
}
if( (value >=400) & (value <500))
{
PORTC=0x05;
}
if (( value >=500) &( value <600) )
{
PORTC =0x06;
}
if ( (value >=600) & (value <700) )
{
PORTC =0x07;
}
if ( (value >=700) & (value <800) )
{
PORTC =0x08;
}
if ( (value >=800) & (value <900) )
{
PORTC =0x09;
}
if ( (value >=900) & (value <1024) )
{
PORTC =0x00;
_delay_ms(250);
PORTC=0X08;
_delay_ms(250);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment