serge lopez

How to access a port trough a C function using DEMO9RS08KA2 platform

Discussion created by serge lopez on Mar 25, 2008
Latest reply on Mar 26, 2008 by Jim Donelson
Hello everyone,
 
I am new one in the world of micro-controllers. I try to acquire some experience with the demo board DEMO9RS08KA2.
 
My first target is to fade a led using C language. I wrote a C function and I want to pass by argument the Ports that is connected to the led.
 
So the code is:
 
#define LED2 PTAD_PTAD5
 
void GlowLed(char *led)
{
.....
   .... *led = (cmpt<inc) ? ON:smileysurprised:FF;
....
}
 
void main () {
....
....
...
 GlowLed(&LED2)
....
 
}
 
when I compile the C code, the following masque is sent by the compiler
"Cannot take the addressee of this object "
 
SO !!??
 
My modesty impeach me to accept that I make a mistake or I miss something:smileywink:
 
Do you have the solutions or document that could help me
 
Thanks in advance for your help
 
Serge
 

Outcomes