Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Change mode #81

Open
ste-giordano95 opened this issue May 3, 2021 · 1 comment
Open

Change mode #81

ste-giordano95 opened this issue May 3, 2021 · 1 comment

Comments

@ste-giordano95
Copy link

Any way to change mode from arduino? (eco, dynamic, sport) ?
Thank u!

@augisbud
Copy link
Owner

augisbud commented May 3, 2021

Hello, not sure, since I haven't touched this in a log time. If you are familiar with coding projects like these I would suggest the best place to start would be

struct __attribute__ ((packed)) {
  uint8_t state;      //0-stall, 1-drive, 2-eco stall, 3-eco drive
  uint8_t ledBatt;    //battery status 0 - min, 7(or 8...) - max
  uint8_t headLamp;   //0-off, 0x64-on
  uint8_t beepAction;
} S21C00HZ64;

then you would need to find the correct command

enum {CMD_CRUISE_ON, CMD_CRUISE_OFF, CMD_LED_ON, CMD_LED_OFF, CMD_WEAK, CMD_MEDIUM, CMD_STRONG};
struct __attribute__((packed)) CMD{
  uint8_t  len;
  uint8_t  addr;
  uint8_t  rlen;
  uint8_t  param;
  int16_t  value;
}_cmd;

however from what I recall we didn't find the opportunity to toggle the headlight from an arduino.

Although the controller provides information about it's current mode I'm not sure if you will be able to change it.
If you have any luck feel free to submit a PR.

P.S I'm referring to the headlight because it's a similar principle. If you want to go the easy route just tap into the existing button on board :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants