Hi,
I changed the code but it still doesn't work. Now it looks like this:
#include <hidef.h> /* common defines and macros */
#include <MC9S12NE64.h> /* derivative information */
#define pinMode(outPin, IO) if (IO == OUTPUT) { DDRL |= outPin; } else { DDRL &= ~outPin; }
#define digitalWrite(outPin, state) if (state == HIGH) { PTL |= outPin; } else { PTL &= ~outPin; }
int outPin = 0x01; // Output connected to digital pin 12
int mail = 0; // Is there new mail?
int val; // Value read from the serial port
void main(void) {
void setup()
pinMode(outPin, OUTPUT);
Serial.begin(9600);
Serial.flush();
void loop()
{
// Read from serial port
if (Serial.available())
{
val = Serial.read();
Serial.println(val);
if (val == 'M') mail = 1;
else if (val == 'N') mail = 0;
}
// Set the status of the output pin
digitalWrite(outPin, mail);
}
/* put your own code here */
EnableInterrupts;
for(;
{} /* wait forever */
/* please make sure that you never leave this function */
}
Can you change it to make it work ??