The "whill-sdk-arduino" is a simple Arduino library for Model CR series.
We also have Model CR Series Technical Support for current and potential Model CR series users.
- Host device
- An Arduino device suports SoftwareSerial. e.g. Arduino Uno.
- Target device
- Model CR series (Normal Model C or Model C2 does not support serial communication.)
- Connector
- RS232C Shield (example)
Download this repository and place on your Arduino library folder.
WHILL(SoftwareSerial*)
Initialize WHILL instance with SoftwareSerial.
WHILL::setPower(bool)
Turn on/off a WHILL. True
to power WHILL on.
WHILL::setBatteryVoltaegeOut(bool)
Enable/Disable power supply to the interface connector. True
to enable power supply.
Note: This command is for Model CR only.
WHILL::setJoystick(int x, int y)
Manipulate a WHILL via this command. Both x and y are integer values with range -100 ~ 100.
WHILL::setVelocity(int y, int x)
Control the speed of a WHILL directly via this command. y is integer values with range -500 ~ 1500 [0.004km/h]. x is integer values with range -750 ~ 750 [0.004km/h].
Attention: WHILL moves so quickly using SetVelocity command and so pay enough attention to use SetVelocity command. Basically, send this command to increase speed gradually.
WHILL::begin(unsigned int interval_ms)
Command WHILL to start reporting WHILL status (Dataset1).
WHILL::refresh()
Fetch serial interface and do internal process.
Call this function, WHILL::delay()
and/or WHILL::keep_joy_delay()
once at least in loop()
.
Callbacks are fired when these functions are called.
WHILL::stopSendingData()
Command WHILL to stop report WHILL status.
unsigned char WHILL::battery.level
signed long WHILL::battery.current
Remaining battery level and consumpting current[mA].
float WHILL::left_motor.angle
int WHILL::left_motor.speed
float WHILL::right_motor.angle
int WHILL::right_motor.speed
Angle and speed of motors. The angle range is -PI to +PI, the speed unit is [km/h].
Note: The speed value is low-pass filtered.
bool WHILL::speed_mode_indicator
Current selected speed mode.
By registering callback functions, you can hook at status is updated.
See Example: callback.ino
MIT License