Skip to content

Commit 73c4d67

Browse files
authored
Merge pull request #60 from ROBOTIS-GIT/develop
Develop
2 parents 2634a23 + 5d64d4b commit 73c4d67

File tree

8 files changed

+38
-42
lines changed

8 files changed

+38
-42
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: dynamixel2arduino_ci
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
dynamixel2arduino_ci:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Run Arduino CI Script
17+
run: |
18+
source <(curl -SLs https://raw.githubusercontent.com/ROBOTIS-GIT/Dynamixel2Arduino/master/install.sh) ${{github.ref}}
19+
build_platform opencr
20+
build_platform uno
21+
build_platform mega2560
22+
build_platform mkrzero
23+
build_platform portenta

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/advanced/sync_read_write_raw/sync_read_write_raw.ino

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050

5151
/* syncRead
52+
DYNAMIXEL PROTOCOL 1.0 does NOT support Sync Read feature.
5253
Structures containing the necessary information to process the 'syncRead' packet.
5354
5455
typedef struct XELInfoBulkRead{
@@ -68,6 +69,7 @@
6869
*/
6970

7071
/* syncWrite
72+
DYNAMIXEL PROTOCOL 1.0 supports Control Table address up to 255.
7173
Structures containing the necessary information to process the 'syncWrite' packet.
7274
7375
typedef struct XELInfoBulkWrite{
@@ -85,6 +87,8 @@
8587
} __attribute__((packed)) InfoBulkWriteInst_t;
8688
*/
8789

90+
const uint8_t BROADCAST_ID = 254;
91+
const float DYNAMIXEL_PROTOCOL_VERSION = 2.0;
8892
const uint8_t DXL_ID_CNT = 2;
8993
const uint8_t DXL_ID_LIST[DXL_ID_CNT] = {1, 2};
9094
const uint16_t user_pkt_buf_cap = 128;
@@ -123,12 +127,13 @@ void setup() {
123127
pinMode(LED_BUILTIN, OUTPUT);
124128
DEBUG_SERIAL.begin(115200);
125129
dxl.begin(57600);
130+
dxl.setPortProtocolVersion(DYNAMIXEL_PROTOCOL_VERSION);
126131

127132
for(i=0; i<DXL_ID_CNT; i++){
128133
dxl.torqueOff(DXL_ID_LIST[i]);
129134
dxl.setOperatingMode(DXL_ID_LIST[i], OP_VELOCITY);
130-
dxl.torqueOn(DXL_ID_LIST[i]);
131135
}
136+
dxl.torqueOn(BROADCAST_ID);
132137

133138
// Fill the members of structure to syncRead using external user packet buffer
134139
sr_infos.packet.p_buf = user_pkt_buf;
@@ -170,8 +175,8 @@ void loop() {
170175
static uint32_t try_count = 0;
171176
uint8_t i, recv_cnt;
172177

173-
for(i=0; i<DXL_ID_CNT; i++){
174-
sw_data[i].goal_velocity+=5;
178+
for(i = 0; i < DXL_ID_CNT; i++){
179+
sw_data[i].goal_velocity = 5 + sw_data[i].goal_velocity;
175180
if(sw_data[i].goal_velocity >= 200){
176181
sw_data[i].goal_velocity = 0;
177182
}
@@ -214,7 +219,3 @@ void loop() {
214219
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
215220
delay(750);
216221
}
217-
218-
219-
220-

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fi
1010
# this will be eval'd in the functions below because arrays can't be exported
1111
# For creating a new main platform, please refer to https://arduino.github.io/arduino-cli/latest/platform-specification/#hardware-folders-structure
1212
# and https://arduino.github.io/arduino-cli/latest/platform-specification/#boardstxt
13-
export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed:envie_m7")'
13+
export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed_portenta:envie_m7")'
1414

1515
# make display available for arduino CLI
1616
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
@@ -55,7 +55,7 @@ DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:samd 2>&1)
5555
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
5656

5757
echo -n "INSTALL Portenta H7: "
58-
DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed 2>&1)
58+
DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed_portenta 2>&1)
5959
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
6060

6161
echo -n "INSTALL OpenCR: "

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Dynamixel2Arduino
2-
version=0.4.6
2+
version=0.4.7
33
author=ROBOTIS
44
license=Apache-2.0
55
maintainer=Will Son([email protected])

src/dxl_c/protocol.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#include "protocol.h"
22

3-
#if defined(ARDUINO)
4-
#include <Arduino.h>
5-
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_SAMD)
6-
#include <avr/pgmspace.h>
7-
#endif
3+
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED_PORTENTA) && !defined(ARDUINO_ARCH_SAMD)
4+
#include <avr/pgmspace.h>
85
#endif
96

107
#if !defined(PROGMEM)

src/dxl_c/protocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define DYNAMIXEL_PROTOCOL_H_
1818

1919
#include <stdint.h>
20+
#include <stddef.h>
2021
#include <stdbool.h>
2122

2223
#define DXL_BROADCAST_ID 0xFE

src/utility/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
#if defined(ARDUINO)
8585
#include <Arduino.h>
86-
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_SAMD)
86+
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED_PORTENTA) && !defined(ARDUINO_ARCH_SAMD)
8787
#include <avr/pgmspace.h>
8888
#endif
8989
#endif

0 commit comments

Comments
 (0)