Hello everyone... I'm new on arduino and I'm trying to create a project with a BTmodule using the amarino(http://www.amarino-toolkit.ne).
I'm following a tutorial in amarino's webpage but when I verify or compile the code in arduino IDE have a problem:
In file included from Test.cpp:6:
C:\arduino-1.0\libraries\MeetAndroid/MeetAndroid.h:104: error: conflicting return type specified for 'virtual void MeetAndroid::write(uint8_t)'
C:\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
Code in arduino IDE is:
/*
Receives Test Events from your phone.
After it gets a test message the led 13 will blink.
*/
#include <MeetAndroid.h>
MeetAndroid meetAndroid;
int onboardLed = 13;
void setup()
{
// use the baud rate your bluetooth module is configured to
// not all baud rates are working well, i.e. ATMEGA168 works best with 57600
Serial.begin(57600);
// register callback functions, which will be called when an associated event occurs.
// - the first parameter is the name of your function (see below)
// - match the second parameter ('A', 'B', 'a', etc...) with the flag on your Android application
meetAndroid.registerFunction(testEvent, 'A');
pinMode(onboardLed, OUTPUT);
digitalWrite(onboardLed, HIGH);
}
void loop()
{
meetAndroid.receive(); // you need to keep this in your loop() to receive events
}
/*
* This method is called constantly.
* note: flag is in this case 'A' and numOfValues is 1 (since test event sends a random int)
*/
void testEvent(byte flag, byte numOfValues)
{
// the test event in Amarino generates a random value between 0 and 255
int randomValue = meetAndroid.getInt();
flushLed(300);
flushLed(300);
flushLed(randomValue);
}
void flushLed(int time)
{
digitalWrite(onboardLed, LOW);
delay(time);
digitalWrite(onboardLed, HIGH);
delay(time);
}
If someone know... help me to solve it plx!
Thx everyone and sorry my english!
EDIT: I try with IDE 022 and 1.0... In 022 was show me more errors... in 1.0 was only this post.
Hello Nick... I don't know if I make it right... but IDE return me it:
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:22:24: error: WConstants.h: No such file or directory
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp: In member function 'bool MeetAndroid::receive()':
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:86: error: 'boolean' was not declared in this scope
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:86: error: expected `;' before 'timeout'
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:87: error: 'timeout' was not declared in this scope
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:108: error: 'delayMicroseconds' was not declared in this scope
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:112: error: 'timeout' was not declared in this scope
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp: At global scope:
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:252: error: prototype for 'void MeetAndroid::write(uint8_t)' does not match any in class 'MeetAndroid'
C:\arduino-1.0\libraries\MeetAndroid/MeetAndroid.h:104: error: candidate is: virtual size_t MeetAndroid::write(uint8_t)
C:\arduino-1.0\libraries\MeetAndroid\MeetAndroid.cpp:252: error: prototype for 'void MeetAndroid::write(uint8_t)' does not match any in class 'MeetAndroid'
C:\arduino-1.0\libraries\MeetAndroid/MeetAndroid.h:104: error: candidate is: virtual size_t MeetAndroid::write(uint8_t)
java.lang.NullPointerException
at processing.app.debug.Compiler.execAsynchronously(Compiler.java:326)
at processing.app.debug.Compiler.compileFiles(Compiler.java:274)
at processing.app.debug.Compiler.compile(Compiler.java:166)
at processing.app.Sketch.build(Sketch.java:1569)
at processing.app.Sketch.build(Sketch.java:1546)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1845)
at java.lang.Thread.run(Thread.java:619)