Hi guys after a while absent i want to program something there is my sketch
//Main Library for controller BT or USB PS3PAD
#include <PS3BT.h>
//#include <PS3USB.h>
// Library for Controlling Motors
#include <HBridge.h>
#include <usbhub.h>
// Light file
//#include "BMW_Z4_Light_TEST.h"
USB Usb;
USBHub Hubl(&Usb);
BTD Btd(&Usb);
PS3BT PS3(&Btd,0x00, 0x09, 0xDD, 0x50, 0x8F,0xC6);
//USB Usb;
//PS3USB PS3(&Usb);
int x = 200;
HBridge hb1; //
void setup()
{
Serial.begin(115200);
Usb.Init();
if (Usb.Init() == -1)
{
Serial.print(F("\r\nOSC did not start"));
while(1); //halt
}
Serial.print(F("\r\nPS3 Bluetooth Library Started"));
hb1.setEnablePins(3,9);
hb1.setControlPins(40,41,42,43);
}
void loop()
{
/*THE MANIN PROGRAM*/
Usb.Task();
if(PS3.PS3Connected)
{
MotorOnePWM();
Serial.print(F("Polaczony"));
}
}
/*Motor PWM*/
void MotorOnePWM()
{
//Go Forward With L2
if ((PS3.getAnalogButton(L2))&&!(PS3.getAnalogButton(R2)))
{
hb1.PWMA(PS3.getAnalogButton(L2));
hb1.movePWMAForward();
}
//Go Backward With R2
if ((PS3.getAnalogButton(R2))&&!(PS3.getAnalogButton(L2)))
{
hb1.PWMA(PS3.getAnalogButton(R2));
hb1.movePWMABackward();
}
//Motor Stop
if ((PS3.getAnalogButton(L2))&&(PS3.getAnalogButton(R2)))
{
hb1.motorAStall();
}
//hb1.motorAOFF();
//Left
if(PS3.getAnalogHat(RightHatX)<90)
{
hb1.PWMB(x);
hb1.turnBRight();
}
//Right
if(PS3.getAnalogHat(RightHatX)>160)
{
hb1.PWMB(x);
hb1.turnBLeft();
}
//OFF /Reset
hb1.motorOFF();
}
on win 7 arduino 1.6.5 and 1.0.5 r2 and atmel and event visual studio dont give me errors
but when i try to compile same project on win 10 atmel studio 6.2 i get loots of errors, sketch is compiling whitout problems on arduino 1.6.5 and 1.0.5 r2 under win 10 but when i try to compileing it under
Atmel studio with arduino 1.6.5 plugin i get this error
Compiling 'BMW_Z4' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Process: "{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=165 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" W_Z4.cpp" -o W_Z4.cpp.o"
Error compiling
and with the arduino 1.0.5 r2 i get this
Compiling 'BMW_Z4' for 'Arduino Mega 2560 or Mega ADK'
BMW_Z4.ino:13: error: 'USB' does not name a type
BMW_Z4.ino:14: error: 'USBHub' does not name a type
BMW_Z4.ino:15: error: 'BTD' does not name a type
BMW_Z4.ino:16: error: 'PS3BT' does not name a type
BMW_Z4.ino:23: error: 'HBridge' does not name a type
BMW_Z4.ino:In function 'void setup()'
BMW_Z4.ino:28: error: 'Usb' was not declared in this scope
BMW_Z4.ino:36: error: 'hb1' was not declared in this scope
BMW_Z4.ino:In function 'void loop()'
BMW_Z4.ino:43: error: 'Usb' was not declared in this scope
BMW_Z4.ino:44: error: 'PS3' was not declared in this scope
BMW_Z4.ino:In function 'void MotorOnePWM()'
BMW_Z4.ino:55: error: 'PS3' was not declared in this scope
BMW_Z4.ino:55: error: 'L2' was not declared in this scope
BMW_Z4.ino:55: error: 'R2' was not declared in this scope
BMW_Z4.ino:57: error: 'hb1' was not declared in this scope
BMW_Z4.ino:62: error: 'PS3' was not declared in this scope
BMW_Z4.ino:62: error: 'R2' was not declared in this scope
BMW_Z4.ino:62: error: 'L2' was not declared in this scope
BMW_Z4.ino:64: error: 'hb1' was not declared in this scope
BMW_Z4.ino:69: error: 'PS3' was not declared in this scope
BMW_Z4.ino:69: error: 'L2' was not declared in this scope
BMW_Z4.ino:69: error: 'R2' was not declared in this scope
BMW_Z4.ino:71: error: 'hb1' was not declared in this scope
BMW_Z4.ino:77: error: 'PS3' was not declared in this scope
BMW_Z4.ino:77: error: 'RightHatX' was not declared in this scope
BMW_Z4.ino:79: error: 'hb1' was not declared in this scope
BMW_Z4.ino:84: error: 'PS3' was not declared in this scope
BMW_Z4.ino:84: error: 'RightHatX' was not declared in this scope
BMW_Z4.ino:86: error: 'hb1' was not declared in this scope
BMW_Z4.ino:91: error: 'hb1' was not declared in this scope
Error compiling
this sketch compile perfect, whitout any problem on arduino programs but in atmle studio i get tons of problems
Here is the verbose for 1.6.5 plugin
Compiling 'BMW_Z4' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Build folder: 2560
Summary: Header=1 Prototypes=4 Imports=3
Additional Defines:
Architecture Tools: {runtime.tools.avr-gcc.path}/bin/
Sketchbook: file:///C:/Users/Michał/Dropbox/Android
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega'
"{runtime.tools.avr-gcc.path}/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=165 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" W_Z4.cpp" -o W_Z4.cpp.o"
Nie można odnaleźć określonego pliku
Process: "{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=165 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" W_Z4.cpp" -o W_Z4.cpp.o"
Error compiling