diff --git a/App/JS/Resources/Servos/ax18a.csv b/App/JS/Resources/Servos/ax18a.csv
new file mode 100644
index 0000000..967b395
--- /dev/null
+++ b/App/JS/Resources/Servos/ax18a.csv
@@ -0,0 +1,33 @@
+Address, Size(Byte), Data Name, Description, Access, InitialValue
+0, 2, Model Number, Model Number, R, 18
+2, 1, Firmware Version, Firmware Version, R, -
+3, 1, ID, DYNAMIXEL ID, RW, 1
+4, 1, Baud Rate, Communication Speed, RW, 1
+5, 1, Return Delay Time, Response Delay Time, RW, 250
+6, 2, CW Angle Limit, Clockwise Angle Limit, RW, 0
+8, 2, CCW Angle Limit, Counter-Clockwise Angle Limit, RW, 1023
+11, 1, Temperature Limit, Maximum Internal Temperature Limit, RW, 75
+12, 1, Min Voltage Limit, Minimum Input Voltage Limit, RW, 60
+13, 1, Max Voltage Limit, Maximum Input Voltage Limit, RW, 140
+14, 2, Max Torque, Maximun Torque, RW, 983
+16, 1, Status Return Level, Select Types of Status Return, RW, 2
+17, 1, Alarm LED, LED for Alarm, RW, 36
+18, 1, Shutdown, Shutdown Error Information, RW, 36
+24, 1, Torque Enable, Motor Torque On/Off, RW, 0
+25, 1, LED, Status LED On/Off, RW, 0
+26, 1, CW Compliance Margin, CW Compliance Margin, RW, 1
+27, 1, CCW Compliance Margin, CCW Compliance Margin, RW, 1
+28, 1, CW Compliance Slope, CW Compliance Slope, RW, 32
+29, 1, CCW Compliance Slope, CCW Compliance Slope, RW, 32
+30, 2, Goal Position, Target Position, RW, -
+32, 2, Moving Speed, Moving Speed, RW, -
+34, 2, Torque Limit, Torque Limit(Goal Torque), RW, ADD 14&15
+36, 2, Present Position, Present Position, R, -
+38, 2, Present Speed, Present Speed, R, -
+40, 2, Present Load, Present Load, R, -
+42, 1, Present Voltage, Present Voltage, R, -
+43, 1, Present Temperature, Present Temperature, R, -
+44, 1, Registered, If Instruction is registered, R, 0
+46, 1, Moving, Movement Status, R, 0
+47, 1, Lock, Locking EEPROM, RW, 0
+48, 2, Punch, Minimum Current Threshold, RW, 32
diff --git a/App/JS/Resources/Servos/xl320.csv b/App/JS/Resources/Servos/xl320.csv
new file mode 100644
index 0000000..9a88966
--- /dev/null
+++ b/App/JS/Resources/Servos/xl320.csv
@@ -0,0 +1,32 @@
+Address, Size(Byte), Data Name, Description, Access, InitialValue, Min, Max
+0, 2, Model Number, Model Number, R, 350, -, -
+2, 1, Firmware Version, Firmware Version, R, -, -, -
+3, 1, ID, DYNAMIXEL ID, RW, 1, 0, 252
+4, 1, Baud Rate, Communication Speed, RW, 3, 0, 3
+5, 1, Return Delay Time, Response Delay Time, RW, 250, 0, 254
+6, 2, CW Angle Limit, Clockwise Angle Limit, RW, 0, 0, 1023
+8, 2, CCW Angle Limit, Counter-Clockwise Angle Limit, RW, 1023, 0, 1023
+11, 1, Control Mode, Control Mode, RW, 2, 1, 2
+12, 1, Temperature Limit, Maximum Internal Temperature Limit, RW, 65, 0, 150
+13, 1, Min Voltage Limit, Minimum Input Voltage Limit, RW, 60, 50, 250
+14, 1, Max Voltage Limit, Maximum Input Voltage Limit, RW, 90, 50, 250
+15, 2, Max Torque, Maximun Torque, RW, 1023, 0, 1023
+17, 1, Status Return Level, Select Types of Status Return, RW, 2, 0, 2
+18, 1, Shutdown, Shutdown Error Information, RW, 3, 0, 7
+24, 1, Torque Enable, Motor Torque On/Off, RW, 0, 0, 1
+25, 1, LED, Status LED On/Off, RW, 0, 0, 7
+27, 1, D Gain, Derivative Gain, RW, 0, 0, 254
+28, 1, I Gain, Integral Gain, RW, 0, 0, 254
+29, 1, P Gain, Proportional Gain, RW, 32, 0, 254
+30, 2, Goal Position, Desired Position, RW, -, 0, 1023
+32, 2, Moving Speed, Moving Speed(Moving Velocity), RW, -, 0, 2047
+35, 2, Torque Limit, Torque Limit(Goal Torque), RW, -, 0, 1023
+37, 2, Present Position, Present Position, R, -, -, -
+39, 2, Present Speed, Present Speed, R, -, -, -
+41, 2, Present Load, Present Load, R, -, -, -
+45, 1, Present Voltage, Present Voltage, R, -, -, -
+46, 1, Present Temperature, Present Temperature, R, -, -, -
+47, 1, Registered, If Instruction is registered, R, 0, -, -
+49, 1, Moving, Movement Status, R, 0, -, -
+50, 1, Hardware Error Status, Hardware Error Status, R, 0, -, -
+51, 2, Punch, Minimum Current Threshold, RW, 32, 0, 1023
diff --git a/App/JS/createServo.js b/App/JS/createServo.js
index 7037b91..2bc28c7 100644
--- a/App/JS/createServo.js
+++ b/App/JS/createServo.js
@@ -1,3 +1,4 @@
+const fs = require('fs');
const rp = require('request-promise');
const cheerio = require('cheerio');
const cheerioTableparser = require('cheerio-tableparser');
@@ -88,16 +89,23 @@ function generateCSV(html, indexes) {
' Now scraping the data...');
fileData = generateCSV(html, [1, 2]);
console.log('Downloaded table!');
-
+
const linkPieces = link.split('/');
if (linkPieces[linkPieces.length - 1] == '') {
linkPieces.pop(linkPieces.length - 1);
}
- filename = linkPieces[linkPieces.length - 1];
+ filename = linkPieces[linkPieces.length - 1].replace('-', '');
+
+ fs.writeFile(`App/JS/Resources/Servos/${filename}.csv`, fileData, function(err) {
+ if (err) {
+ console.error('Failed to write file! Do you have access?');
+ }
+ console.log(`Saved the file as ${filename}.csv`);
+ });
uploadButton = document.getElementById('upload')
uploadButton.innerHTML =
- `Upload ${filename.replace('-', '')}.csv`;
+ `Upload ${filename}.csv`;
uploadButton.style.display = null;
})
.catch(function(err) {