Hi. I have just recently configured my Eclipse to be able to work with the LilyPad (oddly enough part of the configuration I had to set the baud rate to 57600 and only works at this speed).
My problem is I have trouble getting the serial communication working. The simple code below does nothing:
Does anyone have any suggests to what may cause the serial comms to not work? Also, is there a reason to why the LilyPad only operates at 57600 in Eclipse? Thanks.
Nope. That did nothing as well. My code I also flash the light every second. The LED blinks fine and it seems that the LilyPad ignores the Serial.begin and Serial.print code.
#include "application.hpp"
#include "hardware.hpp"
//#define MAIN
#define PAUSE 300
void Application::run(void)
{
for(;;)
loop();
}
Application::Application()
{
Hardware hardware;
hardware.setup();
Serial.begin(57600);
Serial.print("Hello World!");
}
void Application::loop(void)
{
#ifndef MAIN
digitalWrite(LED_PIN, HIGH); // set the LED on
delay(PAUSE); // wait for a second
digitalWrite(LED_PIN, LOW); // set the LED off
delay(PAUSE); // wait for a second
#endif
}
My mistake, it did work in the Arduino IDE (just didn't know how to use it). It just doesn't show up in Eclipse's console. Definitely something to do with Eclipse's configuration.
Do you have the clock rate and processor set appropriately in the Eclipse AVR settings? I spent HOURS trying to figure out a similar problem only to find that I had it set to the wrong speed.