1. Can you please check out my esp code, because I'm not sure if it's correct. I want to try varios "Start Bytes" with one try.
Code: Select all/*
-- VOI Controller --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.5.1 or later version;
- for iOS 1.4.1 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP32CORE_BLE
#include <RemoteXY.h>
#include <Arduino.h>
// RemoteXY connection settings
#define REMOTEXY_BLUETOOTH_NAME "VOI Controller V3"
//#define REMOTEXY_ACCESS_PASSWORD "password" //dont work for me -> why?
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,4,0,0,0,151,0,10,52,1,
2,1,12,22,39,7,52,8,31,31,
80,111,119,101,114,0,83,104,117,116,
32,100,111,119,110,0,2,1,12,34,
39,7,52,8,31,31,70,97,115,116,
32,115,112,101,101,100,0,83,108,111,
119,32,83,112,101,101,100,0,129,0,
7,4,49,6,16,86,79,73,32,67,
111,110,116,114,111,108,108,101,114,32,
86,51,0,2,1,12,46,39,7,52,
8,31,31,76,105,103,104,116,115,32,
111,110,0,76,105,103,104,116,115,32,
111,102,102,0,2,1,12,58,39,7,
52,8,31,31,80,111,119,101,114,32,
86,79,73,0,83,104,117,116,32,100,
111,119,110,32,86,79,73,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t switch_power; // =1 if switch ON and =0 if OFF
uint8_t switch_fastspeed; // =1 if switch ON and =0 if OFF
uint8_t switch_light; // =1 if switch ON and =0 if OFF
uint8_t switch_powervoi; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
////////////////////////////////////////////
// Scooter Command include //
///////////////////////////////////////////
byte slowvoi[] = {0xA6, 0x12, 0x02, 0x65, 0x14, 0x86}; // Speed Limit to 20 km/h (tested on voi by mayaku)
byte slow1[] = {0xA6, 0x12, 0x02, 0XF1, 0x14, 0x7E}; // LIGHT OFF & ESC ON & KPH & SLOW (tested by Wileok)
byte slow2[] = {0xA6, 0x12, 0x02, 0XF5, 0x14, 0x45}; // LIGHT ON & ESC ON & KPH & SLOW (tested by Wileok)
byte fastvoi[] = {0xA6, 0x12, 0x02, 0x35, 0xFF, 0x38}; // Maximum Speed (tested on voi by mayaku)
byte fast1[] = {0xA6, 0x12, 0x02, 0XF1, 0xE4, 0x0A}; // LIGHT OFF & ESC ON & KPH & FAST (tested by Wileok)
byte fast2[] = {0xA6, 0x12, 0x02, 0XF5, 0xE4, 0x31}; // LIGHT ON & ESC ON & KPH & FAST (tested by Wileok)
byte off[] = {0xA6, 0x12, 0x02, 0x00, 0xFF, 0xEA}; //Off (tested on voi by mayaku)
void setup()
{
RemoteXY_Init ();
Serial.begin(9600);
}
void loop()
{
RemoteXY_Handler ();
if((RemoteXY.switch_power == 1) && (RemoteXY.switch_fastspeed == 0) && (RemoteXY.switch_light == 0)) //light off + slow
{
Serial.write(slow1, sizeof(slow1));
}
else if((RemoteXY.switch_power == 1) && (RemoteXY.switch_fastspeed) == 0 && (RemoteXY.switch_light == 1)) //light on + slow
{
Serial.write(slow2, sizeof(slow2));
}
else if((RemoteXY.switch_power == 1) && (RemoteXY.switch_fastspeed) == 1 && (RemoteXY.switch_light == 0)) //light off + fast
{
Serial.write(fast1, sizeof(fast1));
}
else if((RemoteXY.switch_power == 1) && (RemoteXY.switch_fastspeed) == 1 && (RemoteXY.switch_light == 1)) //light on + fast
{
Serial.write(fast2, sizeof(fast2));
}
else if((RemoteXY.switch_power == 1) && (RemoteXY.switch_fastspeed) == 0 && (RemoteXY.switch_powervoi == 1)) //voi slow + light???
{
Serial.write(slowvoi, sizeof(slowvoi));
}
else if((RemoteXY.switch_power == 1) && (RemoteXY.switch_fastspeed) == 1 && (RemoteXY.switch_powervoi == 1)) //voi fast + light???
{
Serial.write(fastvoi, sizeof(fastvoi));
}
else
{
Serial.write(off, sizeof(off));
}
delay(200);
}
2. Can you please check out my wiring, is it correct?
3. I could not find the right screwdriver for the black box (voi voiager2) so I drilled it out. Which screwdriver do I need to open it up without destroying it?