problem in avr c codes

Discussion in 'Embedded Systems and Microcontrollers' started by khan yousufzai, Sep 16, 2012.

  1. khan yousufzai

    Thread Starter New Member

    Aug 31, 2012
    19
    0
    //i m coding on avrstudio4

    #include <avr/io.h>
    #include <util/delay.h>

    int main(void)
    {
    DDRB=0x00; //PORT B (LEDs) output
    while(1)
    {
    PORTB=0x00; //LEDs ON
    _delay_ms(1000); //delay
    PORTB=0xFF; //LEDs OFF
    _delay_ms(1000); //delay
    }
    return 0;
    }
    //any program i type or copy paste the correct program when compiling it it always gives the same error as given bellow,i m really fed up from long time i doing but it gives error...some program properly work and compilled one day before but one day after i compile any wether previous correct programs rhey give error of same type error........................................................................."/khan.c:11: error: invalid type argument of 'unary *' (have 'int')"this is the common error
     
  2. bretm

    Member

    Feb 6, 2012
    152
    24
    I don't see why this code could cause that error since you're not using unary *. Also, are you sure DDRB=0 sets the port to output and not input?
     
Loading...