Hi,
I bought an Arduino Mega ADK , and try to make simple sketch using the Arduino IDE.
But when I compile I get this message :
C:\Users\BipBip\Downloads\arduino-1.0.3-windows\arduino-1.0.3\libraries\UsbHost/AndroidAccessory.h: In function 'void setup()':
C:\Users\BipBip\Downloads\arduino-1.0.3-windows\arduino-1.0.3\libraries\UsbHost/AndroidAccessory.h:68: error: 'void AndroidAccessory::powerOn()' is private
sketch_jan11a:16: error: within this context
C:\Users\BipBip\Downloads\arduino-1.0.3-windows\arduino-1.0.3\libraries\UsbHost/AndroidAccessory.h: In function 'void loop()':
C:\Users\BipBip\Downloads\arduino-1.0.3-windows\arduino-1.0.3\libraries\UsbHost/AndroidAccessory.h:66: error: 'int AndroidAccessory::read(void*, int, unsigned int)' is private
sketch_jan11a:23: error: within this context
I don't know what I can do to resolve this problem.
There is my AndroidAccessory.cpp :
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <Max3421e.h>
#include <UsbHost.h>
#include <AndroidAccessory.h>
#define USB_ACCESSORY_VENDOR_ID 0x18D1
#define USB_ACCESSORY_PRODUCT_ID 0x2D00
#define USB_ACCESSORY_ADB_PRODUCT_ID 0x2D01
#define ACCESSORY_STRING_MANUFACTURER 0
#define ACCESSORY_STRING_MODEL 1
#define ACCESSORY_STRING_DESCRIPTION 2
#define ACCESSORY_STRING_VERSION 3
#define ACCESSORY_STRING_URI 4
#define ACCESSORY_STRING_SERIAL 5
#define ACCESSORY_GET_PROTOCOL 51
#define ACCESSORY_SEND_STRING 52
#define ACCESSORY_START 53
AndroidAccessory::AndroidAccessory(const char *manufacturer,
const char *model,
const char *description,
const char *version,
const char *uri,
const char *serial) : manufacturer(manufacturer),
model(model),
description(description),
version(version),
uri(uri),
serial(serial),
connected(false)
{
}
boolean AndroidAccessory::begin(void) {
powerOn();
return true; // For forward compatibility with v2.x of the library
}
void AndroidAccessory::powerOn(void)
{
max.powerOn();
delay(200);
}
There is more code , but nothing important...
Can you give me a way to clear these problems ?