Skip to content

Commit 870c8d4

Browse files
author
Sébastien Parent-Charette
committed
Added QA functionality - 1.2.0
1 parent 43116b7 commit 870c8d4

10 files changed

Lines changed: 1001 additions & 773 deletions

File tree

Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,107 @@
1-
/*
2-
* Author: Sebastien Parent-Charette (support@robotshop.com)
3-
* Version: 1.1.0
4-
* Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
5-
*
6-
* Desscription: Example of all the possible configurations for a LSS.
7-
*/
8-
9-
#include <LSS.h>
10-
11-
// ID set to default LSS ID = 0
12-
#define LSS_ID (0)
13-
#define LSS_BAUD (LSS_DefaultBaud)
14-
15-
// Create one LSS object
16-
LSS myLSS = LSS(LSS_ID);
17-
18-
void setup()
19-
{
20-
// Initialize the LSS bus
21-
LSS::initBus(Serial, LSS_BAUD);
22-
23-
// Uncomment any configurations that you wish to activate
24-
// You can see above each configuration a link to its description in the Lynxmotion wiki
25-
// Note: If you change a configuration to the same value that is already set,
26-
// the LSS will ignore the operation since the value is not changed.
27-
28-
// *** Basic configurations ***
29-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H6.OriginOffsetAction28O29
30-
//myLSS.setOriginOffset(0);
31-
32-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H7.AngularRange28AR29
33-
//myLSS.setAngularRange(uint16_t value, LSS_SetType setType = LSS_SetConfig);
34-
35-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H12.MaxSpeedinDegrees28SD29
36-
// Set maximum speed in (1/10°)/s
37-
//myLSS.setMaxSpeed(600, LSS_SetConfig);
38-
39-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H13.MaxSpeedinRPM28SR29
40-
//myLSS.setMaxSpeedRPM(100, LSS_SetConfig);
41-
42-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H14.LEDColor28LED29
43-
// Options are:
44-
// LSS_LED_Black = 0
45-
// LSS_LED_Red = 1
46-
// LSS_LED_Green = 2
47-
// LSS_LED_Blue = 3
48-
// LSS_LED_Yellow = 4
49-
// LSS_LED_Cyan = 5
50-
// LSS_LED_Magenta = 6
51-
// LSS_LED_White = 7
52-
//myLSS.setColorLED(LSS_LED_Black, LSS_SetConfig);
53-
54-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H15.GyreRotationDirection28G29
55-
// Options are:
56-
// LSS_GyreClockwise = 1
57-
// LSS_GyreCounterClockwise = -1
58-
//myLSS.setGyre(LSS_ConfigGyre value, LSS_SetConfig);
59-
60-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H19.FirstA0Position28Degrees29
61-
//myLSS.setFirstPosition(0);
62-
//myLSS.clearFirstPosition();
63-
64-
// *** Advaned configurations ***
65-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA1.AngularStiffness28AS29
66-
//myLSS.setAngularStiffness(0, LSS_SetConfig);
67-
68-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA2.AngularHoldingStiffness28AH29
69-
//myLSS.setAngularHoldingStiffness(4, LSS_SetConfig);
70-
71-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA3:AngularAcceleration28AA29
72-
//myLSS.setAngularAcceleration(100, LSS_SetConfig);
73-
74-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA4:AngularDeceleration28AD29
75-
//myLSS.setAngularDeceleration(100, LSS_SetConfig);
76-
77-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA5:MotionControl28EM29
78-
//myLSS.setMotionControlEnabled(bool value);
79-
80-
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA6.ConfigureLEDBlinking28CLB29
81-
// Options are an arithmetic addition of the following values:
82-
// Limp 1
83-
// Holding 2
84-
// Accelerating 4
85-
// Decelerating 8
86-
// Free 16
87-
// Travelling 32
88-
// Therefore, 0 = no blinking and 63 = always blinking
89-
//myLSS.setBlinkingLED(0);
90-
91-
// Reset motor to complete change of configurations
92-
myLSS.reset();
93-
94-
// Wait for reboot
95-
delay(2000);
96-
}
97-
98-
void loop()
99-
{
100-
// Loop through each of the 8 LED color (black = 0, red = 1, ..., white = 7)
101-
for(uint8_t i = LSS_LED_Black; i <= LSS_LED_White; i++)
102-
{
103-
// Set the color (session) of the LSS
104-
myLSS.setColorLED((LSS_LED_Color)i);
105-
delay(1000);
106-
}
107-
}
1+
/*
2+
* Author: Sebastien Parent-Charette (support@robotshop.com)
3+
* Version: 1.1.0
4+
* Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
5+
*
6+
* Desscription: Example of all the possible configurations for a LSS.
7+
*/
8+
9+
#include <LSS.h>
10+
11+
// ID set to default LSS ID = 0
12+
#define LSS_ID (0)
13+
#define LSS_BAUD (LSS_DefaultBaud)
14+
15+
// Create one LSS object
16+
LSS myLSS = LSS(LSS_ID);
17+
18+
void setup()
19+
{
20+
// Initialize the LSS bus
21+
LSS::initBus(Serial, LSS_BAUD);
22+
23+
// Uncomment any configurations that you wish to activate
24+
// You can see above each configuration a link to its description in the Lynxmotion wiki
25+
// Note: If you change a configuration to the same value that is already set,
26+
// the LSS will ignore the operation since the value is not changed.
27+
28+
// *** Basic configurations ***
29+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H6.OriginOffsetAction28O29
30+
//myLSS.setOriginOffset(0);
31+
32+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H7.AngularRange28AR29
33+
//myLSS.setAngularRange(uint16_t value, LSS_SetType setType = LSS_SetConfig);
34+
35+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H12.MaxSpeedinDegrees28SD29
36+
// Set maximum speed in (1/10°)/s
37+
//myLSS.setMaxSpeed(600, LSS_SetConfig);
38+
39+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H13.MaxSpeedinRPM28SR29
40+
//myLSS.setMaxSpeedRPM(100, LSS_SetConfig);
41+
42+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H14.LEDColor28LED29
43+
// Options are:
44+
// LSS_LED_Black = 0
45+
// LSS_LED_Red = 1
46+
// LSS_LED_Green = 2
47+
// LSS_LED_Blue = 3
48+
// LSS_LED_Yellow = 4
49+
// LSS_LED_Cyan = 5
50+
// LSS_LED_Magenta = 6
51+
// LSS_LED_White = 7
52+
//myLSS.setColorLED(LSS_LED_Black, LSS_SetConfig);
53+
54+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H15.GyreRotationDirection28G29
55+
// Options are:
56+
// LSS_GyreClockwise = 1
57+
// LSS_GyreCounterClockwise = -1
58+
//myLSS.setGyre(LSS_ConfigGyre value, LSS_SetConfig);
59+
60+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#H19.FirstA0Position28Degrees29
61+
//myLSS.setFirstPosition(0);
62+
//myLSS.clearFirstPosition();
63+
64+
// *** Advaned configurations ***
65+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA1.AngularStiffness28AS29
66+
//myLSS.setAngularStiffness(0, LSS_SetConfig);
67+
68+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA2.AngularHoldingStiffness28AH29
69+
//myLSS.setAngularHoldingStiffness(4, LSS_SetConfig);
70+
71+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA3:AngularAcceleration28AA29
72+
//myLSS.setAngularAcceleration(100, LSS_SetConfig);
73+
74+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA4:AngularDeceleration28AD29
75+
//myLSS.setAngularDeceleration(100, LSS_SetConfig);
76+
77+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA5:MotionControl28EM29
78+
//myLSS.setMotionControlEnabled(bool value);
79+
80+
//> https://www.robotshop.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/#HA6.ConfigureLEDBlinking28CLB29
81+
// Options are an arithmetic addition of the following values:
82+
// Limp 1
83+
// Holding 2
84+
// Accelerating 4
85+
// Decelerating 8
86+
// Free 16
87+
// Travelling 32
88+
// Therefore, 0 = no blinking and 63 = always blinking
89+
//myLSS.setBlinkingLED(0);
90+
91+
// Reset motor to complete change of configurations
92+
myLSS.reset();
93+
94+
// Wait for reboot
95+
delay(2000);
96+
}
97+
98+
void loop()
99+
{
100+
// Loop through each of the 8 LED color (black = 0, red = 1, ..., white = 7)
101+
for (uint8_t i = LSS_LED_Black; i <= LSS_LED_White; i++)
102+
{
103+
// Set the color (session) of the LSS
104+
myLSS.setColorLED((LSS_LED_Color) i);
105+
delay(1000);
106+
}
107+
}
Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
1-
/*
2-
* Author: Sebastien Parent-Charette (support@robotshop.com)
3-
* Version: 1.1.0
4-
* Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
5-
*
6-
* Desscription: Moves one LSS using the position of a second LSS.
7-
*/
8-
9-
#include <LSS.h>
10-
11-
#define LSS_BAUD (LSS_DefaultBaud)
12-
13-
// Create two LSS object; one for output (ID=0), one for input (ID=1)
14-
LSS myLSS_Output = LSS(0);
15-
LSS myLSS_Input = LSS(1);
16-
17-
void setup()
18-
{
19-
// Initialize the LSS bus
20-
LSS::initBus(Serial, LSS_BAUD);
21-
22-
// Initialize LSS output to position 0.0
23-
myLSS_Output.move(0);
24-
25-
// Wait for it to get there
26-
delay(2000);
27-
28-
// Lower output servo stiffness & accelerations
29-
myLSS_Output.setAngularStiffness(0);
30-
myLSS_Output.setAngularHoldingStiffness(0);
31-
myLSS_Output.setAngularAcceleration(15);
32-
myLSS_Output.setAngularDeceleration(15);
33-
34-
// Make input servo limp (no active resistance)
35-
myLSS_Input.limp();
36-
}
37-
38-
// Reproduces position of myLSS_Input on myLSS_Output
39-
unsigned long startTime = millis();
40-
41-
void loop()
42-
{
43-
// Wait ~25 ms before sending another command (update at most 25 times per second)
44-
if((millis() - startTime) > 25)
45-
{
46-
startTime = millis();
47-
int16_t pos = (int16_t)myLSS_Input.getPosition();
48-
Serial.print("Input @ "); Serial.println(pos);
49-
50-
// Send LSS to half a turn counter-clockwise from zero (assumes gyre = 1)
51-
myLSS_Output.move(pos);
52-
Serial.println("\r\n");
53-
}
54-
}
1+
/*
2+
* Author: Sebastien Parent-Charette (support@robotshop.com)
3+
* Version: 1.1.0
4+
* Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
5+
*
6+
* Desscription: Moves one LSS using the position of a second LSS.
7+
*/
8+
9+
#include <LSS.h>
10+
11+
#define LSS_BAUD (LSS_DefaultBaud)
12+
13+
// Create two LSS object; one for output (ID=0), one for input (ID=1)
14+
LSS myLSS_Output = LSS(0);
15+
LSS myLSS_Input = LSS(1);
16+
17+
void setup()
18+
{
19+
// Initialize the LSS bus
20+
LSS::initBus(Serial, LSS_BAUD);
21+
22+
// Initialize LSS output to position 0.0
23+
myLSS_Output.move(0);
24+
25+
// Wait for it to get there
26+
delay(2000);
27+
28+
// Lower output servo stiffness & accelerations
29+
myLSS_Output.setAngularStiffness(0);
30+
myLSS_Output.setAngularHoldingStiffness(0);
31+
myLSS_Output.setAngularAcceleration(15);
32+
myLSS_Output.setAngularDeceleration(15);
33+
34+
// Make input servo limp (no active resistance)
35+
myLSS_Input.limp();
36+
}
37+
38+
// Reproduces position of myLSS_Input on myLSS_Output
39+
unsigned long startTime = millis();
40+
41+
void loop()
42+
{
43+
// Wait ~25 ms before sending another command (update at most 25 times per second)
44+
if ((millis() - startTime) > 25)
45+
{
46+
startTime = millis();
47+
int16_t pos = (int16_t) myLSS_Input.getPosition();
48+
Serial.print("Input @ ");
49+
Serial.println(pos);
50+
51+
// Send LSS to half a turn counter-clockwise from zero (assumes gyre = 1)
52+
myLSS_Output.move(pos);
53+
Serial.println("\r\n");
54+
}
55+
}

0 commit comments

Comments
 (0)