Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return type on LedDriver functions #7

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
cc38f31
Fixed APIDocumentation.md
epicfoox May 28, 2018
f0601be
Fixed Readme.md
epicfoox May 28, 2018
3188f7d
added name storing in case it is not yet stored
epicfoox May 29, 2018
f25dc61
Added batch characteristic for real-time commands
May 27, 2018
1ed1294
Write to BT shared data
May 28, 2018
487eeab
Added rest of the Real Time parameters. Adde NOTIFY to mode.
May 28, 2018
f270922
Fix bug: write LED colors correctly
May 28, 2018
f39ae02
Add ->notify() call
May 28, 2018
f58769f
Added batch characteristic
May 29, 2018
ed6767e
Removed robot object and added robot pointer to batch characteristic
May 29, 2018
3c46215
added notify and comparison with BT state before publishing battery a…
epicfoox May 29, 2018
0c7f009
removed gaitID notify and publishing from the robot side
epicfoox May 29, 2018
1dbaf25
fixed LED and movement behaviour in walking mode while connected and …
epicfoox May 29, 2018
79ab6a6
Fix type cast for led params
May 29, 2018
bf186d8
Revert "Fix type cast for led params"
May 29, 2018
1496550
fixed bug when robot didnt move on button press while in walk mode
epicfoox May 29, 2018
5f7539f
added safety timer for battery calibration
epicfoox May 30, 2018
e15db6b
Rremove sounde files from commit
epicfoox May 30, 2018
e14eaa1
Merge pull request #1 from stemi-education/feature/BatchCommands
epicfoox May 30, 2018
e732cd1
version modified
epicfoox May 30, 2018
32f0275
fixed rotating and tilting orientations
epicfoox May 31, 2018
1d59cca
version adjusted
epicfoox May 31, 2018
32bb52a
tilt in user mode now reacts to Z axis also
epicfoox May 31, 2018
0ee37f8
fixed unstable wrap to +-PI in led rotation speed calculations
epicfoox Jun 4, 2018
10b9ada
versions adjusted
epicfoox Jun 4, 2018
51e6e87
added macro to choose between full dance and short dance
epicfoox Jun 6, 2018
d13acd4
Use a single tab field separator in keywords.txt
per1234 Jul 15, 2018
6362207
Merge branch 'per1234-keywords_txt-multiple-tabs'
epicfoox Jul 16, 2018
0116d81
versioning adjusted
epicfoox Jul 16, 2018
6778336
fixed full dance length problem
epicfoox Aug 24, 2018
e27d02b
feat(robot): Add control for extra servo
epicfoox Mar 6, 2019
0610280
feat(robot): Add BT support for UniversalData
epicfoox Mar 9, 2019
19651b1
fix(robot): universalData BT function call fix
epicfoox Mar 9, 2019
53c7751
fix(robot): UniversalData integrated into Param BT service
epicfoox Mar 10, 2019
4dda6e6
Fix for esp32 arduino core compatibility
epicfoox May 6, 2019
f85aa53
Adjust versions
epicfoox May 6, 2019
37b256f
capitalize file names
frnhr Mar 10, 2020
b4872a5
Merge pull request #4 from frnhr/case-fix
epicfoox Jun 9, 2020
551fadf
Update documentation
epicfoox Oct 8, 2019
c4f67e6
Specify library dependencies in library.properties
per1234 Jan 7, 2020
8f0a136
Bump version
epicfoox Jun 9, 2020
e02dcaa
Fix return type on LedDriver functions
germede Jun 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 47 additions & 12 deletions APIDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ robot.setLed(CYAN);
* Arguments:
* Color

---

```c++
void setLed(Color primarClr, Color secondarClr, uint8_t spreadRatio, int16_t direction);
```
Expand All @@ -30,6 +32,8 @@ robot.setLed(PURPLE, YELLOW, 50, LED_L1_ANGLE);
* [0,100] %,
* [-180, 180] °

---

```c++
void setLedRotationSpeed(int8_t rotationSpeed);
```
Expand All @@ -40,6 +44,8 @@ robot.setLedRotationSpeed(50);
* Units:
* [-100,100] %

---

```c++
void setLedBlinkingSpeed(uint8_t blinkingSpeed);
```
Expand All @@ -50,6 +56,8 @@ robot.setLedBlinkingSpeed(50);
* Arguments:
* [0,100] %

---

#### Functions for static led colors - without animations (rotation and blinking don’t work when combined with these functions): ####

```c++
Expand All @@ -64,6 +72,8 @@ robot.setLedStatic(LED_L2, BLUE);
* [0,5] led number,
* Color

---

```c++
void setLedStatic(Color color);
```
Expand All @@ -74,7 +84,9 @@ robot.setLedStatic(RED);
* Arguments:
* Color

#### Possible inputs for: ``` Color ```####
---

#### Possible inputs for: ``` Color ``` ####
```c++
RED = { 255, 0, 0 };
GREEN = { 0, 255, 0 };
Expand All @@ -87,7 +99,7 @@ ORANGE = { 255, 60, 0 };
BLACK = { 0, 0, 0 };
```

#### Possible inputs for: ``` ledNo ```####
#### Possible inputs for: ``` ledNo ``` ####
```c++
LED_R1 = 0
LED_R2 = 1
Expand All @@ -97,7 +109,7 @@ LED_L2 = 4
LED_L3 = 3
```

#### Possible inputs for: ``` direction ```####
#### Possible inputs for: ``` direction ``` ####
```c++
LED_R1_ANGLE = -30
LED_R2_ANGLE = -90
Expand All @@ -118,8 +130,9 @@ robot.move(FORWARD, 500);
```
* Arguments:
* movement,
* milliseconds
(Note: duration can be specified but is not obligatory, default is infinite = -1)
* milliseconds (Note: duration can be specified but is not obligatory, default is infinite = -1)

---

```c++
void move(uint8_t linearVelocity, int16_t direction, int8_t angularVelocity, float duration = MOVE_DURATION_DEFAULT);
Expand All @@ -136,6 +149,8 @@ robot.move(40, 0, 0, 5000) //move forward for 5000 miliseconds
* [-100,100] %,
* milliseconds (Note: duration can be specified but is not obligatory, default is infinite = -1)

---

```c++
void rotate(userPresetInputData rotation, float duration = MOVE_DURATION_DEFAULT);
```
Expand All @@ -147,6 +162,8 @@ robot.rotate(LEFT, 5000);
* movement,
* milliseconds (Note: duration can be specified but is not obligatory, default is infinite = -1)

---

```c++
void tilt(userPresetInputData tiltation);
```
Expand All @@ -157,6 +174,7 @@ robot.tilt(LEFT);
* Arguments:
* tiltation

---

```c++
void tilt(int8_t rotationXNew, int8_t rotationYNew, int8_t rotationZNew);
Expand All @@ -171,6 +189,8 @@ robot.tilt(30, 0 , 50);
* [-100,100] %
Note: check robot axes

---

```c++
void stretch(userPresetInputData stretchment);
```
Expand All @@ -181,6 +201,8 @@ robot.stretch(LEFT);
* Arguments:
* stretchment

---

```c++
void stretch(int8_t translationXNew, int8_t treanslationYNew);
```
Expand All @@ -193,6 +215,8 @@ robot.tilt(30, 0);
* [-100,100] %
Note: check robot axes

---

```c++
void setHeight(uint8_t height);
```
Expand All @@ -203,7 +227,9 @@ robot.setHeight(30);
* Arguments:
* [0,100] %

#### Possible inputs for: ``` userPresetInputData (movement, tiltation, stretchment) ```####
---

#### Possible inputs for: ``` userPresetInputData (movement, tiltation, stretchment) ``` ####
```
FORWARD
BACKWARD
Expand All @@ -212,6 +238,8 @@ LEFT
RESET
```

---

## Modes ##


Expand All @@ -222,6 +250,7 @@ void exitUserMode(); //Enters walking mode
```

#### Possible modes: ####

```
ROBOT_USER_MODE -1
ROBOT_STANDBY_MODE 0
Expand All @@ -232,6 +261,8 @@ ROBOT_CALIBRATION_MODE 11
ROBOT_BATTERY_EMPTY_MODE 12
```

---

## Touch sensors ##

```c++
Expand All @@ -254,23 +285,27 @@ TOUCH_0XX 6
TOUCH_XXX 7
```

---

## Battery ##
```c++
float getBatteryVoltage(); //returns current battery voltage
uint8_t getBatteryPercentage(); // returns current battery percentage
```

---

## Data ##
All user input data is stored in ```userInputData```, an object made out of the following structure:
```c++
struct InputData
{
//Movement - inherited from MovementData
uint8_t linearVelocity; // [0,100]%
// Movement - inherited from MovementData
uint8_t linearVelocity; // [0,100]%
int16_t direction; // [-180,180]degree
int8_t angularVelocity; // [-100,100]%

//Pose - inherited from PoseData
// Pose - inherited from PoseData
int8_t translationX; // [-100,100]%
int8_t translationY; // [-100,100]%
int8_t translationZ; // [-100,100]%
Expand All @@ -279,7 +314,7 @@ uint8_t linearVelocity; // [0,100]%
int8_t rotationZ; // [-100,100]%
int8_t poseSpeed; // [0,100]% - temporary [99,30]

//Led - inherited from LedData
// Led - inherited from LedData
uint8_t ledPrimarClr[3]; // [255]r, [255]g, [255]b
uint8_t ledSecondarClr[3]; // [255]r, [255]g, [255]b
int16_t ledDiretion; // [-180,180]degree
Expand All @@ -289,8 +324,8 @@ uint8_t linearVelocity; // [0,100]%
uint8_t ledManualClr[6][3]; // 6x [255]r, [255]g, [255]b
int8_t ledMode; // [manual, parametric]mode

//Misc - additional data
//int8_t robotMode; //[check ROBOT_XX_MODE macros]mode
// Misc - additional data
// int8_t robotMode; //[check ROBOT_XX_MODE macros]mode
int8_t moveDuration = 0; // seconds of current command execution [-2 = already written, -1 = inf, 0 = go home, 1-100 = seconds to move]
int8_t gaitID = 3; //[0,5]gait
uint8_t stepHeight = 50; // [0,100]%
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Note: We recommend installing these libraries via Arduino Library Manager.
4. Upload to your STEMI hexapod robot

For writing your own code replace last two steps with:

3. Open "File > Examples > STEMI-hexapod > Empty-user-mode"
4. Use STEMI-hexapod API to program the robot and make it move and glow as you please :)
* API documentation is available on the following link: <https://github.com/stemi-education/stemi-hexapod/blob/devel/APIDocumentation.md>.
Loading