diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.js
index c2ee458950f84f8903b39ff4184449f6317cca02..887e8aa23ac23ab03bb4fa98e79eac8f4031b8d5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.js
@@ -1,3 +1,232 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:16b3b9fb148e058e361942365b094ef75f5ad96c454f3de74730ee5159ac4fdd
-size 8599
+function SlideSwitch (root,config ) {
+ var orient = root.firstElementChild;
+ var knob = root.getElementsByClassName("knob")[0];
+ var plate = root.getElementsByClassName("bounds")[0];
+ var scale = root.getElementsByClassName("scale")[0];
+ var readout = root.getElementsByClassName("readout")[0];
+ var valueText = readout.getElementsByTagName("text")[0];
+ var graticule = root.getElementsByClassName('graticule')[0];
+
+ var bbox = scale.getBBox();
+ var kbox = knob.getBBox();
+ var boundryBox = plate.getBBox();
+ var minPos = bbox.y+bbox.height-kbox.height/4;
+ var maxPos = bbox.y+kbox.height/4;
+
+ var value = parseInt(config.init);
+ var minValue = 0;
+ var numTicks = parseInt(config.numStates)-1;
+ var maxValue = parseInt(numTicks);
+ var tickLength = parseInt(config.tickLength);
+ var labelPosition = parseInt(config.labelPosition);
+ var orientation = parseInt(config.orientation);
+ var stagger = parseInt(config.staggeredLabels);
+ var textSize = parseInt(config.labelFont.size);
+
+ var range = maxValue - minValue;
+ var pageStep = range / numTicks;
+
+ var mouseDownPos = 0;
+ var mouseDownValue = 0;
+
+ valueText.setAttribute("display","none")
+
+ setHotSpot(this, plate);
+ setHotSpot(this, knob);
+
+ this.reconfigure = function (newInstance) {
+ if (newInstance) {
+ config.orientation = 0;
+ config.tickColour = '#000000';
+ config.valueFont = getFontStyle(valueText.style);
+ config.labelFont = getFontStyle(valueText.style);
+ }
+
+ switch (orientation) {
+ case 0 : orient.setAttribute('transform', 'rotate(0)'); break;
+ case 1 : orient.setAttribute('transform', 'rotate(90)'); break;
+ }
+
+
+ createTicks();
+ createLabels();
+
+ this.setState(value);
+
+ }
+
+ this.onmousedown = function (evt, element) {
+ var p = getEventPos(evt, scale);
+
+ var h = p.y - bbox.height/2
+
+ if (element == knob) {
+ // Clicked on the knob itself.
+ mouseDownPos = p.y;
+ mouseDownValue = value;
+ }
+ else if (h < sliderPos(value)) {
+ // Clicked above the knob, page up
+ this.setState(value + pageStep);
+ buttonClick();
+ } else if (h > sliderPos(value)) {
+ // Clicked below the knob, page down:
+ this.setState(value - pageStep);
+ buttonClick();
+ }
+ }
+
+
+ this.onmousemove = function(evt, element) {
+ if (element == knob) {
+ // Knob is dragged - compute the distance as an offset in scale/slider coords and then update the value:
+ var p = getEventPos(evt, scale);
+ var dif = p.y - mouseDownPos;
+ var newState = mouseDownValue + Math.round(dif / (maxPos-minPos) * (maxValue - minValue));
+ if (newState != value) {
+ this.setState(newState);
+ buttonClick();
+ }
+ }
+ };
+
+ this.onmouseup = function(e) {
+ // Update the server with the final value:
+ postState(root.id, "state", parseFloat(value.toFixed(1)));
+
+ };
+ ////////////////////////////////////////////////////////
+ this.setState = function(v) {
+ value = parseInt(v);
+ if (value < minValue)
+ value = minValue;
+ else if (value > maxValue)
+ value = maxValue;
+
+
+ var t = Math.round((value - minValue) / (maxValue - minValue) * numTicks);
+ value = minValue + t * (maxValue - minValue) / numTicks;
+
+
+ knob.setAttribute("transform", "translate(0 " + (sliderPos(value) - bbox.y) + ")");
+ valueText.textContent = value.toFixed(1);
+ }
+ /////////////////////////////////////////////////////////
+
+ this.getState = function() {
+ return value;
+ }
+
+
+ function createTicks() {
+ // Remove previous scale:
+ var scale = root.getElementsByClassName('graticule')[0];
+ var ticks = scale.getElementsByClassName('tick');
+ while (ticks.length > 0)
+ scale.removeChild(ticks[0]);
+
+ // create ticks as paths and append them to the scale.
+ var step = (maxPos - minPos) / numTicks;
+ var subStep = step;
+
+ for (var i=0; i<=numTicks; i++) {
+ var y = bbox.y + bbox.height/2 + minPos + step * i; // n.b. minPos is an offset.
+
+ for (var j=0; j<=1; j++) {
+ var len = (j==0 ? tickLength : 1);
+ var stroke = (j==0 && y == sliderPos(0) ? 3 : 1.5);
+
+ // Create ticks on both sides.
+ // TBD Hard coded '20' may need adjustment or be a config settings.
+ for (var k=1; k<=1; k+=1) {
+
+ if(labelPosition+orientation*3 == 2 || labelPosition+orientation*3 == 5){
+ var c = k
+ }else{
+ var c = -k
+ }
+
+ var tick = document.createElementNS(svgNS, "path");
+ tick.setAttribute("class", "tick");
+ tick.setAttribute("d", "m " + ((boundryBox.width/2 +4) * c) + "," + y + " " + len * c + "," + 0);
+ tick.style.strokeWidth = stroke;
+ tick.style.stroke = config.tickColour;
+ scale.appendChild(tick);
+ }
+ }
+ }
+ }
+
+ function createLabels () {
+ // Remove previous labels
+ var scale = root.getElementsByClassName('graticule')[0];
+ var labels = scale.getElementsByClassName('label');
+ while (labels.length > 0)
+ scale.removeChild(labels[0]);
+
+ if (labelPosition != 0) {
+ var valueStart = minValue;
+ var valueStep = (maxValue-minValue) / numTicks;
+ var labelPrecision = (range % numTicks == 0) ? 0 : 1;
+ var step = (maxPos - minPos) / numTicks;
+
+ var labelText = [];
+ if (config.labels != undefined)
+ labelText = config.labels.split(',');
+
+ for (var i=0; i<=numTicks; i++) {
+ var label = document.createElementNS(svgNS, 'text');
+ var value = valueStart + valueStep * i;
+ setFontStyle(label.style, config.labelFont);
+ label.textContent = i
+
+ var offSet = 0
+
+ if (i % 2 != 0 & orientation !=0 & stagger == 1){
+ offSet = textSize + 5}
+
+
+
+ switch (labelPosition+orientation*3) {
+ case 1 : label.setAttribute('x', boundryBox.x - tickLength); label.setAttribute('dx','-0.5em'); label.style.textAnchor = "end"; break;
+ case 2 : label.setAttribute('x', boundryBox.x + boundryBox.width + tickLength); label.setAttribute('dx','+0.5em'); label.style.textAnchor = "start"; break;
+ case 4 : label.setAttribute('y', boundryBox.x - offSet - tickLength); label.setAttribute('dy','-2ex'); break;
+ case 5 : label.setAttribute('y', boundryBox.x + boundryBox.width + offSet + tickLength); label.setAttribute('dy','+4ex'); break;
+ }
+ if (orientation == 0) {
+ label.setAttribute('y', bbox.y + bbox.height/2 + minPos + step * i);
+ label.setAttribute('transform', 'rotate(0)');
+ label.setAttribute('dy', '1.25ex');
+ } else {
+ label.setAttribute('x', bbox.y + bbox.height/2 + maxPos - step * i);
+ label.setAttribute('transform', 'rotate(-90)');
+ label.style.textAnchor = "middle";
+ }
+
+ if (labelText[i] != undefined){
+ label.textContent = labelText[i]}else{
+ label.textContent = i
+ }
+
+ label.setAttribute('class', 'label');
+ label.style.display='inherit';
+ scale.appendChild(label);
+ }
+ }
+ }
+
+ // Return the slider position in scale coordinates for a value v.
+ function sliderPos (v) {
+ return bbox.y + sliderOffset(v);
+ }
+
+ // Return the slider positional offset for a specified value v.
+ // This is returned as an offset from the centre position, since the control template
+ // is drawn with the knob at the centre position.
+ function sliderOffset (v) {
+ return minPos + (v - minValue) / (maxValue - minValue) * (maxPos - minPos);
+ }
+
+
+ }
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.xml
index c625ed2ffd1859aa9258a48b21f7d5490ab7641e..efbd52e0f6f39144b6503244ff7a6722e4f0bdac 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Control.xml
@@ -1,3 +1,58 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bf6162f6cb4958333fd6a4a3e838bcdc7e4e9a2b4a8e27091b7be1e1e7dbfb08
-size 2341
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch1.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch1.svg
index 809d79cb174a58247e14eba537576fa6f51e789a..94ce3a308dbcdf155e6b62370f7a43d32291cf78 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch1.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch1.svg
@@ -1,3 +1,836 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ce3319d5f77b78f22228c473c56d63a29a8055c85e959361e2f28480cd9304cd
-size 21036
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch2.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch2.svg
index f7bc3a92213afd65b07eb933913fffc5840e77a0..8ff21f82e1c70789c6829632c7349a0853f81c14 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch2.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch2.svg
@@ -1,3 +1,804 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b2ce290a9831800d369b6333e65ea4e9a870f0945537944bf6d28f0d1b0826d9
-size 21680
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch3.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch3.svg
index 3b4ed3c08ea50b5af37bf0fee83219ae1e0f0fc2..2d001a25beff4d6cdc7f20db8a4311b31fd631fe 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch3.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Metallic/slideSwitch3.svg
@@ -1,3 +1,827 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b999d30b60b00bb1289e217b049e7f2321a31366f48330ca1f4b04a85d75839a
-size 22464
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Arrow Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Arrow Slide Switch.svg
index 0b3edc0949ed87d5f1db35c9f18326860b02d1dd..05a248203fb331d3f34481ec4dfae069eb324f75 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Arrow Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Arrow Slide Switch.svg
@@ -1,3 +1,243 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6e4cbe43873f20e45dfea595266c4d61835990ea09ba7ccf359afaa7c5e10a19
-size 7889
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Pointed Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Pointed Slide Switch.svg
index e6cc1c257bbf72a0ecfcab719605f68f85951454..e9627f57fa8db11a12bd98e56d1c7128db6d2ac0 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Pointed Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Pointed Slide Switch.svg
@@ -1,3 +1,243 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:558bf18e3b5326bb74745a9fa907fd79e76765ed0da05735a4da4241bd41cb73
-size 7915
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Round Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Round Slide Switch.svg
index 719648094aa049cf292f60fb70878e50103b354b..96ec013ecb4c52eb9aeef8909a2d47cd65a456db 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Round Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Round Slide Switch.svg
@@ -1,3 +1,247 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:badb476e477b3e0097c2fdb17b4eda43d918ddcbb621e599881e8f963fee1a4f
-size 6895
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Square Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Square Slide Switch.svg
index debf25e9c3713b00e71492689e9ece50cccb0b01..1a744927fe877c8d25e7e5633edce5869f5e275a 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Square Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Modern/Square Slide Switch.svg
@@ -1,3 +1,263 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:58c0a9a839c6253fdd6106467038f9936b324d91e4b30c02432adef19fadcd1a
-size 7661
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch 2.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch 2.svg
index 2b37d4d58a06d135bb5240fbc88374f84e36b86b..ed4a0ebe617bf60c1b4e7858380849ab67808e77 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch 2.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch 2.svg
@@ -1,3 +1,599 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3adb4fdf15dea719e494cadd7ca2e7157383b8fd85dddebcf3b2cd26c287f21d
-size 22741
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch.svg
index 0e300a0ced53e5554c4a3aefcc17db4d26968ef0..d20b4e11106961224f4d3459968b7310341aa5e1 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch.svg
@@ -1,3 +1,624 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6309c883c6b85768bf300122fa30c60ac5908687430bddbe86edb0b950878c0c
-size 21985
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch3.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch3.svg
index 4d5f1ca599f364be232c84b840ebfb915892c2f5..32a867b836286ccc0707f98158138d04570d1e84 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch3.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Retro/Retro SlideSwitch3.svg
@@ -1,3 +1,359 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9e84e0defbe868ec7b07144dfced21812b62727d5b1bc53f5f0f06f7f924d2e4
-size 10696
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Round Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Round Slide Switch.svg
index 5eb749cff0f95f3b049071a5ef06b2662b12f105..6d18034ab5d48e8d62fb47cd47e5ac177854d9ac 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Round Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Round Slide Switch.svg
@@ -1,3 +1,457 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ed813256e61bf110781f7bf9a4efbbf839d8b6ee107316ee3f357fa2d659fceb
-size 14666
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Square Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Square Slide Switch.svg
index 8f7ac3bf1d51e4728b347053e5f1b9f488c7426d..291e9fb6b28715852fa1e8d93b2fe9c66bf05f55 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Square Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Square Slide Switch.svg
@@ -1,3 +1,363 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:57a6353a8f0afe186633f6071146b80fd63191f619fd383d245d9fd18f67e529
-size 10861
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch1.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch1.svg
index 272e96741d210612e63f56deb51b015517bb50ca..7303cc620563f9ce900275e017caacd104646c08 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch1.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch1.svg
@@ -1,3 +1,791 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c0b8a6fff61aac4d0c5bbcb2e11562bee2b610c599e8306e11636a1deca5240e
-size 22603
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch2.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch2.svg
index 3537234c0167ad10cc3d8e171b38bec61a581577..69fec382e34fc0e5ae59e18c6ae6d551500cf9ea 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch2.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch2.svg
@@ -1,3 +1,373 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9ba5514d427e85d2a25ae23bd1994baac198e090526afec8ef233257d3becaac
-size 9324
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch3.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch3.svg
index c2fc533825b8896f5a8a45a6c6c5377f37228972..c51b3baf70e7f54ed38ad81683d120c095b20420 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch3.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Steampunk/slideSwitch3.svg
@@ -1,3 +1,680 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:59762105edd722d332727081af6c2f3b5656476dfef34871ef66acbda4bd9261
-size 18018
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Triangular Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Triangular Slide Switch.svg
index 531a3ed3f150efe7ecadb9c413f5b4dcc84494fd..17a1592737bfec599699e28f59dffd84ea08d149 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Triangular Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SlideSwitch/Triangular Slide Switch.svg
@@ -1,3 +1,347 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9f2608ffcf46a960d7e6abcb31147bb238be788786ca5417daec845edd7c71ca
-size 10415
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Slider/Triangular Slider.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Slider/Triangular Slider.svg
index 9f740a290908d66435a9ef9ea174ea28619b1082..d844292153bc99d2fa3845d70ae4164351796495 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Slider/Triangular Slider.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Slider/Triangular Slider.svg
@@ -1,3 +1,265 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2311b80c97e4e5adc8bd4df97d0bcf731a18535492b0a008ca7a6037616c9775
-size 8694
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.js
index 40b56a8746081b240908c8e8e2553494e5e3dd6b..dff54ba629024fe32dc3d08bbd387a82730c082b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.js
@@ -1,3 +1,110 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9b4170237fa11199170b7fd64f02bf86288be529e291e0f8e91e86839fc6597a
-size 3326
+function SteeringWheel(root, config) {
+ var obj = this;
+ var stator = root.getElementsByClassName('stator')[0];
+ var rotor = root.getElementsByClassName('rotor')[0];
+ var readout = root.getElementsByClassName('readout')[0];
+ var valueText = readout.getElementsByTagName('text')[0];
+
+ var value = parseInt(config.init);
+ var amin = parseInt(config.amin);
+ var amax = parseInt(config.amax);
+ var anchorAngle, anchorValue;
+
+ valueText.style.pointerEvents = "none";
+
+ var updateTimer = setInterval(postValue, 1000/parseFloat(config.rate));
+ var updateValue = value;
+
+ if (typeof(viewer) == 'object')
+ viewer.registerSensorHandler(root.id, 'Accelerometer');
+
+ setHotSpot(this, stator);
+
+ this.reconfigure = function (newInstance) {
+ if (newInstance) {
+ config.init = 0;
+ config.amin = -90;
+ config.amax = +90;
+ }
+
+ this.setValue(config.init);
+ }
+
+ // If not running the editor we need mouse handlers:
+ this.onmousedown = function (e) {
+ var p = getEventPos(e, stator);
+ var dist = Math.sqrt(p.x*p.x + p.y*p.y);
+ if (dist > 30) {
+ anchorAngle = Math.atan2(p.x, -p.y)*180/Math.PI;
+ anchorValue = value;
+ } else {
+ obj.setValue(0);
+ anchorAngle = undefined;
+ }
+ }
+
+
+ this.onmousemove = function (e) {
+ var p = getEventPos(e, stator);
+ var dist = Math.sqrt(p.x*p.x + p.y*p.y);
+ if (dist > 30 && anchorAngle != undefined) {
+ var angle = Math.atan2(p.x, -p.y)*180/Math.PI;
+ var newValue = angle-anchorAngle + anchorValue;
+ if (Math.abs(newValue - value) > 180)
+ newValue += (angle < -90) ? 360 : -360;
+ if (newValue != value && newValue < 180 && newValue > -180) {
+ obj.setValue(newValue.toFixed(0));
+ }
+ }
+ }
+
+ this.onmouseup = function (e) {
+ }
+
+
+ this.onsensorchanged = function (sensorType, values) {
+ if (sensorType == 'Accelerometer') {
+ // This will be called each time the host device has an update
+ var pitch = values[1]*180/Math.PI;
+ var roll = values[2]*180/Math.PI;
+ if (roll < -45)
+ roll = -45;
+ else if (roll > 45)
+ roll = 45;
+ var angle = amin + (roll + 45) / 90 * (amax-amin)
+ obj.setValue(angle);
+
+ // Detach from mouse operation:
+ clearHotSpot(this, stator);
+ }
+ }
+
+
+ this.setValue = function(v) {
+ v = parseFloat(v);
+ if (v < amin)
+ v = amin;
+ else if (v > amax)
+ v = amax;
+ value = Math.round(v);
+
+ rotor.setAttribute("transform", "rotate(" + v + ")");
+ valueText.textContent = value;
+
+ }
+
+ this.getValue = function() {
+ return value;
+ }
+
+ function postValue () {
+ if (document.getElementById(obj.id) == null)
+ clearInterval(updateTimer);
+ else if (updateValue != value)
+ postState(obj.id, "value", value);
+ updateValue = value;
+ }
+
+
+ return this;
+}
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.xml
index c387f7bf92db0cb35564a1ac8f5ab8d175c514db..3246ac33ffef9639b1f9657bdd7e59daaec64915 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/Control.xml
@@ -1,3 +1,26 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9e62dae6a4b01ef12c843850a468319878296b000f687e78cfdd6d2d05fc99ff
-size 1028
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/SteeringWheel.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/SteeringWheel.svg
index 2e6818c899d9f4a078fd6cbb2b7f753c8c086498..9faf0475a7f1fc50cc8a99d32e05c9981197855c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/SteeringWheel.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/SteeringWheel/SteeringWheel.svg
@@ -1,3 +1,569 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a679087c4ed25362bc86cab46a46dfd7e2ed07c5fd5c83221a0f44963944c1fe
-size 22152
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.js
index cb735d81536599e49c500a049f21401ca9d8ae1a..cd0ca8342b8ddf28956ee36c06793d1ebc2522fe 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.js
@@ -1,3 +1,189 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d8a481505ae18a17a370bf2c4144e9f07479d609302fba472b9e5afc73002a96
-size 6821
+
+function Terminal(root, config) {
+ var obj = this;
+ var border = root.getElementsByTagName('rect')[0];
+ var bounds = root.getElementsByTagName('rect')[1];
+ var textRegion = root.getElementsByTagName('g')[0];
+ var textSample = textRegion.getElementsByTagName('text')[0];
+ var text = null;
+
+ var inputBorder = root.getElementsByClassName('inputBorder')[0];
+ var inputRegion = root.getElementsByTagName('g')[1];
+ var inputArea = inputRegion.getElementsByTagName('rect')[0];
+ var placeHolder = inputRegion.getElementsByTagName('text')[0];
+
+ var input = null;
+
+ var pastCommands = [];
+ var pastCommandSelected = 0;
+
+ setHotSpot(this, inputBorder);
+
+ var textArea = textRegion.getElementsByTagName('rect')[0];
+ text = createOverlay(root, textArea, 'textarea');
+ text.style.fontFamily = config.textFont.family;
+ text.style.fontSize = config.textFont.size + 'px';
+ text.style.color = config.textFont.colour;
+ text.style.outline = 'none';
+ text.onmousedown = function (e) { e.stopPropagation(); }
+ text.onmouseup = function (e) { e.stopPropagation(); }
+ text.readOnly = true;
+
+ if (typeof(editor) == 'object') {
+ text.value = textSample.textContent+'!';
+ text.style.pointerEvents = 'none';
+ }
+ textSample.style.display = 'none';
+
+ placeHolder.style.pointerEvents='none';
+
+ this.reconfigure = function (newInstance) {
+ if (newInstance) {
+ config.textFont = getFontStyle(textSample);
+ config.placeHolder = placeHolder.textContent;
+ }
+ placeHolder.textContent = config.placeHolder;
+ text.style.fontFamily = config.textFont.family;
+ text.style.fontSize = config.textFont.size + 'px';
+ text.style.color = config.textFont.colour;
+ }
+
+ this.update = function () {
+ var ctm = root.getCTM();
+ var tbt = panel.createSVGTransform();
+ tbt.setScale(1/ctm.a, 1/ctm.d);
+ border.transform.baseVal.initialize(tbt);
+ border.width.baseVal.value = bounds.width.baseVal.value*ctm.a;
+ border.height.baseVal.value = bounds.height.baseVal.value*ctm.d;
+
+ // Compute a transform for the input border rectangle:
+ var ibt = panel.createSVGTransform();
+ ibt.setScale(1/ctm.a, 1/ctm.d);
+ inputBorder.transform.baseVal.initialize(ibt);
+ inputBorder.y.baseVal.value = border.height.baseVal.value-inputBorder.height.baseVal.value-1;
+ inputBorder.width.baseVal.value = (bounds.width.baseVal.value)*ctm.a-2;
+
+ // Adjust the height of the text area
+ textArea.height.baseVal.value = bounds.height.baseVal.value - inputBorder.height.baseVal.value/ctm.d;
+
+ // Reposition the input region group:
+ var irt = panel.createSVGTransform();
+ irt.setTranslate(0, textArea.height.baseVal.value);
+ inputRegion.transform.baseVal.initialize(irt);
+
+ // Re-scale the input area rectangle to maintain constant height:
+ var iat = panel.createSVGTransform();
+ iat.setScale(1, 1/ctm.d);
+ inputArea.transform.baseVal.initialize(iat);
+
+
+ // Force the text objects to have 1:1 aspect ratio at the panel level by compensating for any distortion.
+ var tt = panel.createSVGTransform();
+ tt.setScale(1/ctm.a, 1/ctm.d);
+ textSample.transform.baseVal.initialize(tt);
+ var pt = panel.createSVGTransform();
+ pt.setScale(1/ctm.a, 1/ctm.d);
+ placeHolder.transform.baseVal.initialize(pt);
+ }
+
+ this.onmousedown = function (e) {
+ if (input == null) {
+ beginInput();
+ } else {
+ endInput();
+ }
+ }
+
+ this.onmouseup = function (e) {
+ return input != null; // capture continues whilst the input element is active
+ }
+
+ this.startNewLine = function () {
+ var lines = text.value.split('\n');
+ if (lines != undefined && lines.length > 0) {
+ var lastLine = lines[lines.length-1];
+ if (lastLine.length != 0)
+ this.appendText('\n');
+ }
+ }
+
+ this.appendText = function (s) {
+ text.value = text.value + s;
+ text.scrollTop = text.scrollHeight;
+ };
+
+
+ this.cls = function() {
+ text.value = "";
+ };
+
+
+ this.setPrompt = function(prompt) {
+ placeHolder.textContent = prompt;
+ }
+
+
+ function beginInput () {
+ if (input == null) {
+ input = createOverlay(root, inputArea, 'input');
+ input.type = 'text';
+ input.maxLength = config.cmdLength;
+ input.style.fontFamily = placeHolder.fontFamily;
+ input.style.fontSize = placeHolder.fontSize;
+ input.focus();
+
+ // Set up event handles on the input element.
+ input.onmousedown = function (e) { e.stopPropagation(); }
+ input.onkeydown = function (e) {
+ if (e.keyCode == 13) {
+ if (pastCommands.indexOf(input.value) < 0) {
+ pastCommands.push(input.value);
+ pastCommandSelected = pastCommands.length;
+ }
+ if (input.value == config.clsCmd) {
+ postEvent("$.erase", obj.id);
+ obj.cls();
+ } else {
+ postEvent(obj.id, input.value);
+ }
+ input.value = "";
+ } else if (e.keyCode == 27) {
+ endInput();
+ } else if (!e.shiftKey && !e.ctrlKey) {
+ if (e.keyCode == 38 && pastCommands.length) { // UP
+ pastCommandSelected--;
+ if (pastCommandSelected >= 0)
+ input.value = pastCommands[pastCommandSelected];
+ else
+ pastCommandSelected = 0;
+ e.preventDefault();
+ }
+ else if (e.keyCode == 40 && pastCommands.length) { // DOWN
+ pastCommandSelected++;
+ if (pastCommandSelected < pastCommands.length)
+ input.value = pastCommands[pastCommandSelected];
+ else {
+ pastCommandSelected = pastCommands.length;
+ input.value = "";
+ }
+ e.preventDefault();
+ }
+ }
+ placeHolder.style.display = 'none';
+ }
+ }
+ }
+
+ function endInput () {
+ if (input != null) {
+ placeHolder.style.display = '';
+ deleteOverlay(input);
+ capture = null;
+ input = null;
+ }
+ }
+
+ return this;
+}
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.xml
index 25f84c69d10031837ee2f58a2379337fba9781d5..4e81428bf9d652ae6eee8099f46c2eae905f7021 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Control.xml
@@ -1,3 +1,47 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d9c1d022260dece523694487aa846b72ad4fc5a41f7267264a10eb101354f690
-size 2079
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Terminal.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Terminal.svg
index edb1ee7410f63417397c66f45355f325cbe98723..a7848ccf10ec2b7b859a04011a03df3b2fb25321 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Terminal.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Terminal/Terminal.svg
@@ -1,3 +1,139 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8d01f1bc7d7c08dae0a83492e4b199a6374f58c1a03664bba325ab8e80eda17e
-size 4172
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.js
index 3fe7344008b38dcd911b4c75c7d60e9ebb633b84..ffd54471ed77c69d1608135de68f78924a205266 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.js
@@ -1,3 +1,101 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3c54cf7960665b3caef1e625a151a00e836665162536918a8043aa0e02c085c2
-size 3297
+
+function TextLog(root, config) {
+ var obj = this;
+ var border = root.getElementsByTagName('rect')[0];
+ var bounds = root.getElementsByTagName('rect')[1];
+ var textRegion = root.getElementsByTagName('g')[0];
+ var textArea = textRegion.getElementsByTagName('rect')[0];
+ var textSample = textRegion.getElementsByTagName('text')[0];
+
+ var content = createOverlay(root, textArea, 'div');
+ content.style.listStyle = "none";
+ content.style.textAlign = "left";
+ content.style.overflowX = "hidden";
+ content.style.overflowY="auto";
+ content.style.outline="none";
+ content.style.pointerEvents = 'none';
+
+ if (config.textFont != undefined) {
+ content.style.fontFamily = config.textFont.family;
+ content.style.fontSize = config.textFont.size + 'px';
+ content.style.color = config.textFont.colour;
+ }
+
+ var loadDataPending = false;
+ var loadDataPendingRows = [];
+
+
+ this.reconfigure = function (newInstance) {
+ if (newInstance) {
+ config.textFont = getFontStyle(textSample);
+ config.backgroundColour = border.style.fill;
+ textSample.style.display = 'none';
+ }
+
+ border.style.fill = config.backgroundColour;
+ content.style.fontFamily = config.textFont.family;
+ content.style.fontSize = config.textFont.size + 'px';
+ content.style.color = config.textFont.colour;
+ }
+
+ this.update = function () {
+ // Fix the border to have fixed pixel width:
+ var ctm = root.getCTM();
+ var bt = panel.createSVGTransform();
+ bt.setScale(1/ctm.a, 1/ctm.d);
+ border.transform.baseVal.initialize(bt);
+ border.width.baseVal.value = bounds.width.baseVal.value*ctm.a;
+ border.height.baseVal.value = bounds.height.baseVal.value*ctm.d;
+ }
+
+ this.setFile = function (filename) {
+ // Request the log file and load it into the content area:
+ requestFile(filename, function (text) {
+ // Process log file:
+ obj.clear();
+ if (text != null) {
+ var lines = text.split('\r\n');
+ for (var i=0; i 0)
+ appendItem(lines[i]);
+ }
+ }
+ });
+ };
+
+ this.appendLine = function (line) {
+ if (loadDataPending)
+ loadDataPendingRows.push(line)
+ else
+ appendItem(line);
+ };
+
+ this.clear = function() {
+ content.innerHTML = "";
+ };
+
+ function appendItem (line) {
+ var li = document.createElement('li');
+ var text, flag;
+ if (line[1] == '\r' && line[2] != '\n')
+ flag = line[0], text = line.substring(2);
+ else
+ text = line;
+ switch (flag) {
+ case 'w' : li.style.color = config.warnColour; break;
+ case 'e' : li.style.color = config.errorColour; break;
+ }
+ content.appendChild(li);
+ li.textContent = text;
+ li.scrollIntoView();
+ }
+
+ if (typeof(editor) == 'object') {
+ appendItem(textSample.textContent);
+ content.style.pointerEvents = 'none';
+ } else
+ content.style.pointerEvents = '';
+
+ return this;
+}
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.xml
index 880fc04e787783ef602d3e0046395a582736103e..1ca1f29de73a82dcf1969477fa0dd6cd87e807b0 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/Control.xml
@@ -1,3 +1,49 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:02101ebc236886907bc453edda032f433d639bf72ae502f7e02d4f6c1c3cc86a
-size 1994
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/LISA1.SDF b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/LISA1.SDF
index 206a0875fc0b076e393b4cfdfce4af108815a0b0..0a1239403bed688d9bee60367d2e533ff79335d5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/LISA1.SDF
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/LISA1.SDF
@@ -1,3 +1,757 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6723fe099e21df4b261679ac258949e1886a1635a0677e8205955f31db78e0b7
-size 20209
+ISIS SCHEMATIC DESCRIPTION FORMAT 8.0
+=====================================
+Design: Test TextLog.pdsprj
+Doc. no.:
+Revision:
+Author:
+Created: 09/11/2016
+Modified: 09/11/2016
+
+*PROPERTIES,50
+ABSTOL=1e-012
+BADMOS3=No
+BYPASS=Yes
+CHGTOL=1e-014
+DEFAD=0
+DEFAS=0
+DEFAULTS=0
+DEFL=0.0001
+DEFW=0.0001
+GMIN=1e-012
+GMINSTEPS=120
+ITL1=100
+ITL2=50
+ITL4=10
+LOGSTART=0
+LOGTIME=60
+MAXORD=2
+METHOD=GEAR
+NOOPITER=No
+NUMSTEPS=50
+OLDLIMIT=No
+PARTITION=4ECA9967
+PIVREL=0.001
+PIVTOL=1e-013
+POPUP_1=00000002,-3517900,-3898900,-1816100,-2832100,LED & Reset
+RELTOL=0.001
+RSHUNT=1e+012
+SIMTYPE=TRANSIENT
+SRCSTEPS=120
+TDLOWER=0.9
+TDSCALE=1
+TDUPPER=1.1
+TEMP=27
+TMAX=0.025
+TMIN=1e-018
+TNOM=27
+TRACE_CONTENTIONS=1,0
+TRACE_CONVERGENCE=1,1
+TRACE_DCPATHS=1,2
+TRACE_ITFMODS=1,3
+TRACE_NETTYPES=1,4
+TRACE_OPTIONS=1,5
+TRACE_PERFORMANCE=1,6
+TRACE_SPICELINK=1,7
+TRANGMIN=1e-009
+TRTOL=7
+TRYTOCOMPACT=No
+TSTART=0
+TTOL=1e-009
+VNTOL=1e-006
+
+*MODELDEFS,24
+8051 : RHI=20, RLO=20,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,RPOS=5k,RNEG=20k,V+=VCC,V-=GND,FLOAT=HIGH,TRISE=10n,TFALL=10n
+AT89 : RHI=20, RLO=20,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,RPOS=5k,RNEG=20k,V+=VCC,V-=GND,FLOAT=HIGH,TRISE=10n,TFALL=10n
+AVR : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VCC,V-=GND,TRISE=10n,TFALL=10n
+BSTAMP : RSHI=20, RSLO=20,RWHI=20k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=VSS,TRISE=10n,TFALL=10n
+CM0 : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VCC,V-=GND,TRISE=1n,TFALL=1n
+CM3 : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=GND,TRISE=1n,TFALL=1n
+CM3NXP : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=VSS,TRISE=1n,TFALL=1n
+CM3STM : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=VSS,TRISE=1n,TFALL=1n
+CMOS : RHI=100,RLO=100,TRISE=1u,TFALL=1u,V+=VDD,V-=VSS
+HC11 : RHI=20, RLO=20,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=VSS,TRISE=10n,TFALL=10n
+LPC2100 : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=V3,V-=VSS
+MSP430 : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VCC,V-=GND,TRISE=10n,TFALL=10n
+NMOS : RHI=100,RLO=10,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VCC,V-=GND
+PIC : RSHI=20, RSLO=20,RWHI=20k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=VSS,TRISE=10n,TFALL=10n
+PIC3V3 : RSHI=20, RSLO=20,RWHI=20k,VUD=2,VTL=0.8,VHL=0.1,VTH=1.5,VHH=0.1,V+=VDD,V-=VSS,TRISE=10n,TFALL=10n
+PICCOLO : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VCC,V-=GND,TRISE=1n,TFALL=1n
+PLD : RHI=20,RLO=20, V+=VCC,V-=GND,FLOAT=HIGH
+PP1 : RSHI=20, RSLO=20,RWHI=100k,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,V+=VDD,V-=VSS
+RS232 : VLO=-8.5,VHI=8.5,RHI=300,RLO=300,VTL=1.2,VHL=0.5,VTH=1.7,VHH=0.5,RPOS=5k,RNEG=5k,V+=VCC,V-=GND,FLOAT=HIGH,TRISE=1u,TFALL=1u
+TTL : RHI=50, RLO=5,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,RPOS=5k,RNEG=20k,V+=VCC,V-=GND,FLOAT=HIGH
+TTLHC : RHI=5,RLO=5, V+=VCC,V-=GND
+TTLHCT : RHI=5,RLO=5, V+=VCC,V-=GND
+TTLLS : RHI=100, RLO=10,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,RPOS=12k,RNEG=50k, V+=VCC,V-=GND,FLOAT=HIGH
+TTLS : RHI=25, RLO=2.5,VUD=2,VTL=0.8,VHL=0.2,VTH=2.5,VHH=0.2,RPOS=5k,RNEG=20k,TRISE=0.5n,TFALL=0.5n, V+=VCC,V-=GND,FLOAT=HIGH
+
+*PARTLIST,127
+BUTTON#0007,RTSWITCH,,ACTIVE=0B795F58,EID=7,PACKAGE=NULL,PRIMITIVE=PASSIVE,R(0)=100M,R(1)=100m,SHEETID=00000002,STATE=0,TSWITCH=1m
+D1,LED-YELLOW,LED-YELLOW,ACTIVE=0B794218,BV=4V,EID=5,IMAX=10mA,MODFILE=LEDD,ROFF=100k,RS=3,SHEETID=00000002,TLITMIN=0.1n,VF=2.2V
+R1,RES,1k,EID=1,PACKAGE=RES40,PRIMITIVE=DIGITAL,PRIMTYPE=RESISTOR
+R2,RES,1k,EID=2,PACKAGE=RES40,PRIMITIVE=DIGITAL,PRIMTYPE=RESISTOR
+R3,RES,10k,EID=4,PACKAGE=RES40,PRIMITIVE=DIGITAL,PRIMTYPE=RESISTOR
+R4,RES,1k,EID=6,PACKAGE=RES40,PRIMITIVE=DIGITAL,PRIMTYPE=RESISTOR
+SD1,SD,SD,ACTIVE=0B793AC8:0B96EADC,EID=E,MANIFEST="C:/Users/jkj/AppData/Local/Temp/345fcde7db014bf58b9c866e9382b588/ARDUINO MEGA/Debug/RESOURCE.DAT",MEMFILE=sdcard.mmc,MEMSIZE=4,MODDLL=MMC.DLL,PACKAGE=MICROSD,PRIMITIVE=DIGITAL,READONLY=0,SHEETID=00000002,SPIINIT=1,STATE=0,TRACE="2,43",TRACE_CM="1,44"
+U1,ATMEGA2560,"ARDUINO MEGA",BOOTRST=1,BOOTSZ=0,CKOUT=1,CKSEL=14,CLKDIV8=1,CLOCK=16MHz,CODEGEN=AVRASM2,DISASM_BIN=0,ECHO_SERIAL=1,EID=3,ITFMOD=AVR,MODDATA="4ECA9967,0,4096",MODDLL=AVR2.DLL,PRIMITIVE=DIGITAL,PROGRAM="C:\Users\jkj\AppData\Local\Temp\345fcde7db014bf58b9c866e9382b588\ARDUINO MEGA\Debug\Debug.elf",SUT=0,TRACE_ACO="1,15",TRACE_ADC="1,14",TRACE_CPU="1,12",TRACE_DEFAULT=1,TRACE_EEPROM="1,16",TRACE_EXTERNAL_INTERRUPT="1,17",TRACE_INTERRUPT="1,11",TRACE_LOAD="1,9",TRACE_MEMORY="1,13",TRACE_PORTA="1,18",TRACE_PORTB="1,19",TRACE_PORTC="1,20",TRACE_PORTD="1,21",TRACE_PORTE="1,22",TRACE_PORTF="1,23",TRACE_PORTG="1,24",TRACE_PORTH="1,25",TRACE_PORTJ="1,26",TRACE_PORTK="1,27",TRACE_PORTL="1,28",TRACE_SETUP="1,8",TRACE_SLEEP="1,10",TRACE_SPI="0,29",TRACE_TIMER0="1,30",TRACE_TIMER1="1,31",TRACE_TIMER2="1,32",TRACE_TIMER3="1,33",TRACE_TIMER4="1,34",TRACE_TIMER5="1,35",TRACE_TWI="1,36",TRACE_USART0="1,37",TRACE_USART1="1,38",TRACE_USART2="1,39",TRACE_USART3="1,40",TRACE_WATCHDOG="1,41",WDTON=1
+U1_#P,POWER,AVR,BOOTRST=1,BOOTSZ=0,CKOUT=1,CKSEL=14,CLKDIV8=1,CLOCK=16MHz,CODEGEN=AVRASM2,DISASM_BIN=0,ECHO_SERIAL=1,EID=3,MODDLL=AVR2.DLL,PRIMITIVE=POWER,PROGRAM="C:\Users\jkj\AppData\Local\Temp\345fcde7db014bf58b9c866e9382b588\ARDUINO MEGA\Debug\Debug.elf",SUT=0,WDTON=1
+VFP,ETHERNET,ETHERNET_VFP,EID=8,LIBRARYPATH="C:/Users/jkj/AppData/Local/Temp/345fcde7db014bf58b9c866e9382b588/ARDUINO MEGA",MAC=DE:AD:BE:EF:FE:ED,MODDLL=NETSHIELD,PORT=80,PRIMITIVE=DIGITAL,SHOWBROWSER=1,TRACE_NETWORK="1,46",TRACE_PROTOCOL="1,45"
+VT1,"$IVIRTUAL TERMINAL",,BAUDRATE=57600,CTLPOL=0,DATABITS=8,EID=D,MODDLL=VTERM.DLL,PACKAGE=NULL,PARITY=NONE,PRIMITIVE=DIGITAL,SIGPOL=0,STOPBITS=1,TRACE="1,42",XONXOFF=0
+X0000000D#0,PPROBE,,PIN=00000002:0B70D598:00000000,PRIMITIVE=PASSIVE
+X0000000D#1,PPROBE,,PIN=00000002:0B70D598:00000001,PRIMITIVE=PASSIVE
+X0000000D#2,PPROBE,,PIN=00000002:0B70D598:00000002,PRIMITIVE=PASSIVE
+X0000000D#3,PPROBE,,PIN=00000002:0B70D598:00000003,PRIMITIVE=PASSIVE
+X0000000E#0,PPROBE,,PIN=00000002:0B793AC8:00000000,PRIMITIVE=PASSIVE
+X0000000E#1,PPROBE,,PIN=00000002:0B793AC8:00000001,PRIMITIVE=PASSIVE
+X0000000E#2,PPROBE,,PIN=00000002:0B793AC8:00000002,PRIMITIVE=PASSIVE
+X0000000E#3,PPROBE,,PIN=00000002:0B793AC8:00000003,PRIMITIVE=PASSIVE
+X00000001#0,PPROBE,,PIN=00000002:0B70C7B0:00000000,PRIMITIVE=PASSIVE
+X00000001#1,PPROBE,,PIN=00000002:0B70C7B0:00000001,PRIMITIVE=PASSIVE
+X00000002#0,PPROBE,,PIN=00000002:0B70B9C8:00000000,PRIMITIVE=PASSIVE
+X00000002#1,PPROBE,,PIN=00000002:0B70B9C8:00000001,PRIMITIVE=PASSIVE
+X00000003#0,PPROBE,,PIN=00000002:0B70B700:00000000,PRIMITIVE=PASSIVE
+X00000003#1,PPROBE,,PIN=00000002:0B70B700:00000001,PRIMITIVE=PASSIVE
+X00000003#2,PPROBE,,PIN=00000002:0B70B700:00000002,PRIMITIVE=PASSIVE
+X00000003#3,PPROBE,,PIN=00000002:0B70B700:00000003,PRIMITIVE=PASSIVE
+X00000003#4,PPROBE,,PIN=00000002:0B70B700:00000004,PRIMITIVE=PASSIVE
+X00000003#5,PPROBE,,PIN=00000002:0B70B700:00000005,PRIMITIVE=PASSIVE
+X00000003#6,PPROBE,,PIN=00000002:0B70B700:00000006,PRIMITIVE=PASSIVE
+X00000003#7,PPROBE,,PIN=00000002:0B70B700:00000007,PRIMITIVE=PASSIVE
+X00000003#8,PPROBE,,PIN=00000002:0B70B700:00000008,PRIMITIVE=PASSIVE
+X00000003#9,PPROBE,,PIN=00000002:0B70B700:00000009,PRIMITIVE=PASSIVE
+X00000003#10,PPROBE,,PIN=00000002:0B70B700:0000000A,PRIMITIVE=PASSIVE
+X00000003#11,PPROBE,,PIN=00000002:0B70B700:0000000B,PRIMITIVE=PASSIVE
+X00000003#12,PPROBE,,PIN=00000002:0B70B700:0000000C,PRIMITIVE=PASSIVE
+X00000003#13,PPROBE,,PIN=00000002:0B70B700:0000000D,PRIMITIVE=PASSIVE
+X00000003#14,PPROBE,,PIN=00000002:0B70B700:0000000E,PRIMITIVE=PASSIVE
+X00000003#15,PPROBE,,PIN=00000002:0B70B700:0000000F,PRIMITIVE=PASSIVE
+X00000003#16,PPROBE,,PIN=00000002:0B70B700:00000010,PRIMITIVE=PASSIVE
+X00000003#17,PPROBE,,PIN=00000002:0B70B700:00000011,PRIMITIVE=PASSIVE
+X00000003#18,PPROBE,,PIN=00000002:0B70B700:00000012,PRIMITIVE=PASSIVE
+X00000003#19,PPROBE,,PIN=00000002:0B70B700:00000013,PRIMITIVE=PASSIVE
+X00000003#20,PPROBE,,PIN=00000002:0B70B700:00000014,PRIMITIVE=PASSIVE
+X00000003#21,PPROBE,,PIN=00000002:0B70B700:00000015,PRIMITIVE=PASSIVE
+X00000003#22,PPROBE,,PIN=00000002:0B70B700:00000016,PRIMITIVE=PASSIVE
+X00000003#23,PPROBE,,PIN=00000002:0B70B700:00000017,PRIMITIVE=PASSIVE
+X00000003#24,PPROBE,,PIN=00000002:0B70B700:00000018,PRIMITIVE=PASSIVE
+X00000003#25,PPROBE,,PIN=00000002:0B70B700:00000019,PRIMITIVE=PASSIVE
+X00000003#26,PPROBE,,PIN=00000002:0B70B700:0000001A,PRIMITIVE=PASSIVE
+X00000003#27,PPROBE,,PIN=00000002:0B70B700:0000001B,PRIMITIVE=PASSIVE
+X00000003#28,PPROBE,,PIN=00000002:0B70B700:0000001C,PRIMITIVE=PASSIVE
+X00000003#29,PPROBE,,PIN=00000002:0B70B700:0000001D,PRIMITIVE=PASSIVE
+X00000003#30,PPROBE,,PIN=00000002:0B70B700:0000001E,PRIMITIVE=PASSIVE
+X00000003#31,PPROBE,,PIN=00000002:0B70B700:0000001F,PRIMITIVE=PASSIVE
+X00000003#32,PPROBE,,PIN=00000002:0B70B700:00000020,PRIMITIVE=PASSIVE
+X00000003#33,PPROBE,,PIN=00000002:0B70B700:00000021,PRIMITIVE=PASSIVE
+X00000003#34,PPROBE,,PIN=00000002:0B70B700:00000022,PRIMITIVE=PASSIVE
+X00000003#35,PPROBE,,PIN=00000002:0B70B700:00000023,PRIMITIVE=PASSIVE
+X00000003#36,PPROBE,,PIN=00000002:0B70B700:00000024,PRIMITIVE=PASSIVE
+X00000003#37,PPROBE,,PIN=00000002:0B70B700:00000025,PRIMITIVE=PASSIVE
+X00000003#38,PPROBE,,PIN=00000002:0B70B700:00000026,PRIMITIVE=PASSIVE
+X00000003#39,PPROBE,,PIN=00000002:0B70B700:00000027,PRIMITIVE=PASSIVE
+X00000003#40,PPROBE,,PIN=00000002:0B70B700:00000028,PRIMITIVE=PASSIVE
+X00000003#41,PPROBE,,PIN=00000002:0B70B700:00000029,PRIMITIVE=PASSIVE
+X00000003#42,PPROBE,,PIN=00000002:0B70B700:0000002A,PRIMITIVE=PASSIVE
+X00000003#43,PPROBE,,PIN=00000002:0B70B700:0000002B,PRIMITIVE=PASSIVE
+X00000003#44,PPROBE,,PIN=00000002:0B70B700:0000002C,PRIMITIVE=PASSIVE
+X00000003#45,PPROBE,,PIN=00000002:0B70B700:0000002D,PRIMITIVE=PASSIVE
+X00000003#46,PPROBE,,PIN=00000002:0B70B700:0000002E,PRIMITIVE=PASSIVE
+X00000003#47,PPROBE,,PIN=00000002:0B70B700:0000002F,PRIMITIVE=PASSIVE
+X00000003#48,PPROBE,,PIN=00000002:0B70B700:00000030,PRIMITIVE=PASSIVE
+X00000003#49,PPROBE,,PIN=00000002:0B70B700:00000031,PRIMITIVE=PASSIVE
+X00000003#50,PPROBE,,PIN=00000002:0B70B700:00000032,PRIMITIVE=PASSIVE
+X00000003#51,PPROBE,,PIN=00000002:0B70B700:00000033,PRIMITIVE=PASSIVE
+X00000003#52,PPROBE,,PIN=00000002:0B70B700:00000034,PRIMITIVE=PASSIVE
+X00000003#53,PPROBE,,PIN=00000002:0B70B700:00000035,PRIMITIVE=PASSIVE
+X00000003#54,PPROBE,,PIN=00000002:0B70B700:00000036,PRIMITIVE=PASSIVE
+X00000003#55,PPROBE,,PIN=00000002:0B70B700:00000037,PRIMITIVE=PASSIVE
+X00000003#56,PPROBE,,PIN=00000002:0B70B700:00000038,PRIMITIVE=PASSIVE
+X00000003#57,PPROBE,,PIN=00000002:0B70B700:00000039,PRIMITIVE=PASSIVE
+X00000003#58,PPROBE,,PIN=00000002:0B70B700:0000003A,PRIMITIVE=PASSIVE
+X00000003#59,PPROBE,,PIN=00000002:0B70B700:0000003B,PRIMITIVE=PASSIVE
+X00000003#60,PPROBE,,PIN=00000002:0B70B700:0000003C,PRIMITIVE=PASSIVE
+X00000003#61,PPROBE,,PIN=00000002:0B70B700:0000003D,PRIMITIVE=PASSIVE
+X00000003#62,PPROBE,,PIN=00000002:0B70B700:0000003E,PRIMITIVE=PASSIVE
+X00000003#63,PPROBE,,PIN=00000002:0B70B700:0000003F,PRIMITIVE=PASSIVE
+X00000003#64,PPROBE,,PIN=00000002:0B70B700:00000040,PRIMITIVE=PASSIVE
+X00000003#65,PPROBE,,PIN=00000002:0B70B700:00000041,PRIMITIVE=PASSIVE
+X00000003#66,PPROBE,,PIN=00000002:0B70B700:00000042,PRIMITIVE=PASSIVE
+X00000003#67,PPROBE,,PIN=00000002:0B70B700:00000043,PRIMITIVE=PASSIVE
+X00000003#68,PPROBE,,PIN=00000002:0B70B700:00000044,PRIMITIVE=PASSIVE
+X00000003#69,PPROBE,,PIN=00000002:0B70B700:00000045,PRIMITIVE=PASSIVE
+X00000003#70,PPROBE,,PIN=00000002:0B70B700:00000046,PRIMITIVE=PASSIVE
+X00000003#71,PPROBE,,PIN=00000002:0B70B700:00000047,PRIMITIVE=PASSIVE
+X00000003#72,PPROBE,,PIN=00000002:0B70B700:00000048,PRIMITIVE=PASSIVE
+X00000003#73,PPROBE,,PIN=00000002:0B70B700:00000049,PRIMITIVE=PASSIVE
+X00000003#74,PPROBE,,PIN=00000002:0B70B700:0000004A,PRIMITIVE=PASSIVE
+X00000003#75,PPROBE,,PIN=00000002:0B70B700:0000004B,PRIMITIVE=PASSIVE
+X00000003#76,PPROBE,,PIN=00000002:0B70B700:0000004C,PRIMITIVE=PASSIVE
+X00000003#77,PPROBE,,PIN=00000002:0B70B700:0000004D,PRIMITIVE=PASSIVE
+X00000003#78,PPROBE,,PIN=00000002:0B70B700:0000004E,PRIMITIVE=PASSIVE
+X00000003#79,PPROBE,,PIN=00000002:0B70B700:0000004F,PRIMITIVE=PASSIVE
+X00000003#80,PPROBE,,PIN=00000002:0B70B700:00000050,PRIMITIVE=PASSIVE
+X00000003#81,PPROBE,,PIN=00000002:0B70B700:00000051,PRIMITIVE=PASSIVE
+X00000003#82,PPROBE,,PIN=00000002:0B70B700:00000052,PRIMITIVE=PASSIVE
+X00000003#83,PPROBE,,PIN=00000002:0B70B700:00000053,PRIMITIVE=PASSIVE
+X00000003#84,PPROBE,,PIN=00000002:0B70B700:00000054,PRIMITIVE=PASSIVE
+X00000003#85,PPROBE,,PIN=00000002:0B70B700:00000055,PRIMITIVE=PASSIVE
+X00000003#86,PPROBE,,PIN=00000002:0B70B700:00000056,PRIMITIVE=PASSIVE
+X00000003#87,PPROBE,,PIN=00000002:0B70B700:00000057,PRIMITIVE=PASSIVE
+X00000003#88,PPROBE,,PIN=00000002:0B70B700:00000058,PRIMITIVE=PASSIVE
+X00000003#89,PPROBE,,PIN=00000002:0B70B700:00000059,PRIMITIVE=PASSIVE
+X00000003#92,PPROBE,,PIN=00000002:0B70B700:0000005C,PRIMITIVE=PASSIVE
+X00000004#0,PPROBE,,PIN=00000002:0B70B438:00000000,PRIMITIVE=PASSIVE
+X00000004#1,PPROBE,,PIN=00000002:0B70B438:00000001,PRIMITIVE=PASSIVE
+X00000005#0,PPROBE,,PIN=00000002:0B794218:00000000,PRIMITIVE=PASSIVE
+X00000005#1,PPROBE,,PIN=00000002:0B794218:00000001,PRIMITIVE=PASSIVE
+X00000006#0,PPROBE,,PIN=00000002:0B70DB28:00000000,PRIMITIVE=PASSIVE
+X00000006#1,PPROBE,,PIN=00000002:0B70DB28:00000001,PRIMITIVE=PASSIVE
+X00000007#0,PPROBE,,PIN=00000002:0B795F58:00000000,PRIMITIVE=PASSIVE
+X00000007#1,PPROBE,,PIN=00000002:0B795F58:00000001,PRIMITIVE=PASSIVE
+X00000008#0,PPROBE,,PIN=00000002:0B70E0B8:00000000,PRIMITIVE=PASSIVE
+X00000008#1,PPROBE,,PIN=00000002:0B70E0B8:00000001,PRIMITIVE=PASSIVE
+X00000008#2,PPROBE,,PIN=00000002:0B70E0B8:00000002,PRIMITIVE=PASSIVE
+X00000008#3,PPROBE,,PIN=00000002:0B70E0B8:00000003,PRIMITIVE=PASSIVE
+D1_D1,LEDPWM,DIODE,DRIVE=1,MODDLL=LEDMPX,NUMSTATES=8,PRIMITIVE=DIGITAL,TLITMIN=0.1n
+
+*NETLIST,97
+#00007,2
+U1,IO,PE2/XCK0/AIN0
+X00000003#3,IP,*
+
+#00011,2
+U1,IO,PE6/T3/INT6
+X00000003#7,IP,*
+
+#00012,2
+U1,IO,PE7/ICP3/CLKO/INT7
+X00000003#8,IP,*
+
+#00015,2
+U1,IO,PH2/XCK2
+X00000003#11,IP,*
+
+#00028,2
+U1,IO,PH7/T4
+X00000003#24,IP,*
+
+#00029,2
+U1,IO,PG3/TOSC2
+X00000003#25,IP,*
+
+#00030,2
+U1,IO,PG4/TOSC1
+X00000003#26,IP,*
+
+#00032,2
+U1,IO,XTAL2
+X00000003#28,IP,*
+
+#00033,2
+U1,IO,XTAL1
+X00000003#29,IP,*
+
+#00046,2
+U1,IO,PD4/ICP1
+X00000003#42,IP,*
+
+#00047,2
+U1,IO,PD5/XCK1
+X00000003#43,IP,*
+
+#00048,2
+U1,IO,PD6/T1
+X00000003#44,IP,*
+
+#00062,2
+U1,IO,PJ2/XCK3/PCINT11
+X00000003#58,IP,*
+
+#00063,2
+U1,IO,PJ3/PCINT12
+X00000003#59,IP,*
+
+#00064,2
+U1,IO,PJ4/PCINT13
+X00000003#60,IP,*
+
+#00065,2
+U1,IO,PJ5/PCINT14
+X00000003#61,IP,*
+
+#00066,2
+U1,IO,PJ6/PCINT15
+X00000003#62,IP,*
+
+#00076,2
+U1,IO,PJ7
+X00000003#72,IP,*
+
+#00135,2
+VT1,OP,RTS
+X0000000D#1,IP,*
+
+#00137,2
+VT1,IP,CTS
+X0000000D#3,IP,*
+
+IO0,5
+IO0,GT
+U1,IO,PE0/RXD0/PCINT8/PDI
+X00000003#1,IP,*
+R1,PS,1
+X00000001#0,IP,*
+
+IO1,5
+IO1,GT
+U1,IO,PE1/TXD0/PDO
+X00000003#2,IP,*
+R2,PS,1
+X00000002#0,IP,*
+
+IO5,3
+IO5,GT
+U1,IO,PE3/OC3A/AIN1
+X00000003#4,IP,*
+
+IO2,3
+IO2,GT
+U1,IO,PE4/OC3B/INT4
+X00000003#5,IP,*
+
+IO3,3
+IO3,GT
+U1,IO,PE5/OC3C/INT5
+X00000003#6,IP,*
+
+IO6,3
+IO6,GT
+U1,IO,PH3/OC4A
+X00000003#12,IP,*
+
+IO7,3
+IO7,GT
+U1,IO,PH4/OC4B
+X00000003#13,IP,*
+
+IO8,3
+IO8,GT
+U1,IO,PH5/OC4C
+X00000003#14,IP,*
+
+IO9,3
+IO9,GT
+U1,IO,PH6/OC2B
+X00000003#15,IP,*
+
+IO11,3
+IO11,GT
+U1,IO,PB5/OC1A/PCINT5
+X00000003#21,IP,*
+
+IO12,3
+IO12,GT
+U1,IO,PB6/OC1B/PCINT6
+X00000003#22,IP,*
+
+IO49,3
+IO49,GT
+U1,IO,PL0/ICP4
+X00000003#30,IP,*
+
+IO48,3
+IO48,GT
+U1,IO,PL1/ICP5
+X00000003#31,IP,*
+
+IO47,3
+IO47,GT
+U1,IO,PL2/T5
+X00000003#32,IP,*
+
+IO46,3
+IO46,GT
+U1,IO,PL3/OC5A
+X00000003#33,IP,*
+
+IO45,3
+IO45,GT
+U1,IO,PL4/OC5B
+X00000003#34,IP,*
+
+IO44,3
+IO44,GT
+U1,IO,PL5/OC5C
+X00000003#35,IP,*
+
+IO43,3
+IO43,GT
+U1,IO,PL6
+X00000003#36,IP,*
+
+IO42,3
+IO42,GT
+U1,IO,PL7
+X00000003#37,IP,*
+
+IO38,3
+IO38,GT
+U1,IO,PD7/T0
+X00000003#45,IP,*
+
+IO41,3
+IO41,GT
+U1,IO,PG0/$WR$
+X00000003#46,IP,*
+
+IO40,3
+IO40,GT
+U1,IO,PG1/$RD$
+X00000003#47,IP,*
+
+IO37,3
+IO37,GT
+U1,IO,PC0/A8
+X00000003#48,IP,*
+
+IO36,3
+IO36,GT
+U1,IO,PC1/A9
+X00000003#49,IP,*
+
+IO35,3
+IO35,GT
+U1,IO,PC2/A10
+X00000003#50,IP,*
+
+IO34,3
+IO34,GT
+U1,IO,PC3/A11
+X00000003#51,IP,*
+
+IO33,3
+IO33,GT
+U1,IO,PC4/A12
+X00000003#52,IP,*
+
+IO32,3
+IO32,GT
+U1,IO,PC5/A13
+X00000003#53,IP,*
+
+IO31,3
+IO31,GT
+U1,IO,PC6/A14
+X00000003#54,IP,*
+
+IO30,3
+IO30,GT
+U1,IO,PC7/A15
+X00000003#55,IP,*
+
+IO39,3
+IO39,GT
+U1,IO,PG2/ALE
+X00000003#63,IP,*
+
+IO29,3
+IO29,GT
+U1,IO,PA7/AD7
+X00000003#64,IP,*
+
+IO28,3
+IO28,GT
+U1,IO,PA6/AD6
+X00000003#65,IP,*
+
+IO27,3
+IO27,GT
+U1,IO,PA5/AD5
+X00000003#66,IP,*
+
+IO26,3
+IO26,GT
+U1,IO,PA4/AD4
+X00000003#67,IP,*
+
+IO25,3
+IO25,GT
+U1,IO,PA3/AD3
+X00000003#68,IP,*
+
+IO24,3
+IO24,GT
+U1,IO,PA2/AD2
+X00000003#69,IP,*
+
+IO23,3
+IO23,GT
+U1,IO,PA1/AD1
+X00000003#70,IP,*
+
+IO22,3
+IO22,GT
+U1,IO,PA0/AD0
+X00000003#71,IP,*
+
+AREF,3
+AREF,GT
+U1,IO,AREF
+X00000003#89,IP,*
+
+RESET,7
+RESET,GT
+R3,PS,1
+X00000004#0,IP,*
+BUTTON#0007,PS,2
+X00000007#1,IP,*
+U1,IO,$RESET$
+X00000003#27,IP,*
+
+IO13,5
+IO13,GT
+R4,PS,1
+X00000006#0,IP,*
+U1,IO,PB7/OC0A/OC1C/PCINT7
+X00000003#23,IP,*
+
+AD0,4
+AD0,GT
+IO54,GT
+U1,IO,PF0/ADC0
+X00000003#88,IP,*
+
+AD1,4
+AD1,GT
+IO55,GT
+U1,IO,PF1/ADC1
+X00000003#87,IP,*
+
+AD2,4
+AD2,GT
+IO56,GT
+U1,IO,PF2/ADC2
+X00000003#86,IP,*
+
+AD3,4
+AD3,GT
+IO57,GT
+U1,IO,PF3/ADC3
+X00000003#85,IP,*
+
+AD4,4
+AD4,GT
+IO58,GT
+U1,IO,PF4/ADC4/TCK
+X00000003#84,IP,*
+
+AD5,4
+AD5,GT
+IO59,GT
+U1,IO,PF5/ADC5/TMS
+X00000003#83,IP,*
+
+AD6,4
+AD6,GT
+IO60,GT
+U1,IO,PF6/ADC6/TDO
+X00000003#82,IP,*
+
+AD7,4
+AD7,GT
+IO61,GT
+U1,IO,PF7/ADC7/TDI
+X00000003#81,IP,*
+
+AD8,4
+AD8,GT
+IO62,GT
+U1,IO,PK0/ADC8/PCINT16
+X00000003#80,IP,*
+
+AD9,4
+AD9,GT
+IO63,GT
+U1,IO,PK1/ADC9/PCINT17
+X00000003#79,IP,*
+
+AD10,4
+AD10,GT
+IO64,GT
+U1,IO,PK2/ADC10/PCINT18
+X00000003#78,IP,*
+
+AD11,4
+AD11,GT
+IO65,GT
+U1,IO,PK3/ADC11/PCINT19
+X00000003#77,IP,*
+
+AD12,4
+AD12,GT
+IO66,GT
+U1,IO,PK4/ADC12/PCINT20
+X00000003#76,IP,*
+
+AD13,4
+AD13,GT
+IO67,GT
+U1,IO,PK5/ADC13/PCINT21
+X00000003#75,IP,*
+
+AD14,4
+AD14,GT
+IO68,GT
+U1,IO,PK6/ADC14/PCINT22
+X00000003#74,IP,*
+
+AD15,4
+AD15,GT
+IO69,GT
+U1,IO,PK7/ADC15/PCINT23
+X00000003#73,IP,*
+
+IO14,4
+IO14,GT
+TXD3,GT
+U1,IO,PJ1/TXD3/PCINT10
+X00000003#57,IP,*
+
+IO15,4
+IO15,GT
+RXD3,GT
+U1,IO,PJ0/RXD3/PCINT9
+X00000003#56,IP,*
+
+IO16,4
+IO16,GT
+TXD2,GT
+U1,IO,PH1/TXD2
+X00000003#10,IP,*
+
+IO17,4
+IO17,GT
+RXD2,GT
+U1,IO,PH0/RXD2
+X00000003#9,IP,*
+
+IO18,4
+IO18,GT
+TXD1,GT
+U1,IO,PD3/TXD1/INT3
+X00000003#41,IP,*
+
+IO19,4
+IO19,GT
+RXD1,GT
+U1,IO,PD2/RXD1/INT2
+X00000003#40,IP,*
+
+IO20,4
+IO20,GT
+SDA,GT
+U1,IO,PD1/SDA/INT1
+X00000003#39,IP,*
+
+IO21,4
+IO21,GT
+SCL,GT
+U1,IO,PD0/SCL/INT0
+X00000003#38,IP,*
+
+SS,4
+SS,GT
+IO53,GT
+U1,IO,PB0/$SS$/PCINT0
+X00000003#16,IP,*
+
+IO10,5
+IO10,GT
+VFP,IP,$SS$
+X00000008#0,IP,*
+U1,IO,PB4/OC2A/PCINT4
+X00000003#20,IP,*
+
+TXD,5
+TXD,GT
+VT1,IP,RXD
+X0000000D#0,IP,*
+R2,PS,2
+X00000002#1,IP,*
+
+RXD,5
+RXD,GT
+VT1,OP,TXD
+X0000000D#2,IP,*
+R1,PS,2
+X00000001#1,IP,*
+
+IO4,5
+IO4,GT
+SD1,IP,CS
+X0000000E#0,IP,*
+U1,IO,PG5/OC0B
+X00000003#0,IP,*
+
+MOSI,8
+MOSI,GT
+IO51,GT
+SD1,IP,DI
+X0000000E#1,IP,*
+VFP,IP,SI
+X00000008#2,IP,*
+U1,IO,PB2/MOSI/PCINT2
+X00000003#18,IP,*
+
+MISO,8
+MISO,GT
+IO50,GT
+SD1,OP,DO
+X0000000E#2,IP,*
+VFP,OP,SO
+X00000008#3,IP,*
+U1,IO,PB3/MISO/PCINT3
+X00000003#19,IP,*
+
+SCK,8
+SCK,GT
+IO52,GT
+SD1,IP,CLK
+X0000000E#3,IP,*
+VFP,IP,SCLK
+X00000008#1,IP,*
+U1,IO,PB1/SCK/PCINT1
+X00000003#17,IP,*
+
+#00099,5
+D1_D1,PS,A
+D1,PS,A
+X00000005#0,IP,*
+R4,PS,2
+X00000006#1,IP,*
+
++5V,10,CLASS=POWER
+VCC,PT
+VDD,PT
++5V,PR
+U1_#P,PP,V+
+U1,PP,VCC
+SD1,PP,VDD
+R3,PS,2
+X00000004#1,IP,*
+U1,IP,AVCC
+X00000003#92,IP,*
+
+GND,11,CLASS=POWER
+GND,PR
+VSS,PT
+U1_#P,PP,V-
+D1_D1,PS,K
+SD1,PP,GND
+D1,PS,K
+X00000005#1,IP,*
+BUTTON#0007,PS,1
+X00000007#0,IP,*
+U1,PP,GND
+SD1,PP,VSS
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/TextLog.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/TextLog.svg
index 4313ece68fb61ff97de5a59ccbd9ed24d905f394..e2f4918c77c3525ac2d7cf6e1a3316f6db412a2f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/TextLog.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TextLog/TextLog.svg
@@ -1,3 +1,101 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c7372d284e7e290659a67ad94b34cd41c0f2d3eb86e64c0693a3a39c97d54860
-size 3111
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.js
index 3b5e95b1a39ed6a96a9cb3b374756a40231d05ff..983faad34f2af334052125e3c887c5184a92bfac 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.js
@@ -1,3 +1,24 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:53e4b104c7636a5c0595f9eae9d294b80f1fc3121b06b0d76fa45b0367d1b4e5
-size 780
+
+function Thermometer(root, config) {
+ var CELCIUS = 0;
+ var FARENHEIT = 1
+ var scale = root.getElementsByClassName('scale')[0];
+ var mercury = root.getElementsByClassName('mercury')[0];
+ var tmin = scale.getBBox().y;
+ var tmax = tmin+scale.getBBox().height;
+
+ this.setTemperature = function(temp) {
+ if (config.units == FARENHEIT)
+ temp = (temp - 32) * 5.0 / 9.0; // to Celcius
+
+ if (temp < tmin)
+ temp = tmin;
+ else if (temp > tmax)
+ temp = tmax;
+
+ // The scaling of the mercury element in the graphics is configured so that there is a 1:1 mapping between
+ // degrees C and the top of the mercury rect in y pixels.
+ mercury.setAttribute('height', temp-tmin);
+ }
+
+}
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.xml
index c2c23f1027f5e34f44b5438cec599f12da733a19..8e1173fc7cf9b35730ab7229dfdd186f37e14ef7 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Control.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f8e380dc8881d83f5d19400a3df73a18d37cb482f46ea23f8d5754378f5683fe
-size 641
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (-40C to 50C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (-40C to 50C).svg
index ff0cfad202d6257134e64613265eba5c6009339f..d852c0f6b10b740c2599d997aef84888baa53241 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (-40C to 50C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (-40C to 50C).svg
@@ -1,3 +1,1240 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:af840adfc09ad6722e4a20bcc00844858ede8b3c5fe9e49e61b9f85cd510fcd2
-size 41823
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (0C to 100C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (0C to 100C).svg
index 3e1ee7babc16a693d4d9d29d39a69b3c0d52b498..e7ed4d614706903ca0f1112962c5bf73c25874e4 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (0C to 100C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/GenThermometer (0C to 100C).svg
@@ -1,3 +1,1092 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:341f343ee62f1fd4d7c5421b567927f47c37bba71771215716816514967ba030
-size 41989
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (-40C to 50C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (-40C to 50C).svg
index 3ab7ff048fdb78c640bde228b8a1b580f7f846c9..0722c6f06710bf2af0c4b6ac696619d96b8c1c1a 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (-40C to 50C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (-40C to 50C).svg
@@ -1,3 +1,1600 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:62a587b1c2d988fbf262aa310bf019e5e21c81dc969db68a068b8072f9fa5d91
-size 49280
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (0C to 100C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (0C to 100C).svg
index 8bb159d76eec0a032f505fee42693bfab7db1ac2..79cd7aaa285c516b1909aaf5d01e494bf8e06ecf 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (0C to 100C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Metallic/Thermometer (0C to 100C).svg
@@ -1,3 +1,1330 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9a588fa0cf397f98a8aa90b571ed8013b72b166bedebb36a42edca90a3c00950
-size 52755
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (-40C to 50C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (-40C to 50C).svg
index 9a3ebb14552252054b3615c2e3e426ad97e025c4..7a9c92bac2bf886394361c0d5b19bf61686d624f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (-40C to 50C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (-40C to 50C).svg
@@ -1,3 +1,723 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b1a44f11078b41b9add52aaf595023d3060cc2bfd88c13621e0f8c1c721befd3
-size 29648
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (0C to 100C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (0C to 100C).svg
index 5604d5ea98a170221f92c1fbb6056789183087fa..296df419fcc10d6f0f106e79ddde4499704070df 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (0C to 100C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Modern/Thermometer (0C to 100C).svg
@@ -1,3 +1,867 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6018d7ade48ce50e23a2ec1f9573a464c941f003463e5d4acda97abe3ac8102e
-size 39603
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/Retro Thermometer (0C to 100C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/Retro Thermometer (0C to 100C).svg
index 69ec897bb6b411870b1ab0b062b8acf0962d5abb..3d4039859ecce0c988c691c10e45fa1f7814a7c2 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/Retro Thermometer (0C to 100C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/Retro Thermometer (0C to 100C).svg
@@ -1,3 +1,1316 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7aeb89173ab90120dcffd4e269d1cdaa1fb6a9752f0f2491d7fccee898fe964f
-size 56078
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/RetroThermometer (-40C to 50C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/RetroThermometer (-40C to 50C).svg
index bbbeed06296aec27dcf2bad827e03220ce1c463e..204140439fa3d1ea402ba8b6b42a292786d058ac 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/RetroThermometer (-40C to 50C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Retro/RetroThermometer (-40C to 50C).svg
@@ -1,3 +1,1291 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:01578c2bb6f44a4a02bef3f3f9a903376cdf750e7cddf2c736586f45313a4487
-size 50513
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (-40C to 50C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (-40C to 50C).svg
index b6f14b39551ee727983fe8723437dc540cf20bb5..cdaa9d2dd364609386775d72ddf51e34f6e5b57e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (-40C to 50C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (-40C to 50C).svg
@@ -1,3 +1,1386 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7c5a1cdb88cce7b8282ded2aeb936e2e46364dda4de343316075a3f46a9eb290
-size 44292
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (0C to 100C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (0C to 100C).svg
index 7b2c1341bbb0b2401b7820b50f450f8cc68d3f6e..0bd3b4f606f2a60458b46184a62b0b0c99c33eea 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (0C to 100C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Steampunk/Thermometer (0C to 100C).svg
@@ -1,3 +1,1100 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ad7ef7a3898c009ee71386256802fd5c84de2ca7195f7baa15f72aa489414a6a
-size 46288
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (-40C to 50C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (-40C to 50C).svg
index 53e800be26bd85ad7d50bacc3dd2a09ed18b4bd1..172c367167ba74f5517b866938e13f4a164dbeac 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (-40C to 50C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (-40C to 50C).svg
@@ -1,3 +1,700 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:dfd2225b5e047ff18d08608bd885854bfbe865fe0a0dd258c7b4ee1ea3999d9e
-size 28883
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (0C to 100C).svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (0C to 100C).svg
index b09cff1bd6443dad9e0be00d5410908928e796dc..7212b1fc87dbd150f70f07d61ad9e6feb2b43997 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (0C to 100C).svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Thermometer/Thermometer (0C to 100C).svg
@@ -1,3 +1,694 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7fb023657cd66dd9fe2d3006913b0a907b644eca5feb8eafee9e87cc8c8b5b27
-size 32579
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.js
index d53a4afd6c9f47db13277acca29e6e04c1d8621b..9627da8e70b57f8531688d14c1dab6fb60730c98 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.js
@@ -1,3 +1,104 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:68d862d6365260248b30c2d2e8bfbf1718eb52df196ef4cb6ea7d1a0af911b19
-size 2927
+
+
+function Throttle(root,config ) {
+ //var orient = root.firstElementChild;
+ var obj = this;
+ var knob = root.getElementsByClassName("knob")[0];
+ var track = root.getElementsByClassName("track")[0];
+
+ var bbox = track.getBBox();
+ var kbox = knob.getBBox();
+ var minPos = bbox.y+bbox.height;
+ var maxPos = bbox.y;
+
+ var value = parseInt(config.init);
+ var minValue = parseInt(config.min);
+ var maxValue = parseInt(config.max);
+ var orientation = parseInt(config.orientation);
+
+ var range = maxValue - minValue;
+
+ var mouseDownPos = 0;
+ var mouseDownValue = 0;
+
+ var updateTimer = setInterval(postValue, 1000/parseFloat(config.rate));
+ var updateValue = value;
+
+ setHotSpot(this, knob);
+
+ this.reconfigure = function (newInstance) {
+ if (newInstance) {
+ config.init = 0;
+ config.minValue = 0;
+ config.maxValue = 255;
+ }
+ this.setValue(config.init);
+
+ }
+
+ this.onmousedown = function (evt, element) {
+ var p = getEventPos(evt, track);
+ if (element == knob) {
+ // Clicked on the knob itself.
+ mouseDownPos = p.y;
+ mouseDownValue = value;
+ }
+
+ }
+
+
+ this.onmousemove = function(evt, element) {
+ if (element == knob) {
+ // Knob is dragged - compute the distance as an offset in scale/slider coords and then update the value:
+ var p = getEventPos(evt, track);
+ var dif = p.y - mouseDownPos;
+ this.setValue(mouseDownValue + dif / (maxPos-minPos) * range);
+
+
+ }
+ };
+
+ this.onmouseup = function(e) {
+
+
+ };
+
+ this.setValue = function(v) {
+ value = parseInt(v);
+ if (value < minValue)
+ value = minValue;
+ else if (value > maxValue)
+ value = maxValue;
+ knob.setAttribute("transform", "translate(0 " + sliderPos(value) + ")");
+
+ // valueText.textContent = value.toFixed(numDecimalPlaces);
+ }
+
+ this.getValue = function() {
+ return value;
+ }
+
+ function postValue () {
+ if (document.getElementById(obj.id) == null)
+ clearInterval(updateTimer);
+ else if (updateValue != value)
+ postState(obj.id, "value", value);
+ updateValue = value;
+ }
+
+ // Return the slider position in scale coordinates for a value v.
+ function sliderPos (v) {
+ return bbox.y + sliderOffset(v);
+ }
+
+ // Return the slider positional offset for a specified value v.
+ // This is returned as an offset from the centre position, since the control template
+ // is drawn with the knob at the centre position.
+ function sliderOffset (v) {
+ return minPos + (v - minValue) / (maxValue - minValue) * (maxPos - minPos);
+ }
+
+
+ return this;
+ }
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.xml
index b3a849e8df0e54bcd2c6dd2399fe63ccf695ad73..ee7c9e1aba4b667e3c5032d318c5077b7872a2de 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Control.xml
@@ -1,3 +1,30 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fe9aae60c7d83a68cde00795257bb317aee86ea77a2a61f283da0192c3918d16
-size 1142
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Throttle.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Throttle.svg
index 6f7e9ff6d5319b3999c06da615c4a6cc17a58479..0fa98208c8cb4f9de792ecaa328039a18f58bdba 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Throttle.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Throttle/Throttle.svg
@@ -1,3 +1,362 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:93a11f8af89b4e0cf52800a1545e3040b32447dff1a5502d0dc31cb808f0fa19
-size 13430
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.js
index cae62b0cf1c7eec69668dd548221c7020cb8a625..3fca6a3159d89b123b0af1c908d6a4b854cf57b7 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.js
@@ -1,3 +1,171 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:10efad9f0db96b23d3f0096d154d72d4952af12091422ce68952940af11f0436
-size 6046
+
+function Timer(root, config) {
+
+ var obj = this
+
+ var bounds = root.getElementsByClassName('bounds')[0];
+ var hands = root.getElementsByClassName('hand');
+ var digits = root.getElementsByClassName('digit');
+ var alarm = root.getElementsByClassName('alarm')[0];
+ var label = root.getElementsByClassName('label')[0];
+ var segments = root.getElementsByClassName('segments')[0];
+
+ var hour = 0, minute = 0, second = 0;
+ var enableAlarm = parseInt(config.enableAlarm);
+
+ this.reconfigure = function (newInstance) {
+
+ if (newInstance) {
+ config.segColour = segments.style.fill;
+ config.label = label.textContent;
+ }
+
+ alarm.style.opacity = enableAlarm ? 1.0 : 0.1;
+ segments.style.fill = config.segColour;
+ label.textContent = config.label;
+
+ if (parseInt(config.dir) > 0)
+ hour = minute = second = 0;
+ else {
+ hour = parseInt(config.periodHour);
+ minute = parseInt(config.periodMin);
+ second = parseInt(config.periodSec);
+ }
+
+ updateGraphics()
+ }
+
+ this.sync = function (h, m, s, a) {
+ hour = h, minute = m, second = s;
+ alarm.style.opacity = a ? 1.0 : 0.1;
+ updateGraphics()
+ }
+
+ this.trigger = function () {
+ var blink=setInterval(function() { alarm.style.opacity = 0.1; setTimeout(function() { alarm.style.opacity=1.0; }, 500); }, 1000);
+ setTimeout(function() { alarm.style.opacity=0.1; clearInterval(blink)}, 5000);
+ playAlarm();
+ }
+
+ function updateGraphics() {
+ if (hands.length > 0) {
+ var cx = bounds.getBBox().width/2 + bounds.getBBox().x;
+ var cy = bounds.getBBox().height/2 + bounds.getBBox().y;
+ var hourHand = hands[0];
+ var minuteHand = hands[1];
+ var secondHand = hands[2];
+ secondHand.setAttribute("transform", "rotate(" + second*6 + " " + cx + " " + cy + ")");
+ minuteHand.setAttribute("transform", "rotate(" + (minute+second/60)*6 + " " + cx + " " + cy + ")");
+ hourHand.setAttribute("transform", "rotate(" + (hour+minute/60)*6 + " " + cx + " " + cy + ")");
+ } else if (digits.length > 0) {
+ var seconds = second < 10?"0"+second.toString():second.toString();
+ var minutes = minute < 10?"0"+minute.toString():minute.toString();
+ var hours = hour < 10?"0"+hour.toString():hour.toString();
+
+ clearDigits();
+ setDigit(0,seconds[0]);
+ setDigit(1,seconds[1]);
+ setDigit(2,minutes[0]);
+ setDigit(3,minutes[1]);
+ setDigit(4,hours[0]);
+ setDigit(5,hours[1]);
+ }
+ }
+
+
+ function clearDigits(){
+ for (var i=0; i<=5; i++) {
+ for (var l=0; l<=6; l++) {
+ digits[i].getElementsByTagName("polygon")[l].style.opacity = 0.1;
+ digits[i].getElementsByTagName("polygon")[l].style.fill = config.segColour;
+ }
+ }
+ }
+
+ function setDigit(digit,value){
+ var segments = digits[digit].getElementsByTagName("polygon");
+
+ switch(value){
+ case "0":
+ segments[0].style.opacity = 1
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[3].style.opacity = 1
+ segments[4].style.opacity = 1
+ segments[5].style.opacity = 1
+ break;
+
+ case "1":
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ break;
+
+ case "2":
+ segments[0].style.opacity = 1
+ segments[1].style.opacity = 1
+ segments[3].style.opacity = 1
+ segments[4].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+
+ case "3":
+ segments[0].style.opacity = 1
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[3].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+
+ case "4":
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[5].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+
+ case "5":
+ segments[0].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[3].style.opacity = 1
+ segments[5].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+
+ case "6":
+ segments[0].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[3].style.opacity = 1
+ segments[4].style.opacity = 1
+ segments[5].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+
+ case "7":
+ segments[0].style.opacity = 1
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ break;
+
+ case "8":
+ segments[0].style.opacity = 1
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[3].style.opacity = 1
+ segments[4].style.opacity = 1
+ segments[5].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+
+ case "9":
+ segments[0].style.opacity = 1
+ segments[1].style.opacity = 1
+ segments[2].style.opacity = 1
+ segments[5].style.opacity = 1
+ segments[6].style.opacity = 1
+ break;
+ }
+
+
+ }
+}
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.xml
index f7797a8e96320e2a6e9e75d0e698012bf594d952..3a324f2ee86219833f1d8ae0862a1379dc8feddb 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Control.xml
@@ -1,3 +1,49 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:efe90c156cd28ec6cc5510ae2bad10d0bddb0f0974e5aaa6b6147e07b96589b8
-size 2308
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer A.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer A.svg
index 6846a0a687b8b158408901016ff80ef17f07cde5..61db0f8afc7313018c3c8c7dd09c40cc93ff67a0 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer A.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer A.svg
@@ -1,3 +1,383 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6758a120daf1fb3c7bf6885dc32aaff773f30683d610a78bf269a4c970932178
-size 23602
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer D.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer D.svg
index 56486e27dbd5a15266f43ea8f00d48895bbdab0d..a7df419870047a92ae28fb5cafbcc9507b659f0c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer D.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Generic/Timer D.svg
@@ -1,3 +1,277 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:929332c884e950191925093f79c772adebae681ef802c5b8303200b8f11adb5b
-size 13195
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetAnalogueTimer.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetAnalogueTimer.svg
index 33f0cfadcd433a0db044b5dc773215546f569826..d3111ccb6d2fe32f2e049b928ae5d3620d7bf737 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetAnalogueTimer.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetAnalogueTimer.svg
@@ -1,3 +1,1270 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d588a9d86912ab07b6131bd853048759134767d4d7934465df8bb63526d44da2
-size 33736
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetDigitalTimer.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetDigitalTimer.svg
index a8f3aa421d0b37ffc531b1b1f2d930e34d39c8ba..b33573ee5dbce01388cfadefc0c4b7609a8d6f94 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetDigitalTimer.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Metallic/MetDigitalTimer.svg
@@ -1,3 +1,977 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ec79266815c0086e07ccae6999ff9f95c3162a26c49def0f2a49079bed3b8634
-size 29228
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerA.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerA.svg
index 436cfd1520798042a52fa21e48daebf0c2e1a74d..c86e636bd5eb1786229e00547d41847b80bb68ca 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerA.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerA.svg
@@ -1,3 +1,509 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7c784cac32ce3d214088f02dbc00c473ab04c7cfe51e58c501cc38f1f16539f4
-size 16172
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerD.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerD.svg
index deafc58bdd395f3aacfaa712c5c5cb463a1a6c4d..fafaba0b40ebb424c4fd3d2a58658a576eb3ed0b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerD.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Modern/TimerD.svg
@@ -1,3 +1,408 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a2ba264dddf1cbfea9e37442c8db8f592e64863b560393f4ff1a0d5e18cc0af0
-size 16751
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer A.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer A.svg
index f0ab5ff788910c29410f113f8ab682bb8653bc90..039a9dbd9d7bc5a0139e87029f3480c75ace6da5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer A.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer A.svg
@@ -1,3 +1,518 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5592a07abad7ac26d036f79e9e6f92aaa9240b109b94d59e0dafa834aa5cabdc
-size 31884
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer D.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer D.svg
index d96660517bad31746405d4df8422f505cdb68c48..d25484ba2ab7b037737ab209876fdfda48702a9f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer D.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Retro/Timer D.svg
@@ -1,3 +1,519 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:73cb5bbfd3c5a6af6ae12f0fcfd1364adff75bf504f156951fe7dfc33fde0a29
-size 23949
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Analogtimer.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Analogtimer.svg
index 824a01f52620260f5084646b5186a85e84db5c6a..9ad39bf951a7c0ca55c5d107cd87318e4c669ba9 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Analogtimer.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Analogtimer.svg
@@ -1,3 +1,2142 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:56c3af1cbfad4475c543035a26ed4a61aaf4298c02f6de904d5a807de3630193
-size 66918
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Digitaltimer.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Digitaltimer.svg
index db510ae474326bff36cf64c025983a94324c9c23..7002e285d91ca7e25b0b3a0e11c8144f649a7224 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Digitaltimer.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/Timer/Steampunk/Digitaltimer.svg
@@ -1,3 +1,966 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1fa86d5f938b5e0fb4900b3ffda92520679cdd81a4adb7273cb7ea8db998f02f
-size 28999
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.js
index ff6e0899e8fbf77e510a4adc2e56bdde975dd1e1..c6d5f5cdf61b4b87567765b4832c86df7bef5228 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.js
@@ -1,3 +1,113 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:33c10e4a4eaed0bfae2027e132a36bcdb400dc915f481b66a7ae823e633b2b1e
-size 4137
+
+function ToggleSwitch (root, config) {
+ var obj = this;
+ var orient = root.firstElementChild;
+ var symbols = orient.getElementsByTagName("g");
+ var bounds = root.getElementsByClassName("bounds")[0];
+ var bbox = bounds.getBBox();
+ var label = root.getElementsByClassName("text")[0];
+ var label2 = root.getElementsByClassName("text2")[0];
+ var latched = false;
+ var pressed = false;
+ var labelPosition = null;
+ var orientation = parseInt(config.orientation);
+
+
+ setHotSpot(this, root);
+
+ // We use style.display to avoid conflicts with inkscape
+ symbols[0].removeAttribute('display');
+ symbols[1].removeAttribute('display');
+
+
+
+ this.reconfigure = function (newinstance) {
+ if (newinstance) {
+ config.labelFont = getFontStyle(label);
+ }
+
+ label.firstChild.nodeValue = config.labelText1;
+ label2.firstChild.nodeValue = config.labelText2;
+ setFontStyle(label, config.labelFont);
+ setFontStyle(label2, config.labelFont);
+
+ switch (orientation) {
+ case 0 : orient.setAttribute('transform', 'rotate(0)'); labelPosition = 1; break;
+ case 1 : orient.setAttribute('transform', 'rotate(90,'+ bbox.width/2 +','+ bbox.height/2 +')'); labelPosition = 2; break;
+ }
+
+
+
+ var x = null, y = null;
+ var h = label.getBBox().height * 0.6;
+ var s = parseInt(config.labelSpacing);
+ switch (parseInt(labelPosition)) {
+ case 1 : label.style.textAnchor = "middle"; x = bbox.width/2; y = -s; label.setAttribute('transform', 'rotate(0,'+ bbox.width/2 +','+ bbox.height/2 +')');
+ label2.style.textAnchor = "middle"; x2 = bbox.width/2; y2 = bbox.height+s + h; label2.setAttribute('transform', 'rotate(0,'+ bbox.width/2 +','+ bbox.height/2 +')'); break;
+ case 2 : label.style.textAnchor = "start"; x = (bbox.width*1.5)+s; y = bbox.height/2 + h/2; label.setAttribute('transform', 'rotate(-90,'+ bbox.width/2 +','+ bbox.height/2 +')');
+ label2.style.textAnchor = "end"; x2 = (bbox.width*(-0.5))-s; y2 = bbox.height/2 + h/2; label2.setAttribute('transform', 'rotate(-90,'+ bbox.width/2 +','+ bbox.height/2 +')'); break;
+ }
+
+ if (x != null && y != null) {
+ label.setAttribute('x', x);
+ label.setAttribute('y', y);
+ label.style.display = "inherit";
+ label2.setAttribute('x', x2);
+ label2.setAttribute('y', y2);
+ label2.style.display = "inherit";
+ } else {
+ label.style.display = "none";
+ }
+
+
+
+ symbols[0].removeAttribute('display');
+ symbols[1].removeAttribute('display');
+
+ this.setState(false, true);
+ };
+
+ this.onmousedown = function (evt) {
+ latched = pressed;
+ this.setState(!latched);
+ buttonClick();
+ };
+
+ this.onmousemove = function(evt) {
+ var p = getEventPos(evt, bounds);
+ var r = bbox;
+ var hit = p.x >= r.x && p.y >= r.y && p.x<=r.x+r.width && p.y<=r.y+r.height;
+
+ this.setState(hit ? !latched : latched);
+ };
+
+ this.onmouseup = function (evt) {
+ postState(obj.id, "state", pressed ? 1 : 0);
+ latched = pressed;
+ };
+
+
+ this.setState = function (down, force) {
+ if (down != pressed || force == true) {
+ display(down);
+ pressed = down;
+ }
+ }
+
+
+ function display (down) {
+ if (down) {
+ symbols[0].style.display = 'none';
+ symbols[1].style.display = 'inline';
+ } else {
+ symbols[0].style.display = 'inline';
+ symbols[1].style.display = 'none';
+ }
+ }
+
+ return this;
+}
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.xml
index 609229eada3c205ecf4a9cc85b8554d9fb5c831b..ebf2cbf1158eaaaf332c4a1c07faad3ca8836f8c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Control.xml
@@ -1,3 +1,46 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2ad988e884ab1a690a0006c8ee60ee8f8992ea238d53be9005e220a28c804d07
-size 1667
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Flip Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Flip Switch.svg
index 962557bb6825da1de0ec400edcc3386cf9f48861..97df2a9b2d9cce712d3a691ffc4d45441228f71c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Flip Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Flip Switch.svg
@@ -1,3 +1,339 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7924b655b0b197e1f91642fa83ca5d4ac45805487fa961119825377a56f48094
-size 10730
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Light Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Light Switch.svg
index 9f18dab6fef5d2013fe957170ad69ab0a41193d7..9020da2578f7d102f156cc2774e7d9487689a1cc 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Light Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Light Switch.svg
@@ -1,3 +1,493 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c1e75a040c8ab3f9be0a06fb8213e95537e397b4153203cda0f1ff8ac589b3dc
-size 15820
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch1.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch1.svg
index 15e6c83e4ebe11c5eb2400a98d219360f9df7d00..2db328c303f5635215604e1b3266d68fd40918a5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch1.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch1.svg
@@ -1,3 +1,944 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:92ba0b1e356bd451b9af3bcc0494387f0ea1b81a8c28dd09188d13201ccb46a9
-size 43486
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch2.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch2.svg
index f1499b5d2a6ddc297d0d13c795971cd6ff6965de..196ae8c612809358ef0cb4708cd290129d529982 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch2.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch2.svg
@@ -1,3 +1,3128 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:430037ddfd11b5a8be7be4cbd4ca27d892f3445cec3438aeb55e6fffe4d22c17
-size 81796
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch3.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch3.svg
index bfdefacd5645330507d2ce5fa2395aa4ccb2931d..0fcd86475f1d1172da0b0a27c6b487f39a31c95c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch3.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch3.svg
@@ -1,3 +1,938 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ebbd3a531fa3e3016068ee6a530baf12cc4c2940eb8e9365f87b1cbfdee047ae
-size 26031
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch4.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch4.svg
index 7dd2a3038ffc0f68bdd19caec8232e215da440e9..addb241e6d2652fcf7abd099778e47c4524ad2ae 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch4.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Metallic/ToggleSwitch4.svg
@@ -1,3 +1,848 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4e9781dc6d12b77f05ce6222f33791b23205f595c309ff7265159d38e62a4a77
-size 23678
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Flick Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Flick Switch.svg
index eff90caae5e8082bf7ca9e538b1cfa495731e368..d48f8819c646f70dba4c1acaef4831b2a9256a4e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Flick Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Flick Switch.svg
@@ -1,3 +1,81 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b752d2a56f15f1a0a873525a2279b0a6a779877f6615250b9f4bf19da21065d0
-size 6282
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Slide Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Slide Switch.svg
index 4e8e409660c2f3109f10364641326d6d1c55e7fd..25ec2ac741bb73bfb555cd8fb70202121b32b7c5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Slide Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Slide Switch.svg
@@ -1,3 +1,177 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:715278e21d5e517df9c5c0d94e1839a56d56b0cc3fac2b8221be8a83e6034401
-size 6002
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/TickBox.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/TickBox.svg
index cbb9b8b715f5b98bdddcd79baef19dc4c808d93f..b9876fc758b2cc5530a87007384c519f4fd92716 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/TickBox.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/TickBox.svg
@@ -1,3 +1,56 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c176f111209fb4c95c727eea9329ca1af45692bdda470796bf1aea72d72f524a
-size 3515
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Toggle Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Toggle Switch.svg
index 84e671cbff51b8190abfdcf87724e3f8b198b337..0bb76a68efa11cf1451db5c685f2676720c023f4 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Toggle Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Modern/Toggle Switch.svg
@@ -1,3 +1,67 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:054be15c4a9b662788b8296c622dc86b51d465c9ec6956c42f6a789cb978fff3
-size 4979
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Light Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Light Switch.svg
index 30455ff12f547182de244cf1f6fd79dca31dd752..4d6f1d33af1884ff6f66d72d5447dfd5441a526d 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Light Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Light Switch.svg
@@ -1,3 +1,603 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:12cff8b9b56ced51c078559eacb748917e835905cd8c378323a1afc4da6917af
-size 19363
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Switch.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Switch.svg
index 53581ba92a7482dbe6c967c9a851234fd9df14da..fd2d4f077752da2434e398f851f4acc449e605e5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Switch.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Retro/Retro Switch.svg
@@ -1,3 +1,653 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:61d8bdc0b28ecbef24e107b63edda2261cb98e185798c1b75a75705474391dc7
-size 24035
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch1.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch1.svg
index fd5e5266021cc14fc30d2f7695f228384b71edd4..d797c5986f8abe392f4d5d6b3184cb870944fad9 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch1.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch1.svg
@@ -1,3 +1,705 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:eaa4e7cb1abdfa72674e395ab4089a613c8484ca4442b617188903c851364be3
-size 19397
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch2.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch2.svg
index 0c4dc2ea0634e3d0af6ea4753daaba6cad1d7e32..93e360137f9b912ee03284f1dc46e8573515b622 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch2.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch2.svg
@@ -1,3 +1,167 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a7fc61eb644a61388236ac000417971dda345318154df43afd3843d54f927cc6
-size 16581
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch3.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch3.svg
index d8991a2f100e5fb75ed22b2854c1a657084e1a2a..9907a158445bf8ab84e5d434d48c2d07616d4ad1 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch3.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch3.svg
@@ -1,3 +1,1109 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:28196d2f82b93095b8fb5703c13e884b28326f0b3ab75f77351f99f70a133e5a
-size 34932
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch4.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch4.svg
index e7dcc5a9bc871ac579e68367f55ee8bb95b339ff..75c319da02335524d23700871d836eb01076b720 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch4.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/ToggleSwitch/Steampunk/ToggleSwitch4.svg
@@ -1,3 +1,167 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6599e56fc6f1b9603f9fbc3d4858c31e11ecb4f8784fc5916885fd41c9c0042d
-size 32506
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.js
index dabeb8c39fdf5937e3aec7570f71fd73e470c822..8619d74bbdaa6510f282dd969e6a1927f8a7589a 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.js
@@ -1,3 +1,30 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d5887e369f0e2e8244b25e5ae585f98d5ee6861646b1ab9f8eaee1e5741c9c1d
-size 1212
+function TrafficLights (root, config) {
+ var lamps = root.getElementsByTagName("ellipse");
+ var red = lamps[0];
+ var amber = lamps[1];
+ var green = lamps[2];
+
+ this.reconfigure = function (newinstance) {
+ if (newinstance) {
+ config.red.off = red.style.fill;
+ config.amber.off = amber.style.fill;
+ config.green.off = green.style.fill;
+ }
+ red.style.fill = config.red.off;
+ amber.style.fill = config.amber.off;
+ green.style.fill = config.green.off;
+ red.style.fillOpacity = 1.0;
+ amber.style.fillOpacity = 1.0;
+ green.style.fillOpacity = 1.0;
+ }
+
+ this.setRed = function (s) { red.style.fill = s ? config.red.on : config.red.off; }
+ this.setAmber = function (s) { amber.style.fill = s ? config.amber.on : config.amber.off; }
+ this.setGreen = function (s) { green.style.fill = s ? config.green.on : config.green.off; }
+
+ this.setState = function (s) {
+ red.style.fill = (s & 1) ? config.red.on : config.red.off;
+ amber.style.fill = (s & 2) ? config.amber.on : config.amber.off;
+ green.style.fill = (s & 4) ? config.green.on : config.green.off;
+ }
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.xml
index a225c7775d44a3edac2fb917e25d22b3ac9aa34b..ad7c34cb29ccb2812e595cd552230e8fd890369a 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Control.xml
@@ -1,3 +1,40 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ae0cdd2babe9e19c3702f9a5c0ae7a3c08d1f5ab20ccf6b363d537264d9ad3aa
-size 1792
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Virtual Traffic Lights.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Virtual Traffic Lights.svg
index d6bf90eebaa55716ea9f9ec83d0a8c6e848f4cf2..b0d924e7e85f893eebd3d8c1ade65caedcfe4736 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Virtual Traffic Lights.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/TrafficLights/Virtual Traffic Lights.svg
@@ -1,3 +1,118 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:baa801fd9c77d405779c96da5f9217a422e9fb2c78924ae7edcbb9c0fa517b6c
-size 3774
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.js b/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.js
index d704e31494d23eb1405c0df6889007e65fc1e383..a111a7c1957ab7afd3509b4a738b7e23204990e8 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.js
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.js
@@ -1,3 +1,226 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5e2aa52297b020382a66a97526d843912bd5d8a224dd9dd5d5238b7641a22166
-size 8419
+require('moment.js');
+
+function WindRose (root, config) {
+ var petalLayer = root.getElementsByClassName('petals')[0];
+ var ringLayer = root.getElementsByClassName('rings')[0];
+ var center = root.getElementsByClassName('center')[0];
+
+ // N.B. these are 'live' collections and will update automatically.
+ var petals = root.getElementsByClassName('petal');
+ var rings = root.getElementsByClassName('ring');
+ var background = root.getElementsByClassName('background')[0];
+
+ // This is the data set, currently excluding the 'calm' region.
+ var timeRange = parseInt(config.timeRange.range);
+ var timeUnits = ["minute", "hour", "day", "month"];
+ var timeUnit = timeUnits[parseInt(config.timeRange.unit)];
+ var rawdata = [];
+ var data = []
+ var calm = 1;
+
+ this.reconfigure = function (newInstance) {
+ if (newInstance) {
+ createPetals();
+ createRings();
+ updateData();
+
+ root.getElementsByClassName('fake')[0].style.display = 'none';
+ setFontConfig();
+ }
+
+ setFonts();
+ setColours();
+ }
+
+ this.loadData = function () {
+ requestFile(config.filename, function(text) {
+ rawdata = text.split('\n');
+ updateData();
+ });
+ }
+
+ this.setTimeRange = function (unit, range) {
+ timeRange = range;
+ timeUnit = timeUnits[unit];
+ updateData();
+ }
+
+ function setFontConfig () {
+ config.directionFont = getFontStyle(root.getElementsByClassName('direction')[0]);
+ config.percentageFont = getFontStyle(root.getElementsByClassName('ringText')[0]);
+ config.keyFont = getFontStyle(root.getElementsByClassName("keyText")[0]);
+ }
+
+ function setFonts () {
+ var keyTexts = root.getElementsByClassName("keyText");
+ var keyTextPercentages = root.getElementsByClassName("keyTextPercentage");
+ for (var c=0; c<=7; c++) {
+ setFontStyle(root.getElementsByClassName('direction')[c],config.directionFont);
+ }
+ for (var c=0; c<=3; c++) {
+ setFontStyle(root.getElementsByClassName('ringText')[c],config.percentageFont);
+ }
+ for (var c=0; c<=5; c++) {
+ setFontStyle(keyTexts[c],config.keyFont);
+ setFontStyle(keyTextPercentages[c],config.keyFont)
+ }
+
+ keyTextPercentages[5].style.fill = config.calm.textColour;
+ keyTextPercentages[4].style.fill = config.band1.textColour;
+ keyTextPercentages[3].style.fill = config.band2.textColour;
+ keyTextPercentages[2].style.fill = config.band3.textColour;
+ keyTextPercentages[1].style.fill = config.band4.textColour;
+ keyTextPercentages[0].style.fill = config.band5.textColour;
+ }
+
+ function createPetals () {
+ var petalTemplate = root.getElementsByClassName('templates')[0];
+ for (var i=0; i<=79; i++) {
+ var newPetal = petalTemplate.cloneNode(true);
+ newPetal.setAttribute("class", "petal");
+ newPetal.setAttribute("pointer-events", "none");
+ newPetal.setAttribute("transform","scale(1,1) rotate(" + (22.5 * i) + ")");
+ petalLayer.appendChild(newPetal);
+ }
+ petalTemplate.style.display = 'none';
+ }
+
+ function createRings () {
+ var ringTemplate = root.getElementsByClassName('templates')[1];
+ for (var i=0; i<=3; i++) {
+ var newRing = ringTemplate.cloneNode(true);
+ newRing.setAttribute("class", "ring");
+ newRing.setAttribute("pointer-events", "none");
+ newRing.setAttribute("transform","scale(" + (i/4) + ")");
+ newRing.style.strokeWidth = (4/i)+"px";
+ ringLayer.appendChild(newRing);
+ }
+ ringTemplate.style.display = 'none';
+ }
+
+ function setColours() {
+ for (var i=0; i<=15; i++) {
+ petals[15-i].style.fill = config.band5.bandColour;
+ petals[31-i].style.fill = config.band4.bandColour;
+ petals[47-i].style.fill = config.band3.bandColour;
+ petals[63-i].style.fill = config.band2.bandColour;
+ petals[79-i].style.fill = config.band1.bandColour;
+ }
+ var keyText = root.getElementsByClassName('keyText');
+ var colourKey = root.getElementsByClassName('colourKey');
+
+ background.style.fill = config.backgroundColour;
+
+ center.style.fill = config.calm.bandColour
+
+ colourKey[0].style.fill = config.band5.bandColour;
+ colourKey[1].style.fill = config.band4.bandColour;
+ colourKey[2].style.fill = config.band3.bandColour;
+ colourKey[3].style.fill = config.band2.bandColour;
+ colourKey[4].style.fill = config.band1.bandColour;
+ colourKey[5].style.fill = config.calm.bandColour;
+
+ keyText[0].textContent = config.band5.label;
+ keyText[1].textContent = config.band4.label;
+ keyText[2].textContent = config.band3.label;
+ keyText[3].textContent = config.band2.label;
+ keyText[4].textContent = config.band1.label;
+ keyText[5].textContent = config.calm.label;
+ }
+
+ function updatePetals () {
+ for (var i=0; i<16; ++i) {
+ // Create an array of 5 values which are stacked, starting at calm and working outwards.
+ var values = [0, 0, 0, 0, 0];
+ if (data[i] != undefined) {
+ values[0] = parseFloat(data[i][0]) + calm;
+ for (var j=1; j<=4; j++)
+ values[j] = parseFloat(data[i][j]) + values[j-1];
+ }
+
+ // Now scale the petals so that they extend to the values as set above.
+ for (var j=0; j<=4; j++) {
+ var t = petals[j*16+i].transform.baseVal.getItem(0);
+ var s = values[4-j]/getTotal();
+ t.setScale(s, s);
+ }
+ }
+ }
+
+ function updateData () {
+ var now = moment();
+ var tmax = moment(now);
+ var tmin = moment(now).subtract(timeRange, timeUnit);
+ calm = 0;
+ data = [];
+ for (var d=0; d<16; ++d)
+ data[d] = [0, 0, 0, 0, 0];
+ for (var i=0; i= tmin && t <= tmax) {
+ calm += parseInt(row[1]);
+ for (var d=0; d<16; ++d)
+ for (var b=0; b<5; ++b)
+ data[d][b] += parseInt(row[2+d*5+b]);
+ }
+ }
+ }
+ if (getTotal() == 0)
+ calm = 1;
+ updatePetals();
+ updateLabels();
+ rescale();
+ }
+
+
+ function updateLabels () {
+ var percentages = root.getElementsByClassName("keyTextPercentage");
+ for (var i=0; i<=4; i++) {
+ var value = 0;
+ for (var j=0; j<16; j++)
+ if (data[j] != undefined)
+ value += parseFloat(data[j][4-i]);
+ percentages[i].textContent = ((value/getTotal())*100).toFixed(1) + "%";
+ }
+ percentages[5].textContent = ((calm/getTotal())*100).toFixed(1) + "%";
+ }
+
+ function rescale () {
+
+ // Find the largest scale of any petal.
+ var largest = 0, scale;
+ for (var i=0; i<=15; i++){
+ scale = petals[i].transform.baseVal.getItem(0).matrix.a;
+ if (scale > largest)
+ largest = scale;
+ }
+
+ // Set the scaling for the calm region:
+ center.setAttribute("transform","scale(" + calm/getTotal()/largest + ")");
+
+ // Set the scaling for all petals:
+ petalLayer.setAttribute("transform","scale("+((1/largest))+")");
+
+ // Update the key
+ var labels = root.getElementsByClassName('ringText');
+ labels[0].textContent = Math.round(100*largest)+ "%";
+ labels[1].textContent = Math.round(100*largest*0.75) + "%";
+ labels[2].textContent = Math.round(100*largest*0.50)+ "%";
+ labels[3].textContent = Math.round(100*largest*0.25)+ "%";
+ }
+
+ function getTotal() {
+ var total = calm;
+ for (var i=0; i<=4; i++)
+ for (var j=0; j<16; j++)
+ if (data[j] != undefined)
+ total += data[j][i];
+ return total;
+ }
+
+ if (typeof(editor) != "object")
+ this.loadData();
+
+}
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.xml b/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.xml
index 764030ba4bdadbdc7fabb7164f660b4fd08461da..0e23eecfe581c76ceac0ed455f29b9f6b19f1979 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/Control.xml
@@ -1,3 +1,93 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:938a2c3636678de9270eeeb4de6ca17459317249e6342d88822a628d4d496ce4
-size 4502
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/WindRose.svg b/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/WindRose.svg
index 375792ee5d896b7de9cec2ab7359ad872fbd343e..03f7222e482c4a151b428a105a2ba4756f4abb56 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/WindRose.svg
+++ b/Proteus 8 Professional/DATA/VSM Studio/controls/WindRose/WindRose.svg
@@ -1,3 +1,1231 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:188d039c53dfe7f2a30dd926e30166bed3d6fdaeacd7ee52ff9f7f5e8a3685fe
-size 58707
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/AVR Butterfly/Debug/Debug.elf b/Proteus 8 Professional/DATA/VSM Studio/devboards/AVR Butterfly/Debug/Debug.elf
index 19d2c48a5fcfaf2650ad9e34ecad696c69dde7c3..2bb21ea58648ae13fbfed690ca94e8495bbb770c 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/AVR Butterfly/Debug/Debug.elf and b/Proteus 8 Professional/DATA/VSM Studio/devboards/AVR Butterfly/Debug/Debug.elf differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 168/Arduino 168.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 168/Arduino 168.pdsprj
index ab53265ddd276edb11e933c0a11b1eee38550c5b..02de5386967637874e7a8e36128121ece57528eb 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 168/Arduino 168.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 168/Arduino 168.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 328/Arduino 328.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 328/Arduino 328.pdsprj
index 9ac8fa27e00d24e11f3362a33055a68f193f02ee..26d76d40f4fc9112a3257af86e803898d173b87f 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 328/Arduino 328.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino 328/Arduino 328.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Mega 2560/Arduino Mega 2560.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Mega 2560/Arduino Mega 2560.pdsprj
index 901924c061cf61c540bb60b3cf7f842140cd0026..c8a4f59f260cb51f83b854bec62194cf90f443d7 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Mega 2560/Arduino Mega 2560.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Mega 2560/Arduino Mega 2560.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 2/Arduino Nano 2.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 2/Arduino Nano 2.pdsprj
index 74674e2fcf4e4bf6269086c69bb3927349ba763e..55d92515a70afc5a3b5c524ff26f9921dd96e61a 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 2/Arduino Nano 2.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 2/Arduino Nano 2.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 3/Arduino Nano 3.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 3/Arduino Nano 3.pdsprj
index f6f8329aac8c485c49088dc05b687bae86692623..08a2291a2876e4309b57e56d28a5bb8ee710cc9f 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 3/Arduino Nano 3.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/Arduino Nano 3/Arduino Nano 3.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/F1 Evaluation demo board/F1 Release.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/F1 Evaluation demo board/F1 Release.pdsprj
index 98bc1eee9df8b1efced814d3d3ca1191505ac3ff..1a7c54f56f5e4be5fe7b5843f150ab0f08cdf621 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/F1 Evaluation demo board/F1 Release.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/F1 Evaluation demo board/F1 Release.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/MCP6S2X PGA demo board/pga_demo.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/MCP6S2X PGA demo board/pga_demo.pdsprj
index d63d2d1354586014af11904d4a5ed9d786060db9..5234de7a92583df44c733cc1e4ef538a6f5b4d3f 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/MCP6S2X PGA demo board/pga_demo.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/MCP6S2X PGA demo board/pga_demo.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PIC18 Explorer with PIC18F8722/PIC18 Explorer Board.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PIC18 Explorer with PIC18F8722/PIC18 Explorer Board.pdsprj
index 8c04f8b117463e6f64fdc90cb4f14a38050cbc7d..1ea212166d0cbdd0c2c333e3d62c5f4052175285 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PIC18 Explorer with PIC18F8722/PIC18 Explorer Board.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PIC18 Explorer with PIC18F8722/PIC18 Explorer Board.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/16F917.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/16F917.pdsprj
index 81bc996207d7f95f6e3278132193e81cb286f4b1..77bd5637ffcb484b267aca484fa785f3797cb0d0 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/16F917.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/16F917.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/readme.txt b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/readme.txt
index 658c53f86af69f3461002d2a772cb37aa8cf3138..cfed5bce551a3e89ebaf674df6e883a42ccd6446 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/readme.txt
+++ b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC16F917/readme.txt
@@ -1,3 +1,24 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1a3a685e20300c79a3c0c38b0b8343f9945a7aea3819ac68d3469ae97da3a565
-size 1186
+PIC16F946/PIC16F917/PIC16F914 PIM DEMO FIRMWARE OPERATION
+The demo firmware is made up of four components, which are individually displayed on
+the LCD. The PIC microcontroller’s internal RC oscillator is used as the system clock
+source.
+
+1. Clock (F1)
+This mode uses the Timer1 module and a 32 kHz clock crystal. Once this mode
+is entered from the main menu, the Real-Time Clock will start counting from
+12:00:00. The S2 switch is used to increment minutes The clock keeps running
+continuously until the mode is exited by pressing either the S1 switch.
+
+2. Voltmeter (F2)
+This mode uses the A/D module to measure the voltage of the R44 pot through
+analog channel AN0, and displays a voltage between in millivolts from 0 - 3000mV on the
+LCD using the LCD module. Voltage is continually updated until the mode is
+exited by pressing the S1 switch.
+
+3. Thermometer (F3)
+This mode uses the A/D module to measure the voltage of the thermistor R11
+through analog channel AN1, and converts to temperature in Fahrenheit and
+displays the temperature on the LCD using the LCD module. Temperature is
+continually updated until the mode is exited by pressing the S1
+switch.
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/18F85J90.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/18F85J90.pdsprj
index c6a73e94366773de5073f571c1e2e19c2342e016..de972a5d5acce6dd920704d578af1bec03a4b767 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/18F85J90.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/18F85J90.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/ReadMe.txt b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/ReadMe.txt
index 42b6e52c6b56f07a69b887bf209c0e4cbecbadc8..c3d9125cc1fb44a77d79fe90620a1265f2da8114 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/ReadMe.txt
+++ b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM LCD with PIC18F85J90/ReadMe.txt
@@ -1,3 +1,39 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6269fe73225ab85b4b829529917ad037202211019cbd86f5592a94613af3cdd5
-size 1872
+The demo firmware is made up of four components, which are individually displayed on
+the LCD. The PIC microcontroller’s internal HF INT oscillator at 1 MHz is used as the system clock
+source.
+
+1. Voltmeter (F1)
+This mode uses the A/D module to measure the voltage of the R44 pot through
+analog channel AN0, and displays a voltage between 0.00V and 3.30V on the
+LCD using the LCD module. Voltage is continually updated until the mode is
+exited by pressing either the S1 or S2 switch.
+
+2. Thermometer (F2)
+This mode uses the A/D module to measure the voltage of the thermistor R11
+through analog channel AN1, and converts to temperature in Celsius and
+displays the temperature on the LCD using the LCD module. Temperature is
+continually updated until the mode is exited by pressing either the S1 or S2
+switch.
+
+3. Clock (F3)
+This mode uses the Timer1 module and a 32 kHz clock crystal. Once this mode
+is entered from the main menu, the Real-Time Clock will start counting from
+00:00:00. The S3 switch is used to increment minutes and the S4 switch is used
+to increment hours.The clock keeps running continuously until the mode is exited
+by pressing either the S1 or S2 switch.
+
+Press and hold S3, S4 to perform the increment operation.
+
+
+4. Charge Pump and Software Contrast (F4)
+This mode is available only for the PIC18F85J90 family of devices and uses the
+on-board charge pump and LCD voltage regulator. The LCD module is configured
+in charge pump mode and software contrast is achieved by either pressing
+S3 to increase the contrast or S4 to decrease the contrast until the mode is exited
+by pressing either the S1 or S2 switch. By exiting this mode, the Voltmeter mode
+is entered and retains the selected contrast.
+
+Note:-
+
+1. Use MPLAB 7.52 or later.
+2. After programming with ICD2, remove the RJ11 cable for the demo to execute.
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC16F690/PICDEM MC demo.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC16F690/PICDEM MC demo.pdsprj
index 859c81ee2c21e276274679c4ad7a1bb2d2b8e824..546f4db563895ef38d007a50ad91a8028c39b409 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC16F690/PICDEM MC demo.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC16F690/PICDEM MC demo.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC18F4431/PICDEM_MC.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC18F4431/PICDEM_MC.pdsprj
index c14f491d3856e32301a9b664a0800e87ce39d1cd..19f037a3455d4815ed9c55856569e4e79f02ad93 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC18F4431/PICDEM_MC.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM MC with PIC18F4431/PICDEM_MC.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC16F877/PICDEM2+ with PIC16F877.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC16F877/PICDEM2+ with PIC16F877.pdsprj
index 8f49babba7c3c8bd9613e8c7f77e31884b8f1104..be562986dff8d49bbf6610e60f9b7173392ac494 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC16F877/PICDEM2+ with PIC16F877.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC16F877/PICDEM2+ with PIC16F877.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC18F452/PICDEM2+ with PIC18F452.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC18F452/PICDEM2+ with PIC18F452.pdsprj
index 56ab21a0d07d33313765d4d8c0ad93fbe2ca094a..54538739b65de58b0f19d6c8d2bb21f1d5dff2a1 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC18F452/PICDEM2+ with PIC18F452.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/PICDEM2+ with PIC18F452/PICDEM2+ with PIC18F452.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/Debug/Debug.elf b/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/Debug/Debug.elf
index 33dd73029ca891d9126f26b73f91adb47ef99058..ca8b217599a3def6d3a6fc86767addde12a4f408 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/Debug/Debug.elf and b/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/Debug/Debug.elf differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/stk500_mega328p_lcd.pdsprj b/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/stk500_mega328p_lcd.pdsprj
index 01faab9d64f03d351fb4694f54b9bddbac7cb872..fb8abf8a39e81da1d8b45022e6bd3d964626db90 100644
Binary files a/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/stk500_mega328p_lcd.pdsprj and b/Proteus 8 Professional/DATA/VSM Studio/devboards/STK500 with MEGA328 and LCD/stk500_mega328p_lcd.pdsprj differ
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.cpp
index 58abaf3e124abbc52590b95142046c81ab9ec36e..e23bb2866f11a7bfe721da5f6335e33190ee828c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.cpp
@@ -1,3 +1,315 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:571c7fe1adf98833c7da94bc200641e27a7a5cb7cf3021d7fabaa7a8d779964f
-size 15915
+/*==============================================================================================================*
+ ADS1110
+*===============================================================================================================*
+
+ @file ADS1110.h
+ @author Nadav Matalon
+ @license MIT (c) 2016 Nadav Matalon
+
+ ADS1110 Driver (16-BIT Single Channel ADC with PGA and I2C Interface)
+
+ Ver. 1.0.0 - First release (28.3.16)
+ Ver. 1.1.0 - Major code refactoring (10.10.16)
+ Ver. 1.2.0 - Added namespaces to prevent conflicts with other libraries (15.10.16)
+ Ver. 1.3.0 - Switched from 'WSWire' library to 'Wire' library for I2C communications (24.10.16)
+
+*===============================================================================================================*
+ LICENSE
+*===============================================================================================================*
+
+ The MIT License (MIT)
+ Copyright (c) 2016 Nadav Matalon
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ documentation files (the "Software"), to deal in the Software without restriction, including without
+ limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial
+ portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*==============================================================================================================*/
+
+#if 1
+__asm volatile ("nop");
+#endif
+
+#include "ADS1110.h"
+
+/*==============================================================================================================*
+ CONSTRUCTOR
+ *==============================================================================================================*/
+
+ADS1110::ADS1110(byte devAddr) {
+ _devAddr = devAddr>>1;
+ _config = DEFAULT_CONFIG;
+ _vref = INT_REF;
+ _comBuffer = COM_SUCCESS;
+}
+
+/*==============================================================================================================*
+ DESTRUCTOR
+ *==============================================================================================================*/
+
+ADS1110::~ADS1110() {}
+
+/*==============================================================================================================*
+ PING (0 = SUCCESS / 1-7 = I2C ERROR CODE)
+ *==============================================================================================================*/
+
+// See explication of error codes in the README
+
+byte ADS1110::ping() {
+ Wire.beginTransmission(_devAddr);
+ return Wire.endTransmission();
+}
+
+/*==============================================================================================================*
+ GET GAIN (1 = GAIN x1 / 2 = GAIN x2 / 4 = GAIN x4 / 8 = GAIN x8)
+ *==============================================================================================================*/
+
+byte ADS1110::getGain() {
+ return (1 << (_config & GAIN_MASK));
+}
+
+/*==============================================================================================================*
+ GET SAMPLE RATE (15 = 15 SPS / 30 = 30 SPS / 60 = 60 SPS / 240 = 240 SPS)
+ *==============================================================================================================*/
+
+byte ADS1110::getSampleRate() {
+ switch (_config & SPS_MASK) {
+ case (SPS_15): return 15; break;
+ case (SPS_30): return 30; break;
+ case (SPS_60): return 60; break;
+ case (SPS_240): return 240; break;
+ }
+}
+
+/*==============================================================================================================*
+ GET CONVERSION MODE (0 = CONTINUOUS / 1 = SINGLE-SHOT)
+ *==============================================================================================================*/
+
+byte ADS1110::getConMode() {
+ return bitRead(_config, 4);
+}
+
+/*==============================================================================================================*
+ GET RESOLUTION (12 = 12-BIT / 14 = 14-BIT / 15 = 15-BIT / 16 = 16-BIT)
+ *==============================================================================================================*/
+
+byte ADS1110::getRes() {
+ switch (_config & SPS_MASK) {
+ case (SPS_15): return 16; break;
+ case (SPS_30): return 15; break;
+ case (SPS_60): return 14; break;
+ case (SPS_240): return 12; break;
+ }
+}
+
+/*==============================================================================================================*
+ GET VOLTAGE REFERENCE (0 = INTERNAL / 2048 = EXTERNAL)
+ *==============================================================================================================*/
+
+int ADS1110::getVref() {
+ return _vref;
+}
+
+/*==============================================================================================================*
+ SET GAIN
+ *==============================================================================================================*/
+
+void ADS1110::setGain(gain_t newGain) { // PARAMS: GAIN_1 / GAIN_2 / GAIN_4 / GAIN_8
+ setConfig((_config & ~GAIN_MASK) | (newGain & GAIN_MASK));
+}
+
+/*==============================================================================================================*
+ SET SAMPLE RATE (IN SAMPLES PER SECOND)
+ *==============================================================================================================*/
+
+void ADS1110::setSampleRate(sample_rate_t newRate) { // PARAMS: SPS_15 / SPS_30 / SPS_60 / SPS_240
+ setConfig((_config & ~SPS_MASK) | (newRate & SPS_MASK));
+}
+
+/*==============================================================================================================*
+ SET CONVERSION MODE
+ *==============================================================================================================*/
+
+void ADS1110::setConMode(con_mode_t newConMode) { // PARAMS: CONT / SINGLE
+ setConfig(newConMode ? bitSet(_config, 4) : bitClear(_config, 4));
+}
+
+/*==============================================================================================================*
+ SET RESOLUTION
+ *==============================================================================================================*/
+
+void ADS1110::setRes(res_t newRes) { // PARAMS: 12_BIT / 14_BIT / 15_BIT / 16_BIT
+ switch (newRes) {
+ case (RES_12): setConfig((_config & ~SPS_MASK) | (SPS_240 & SPS_MASK)); break;
+ case (RES_14): setConfig((_config & ~SPS_MASK) | (SPS_60 & SPS_MASK)); break;
+ case (RES_15): setConfig((_config & ~SPS_MASK) | (SPS_30 & SPS_MASK)); break;
+ case (RES_16): setConfig((_config & ~SPS_MASK) | (SPS_15 & SPS_MASK)); break;
+ }
+}
+
+/*==============================================================================================================*
+ SET VOLTAGE REFERENCE
+ *==============================================================================================================*/
+
+void ADS1110::setVref(vref_t newVref) { // PARAMS: INT_REF / EXT_REF
+ _vref = newVref;
+}
+
+/*==============================================================================================================*
+ RESET
+ *==============================================================================================================*/
+
+void ADS1110::reset() {
+ setConfig(DEFAULT_CONFIG);
+ _vref = INT_REF;
+}
+
+/*==============================================================================================================*
+ GET DATA FROM DEVICE
+ *==============================================================================================================*/
+
+int ADS1110::getData() {
+ byte devConfig;
+ int devData;
+ byte attemptCount = 0;
+ if (bitRead(_config, 4)) { // if device is in 'SINGLE-SHOT' mode...
+ initCall(_config | START_CONVERSION); // add start conversion command to config byte
+ endCall(); // issue start conversion command
+ delay(MIN_CON_TIME * findMinCode(_config & SPS_MASK)); // wait for conversion to complete
+ }
+ while (attemptCount < MAX_NUM_ATTEMPTS) { // make up to 3 attempts to get new data
+ Wire.requestFrom(_devAddr, NUM_BYTES); // request 3 bytes from device
+ if (Wire.available() == NUM_BYTES) { // if 3 bytes were recieved...
+ devData = Wire.read() << 8 | Wire.read(); // read data register
+ devConfig = Wire.read(); // read config register
+ if (bitRead(devConfig, 7)) { // check if new data available...
+ delay(MIN_CON_TIME); // if not available yet, wait a bit longer
+ attemptCount++; // increment attemps count
+ } else return devData; // if new data is available, return conversion result
+ } else { // if 3 bytes were not recieved...
+ emptyBuffer(); // empty I2C buffer
+ _comBuffer = ping(); // store I2C error code to find out what went wrong
+ attemptCount = MAX_NUM_ATTEMPTS; // exit while loop
+ }
+ }
+ return 0; // if operation unsuccessful, return 0
+}
+
+/*==============================================================================================================*
+ GET VOLTAGE (mV)
+ *==============================================================================================================*/
+
+ // Vin+ = (output_code / (my_min_code * GAIN)) + _Vreg
+ // Output_Code = raw data from device (int)
+ // my_min_code = 16 (15_SPS; 16-BIT) / 8 (30_SPS; 15-BIT) / 4 (60_SPS; 14-BIT) / 1 (240_SPS; 12-BIT)
+ // _Vref = Vin- (in mV, depends on whether Vin- is connected to GND or to a 2048mV reference source)
+ // Vin+ = 0 - 2048mV when Pin Vin- (=_Vref) is connected to GND
+ // Vin+ = 0 - 4096mV when Pin Vin- (=_Vref) is connected to an external 2.048V reference source
+
+int ADS1110::getVolt() {
+ byte gain = (1 << (_config & GAIN_MASK));
+ byte minCode = findMinCode(_config & SPS_MASK);
+ return ((float)getData() / (float)(minCode * gain) + _vref);
+}
+
+/*==============================================================================================================*
+ GET PERCENTAGE (0-100%)
+ *==============================================================================================================*/
+
+byte ADS1110::getPercent() {
+ int lowerLimit = (findMinCode(_config & SPS_MASK) << 11) * -1;
+ int upperLimit = (findMinCode(_config & SPS_MASK) << 11) - 1;
+ return round(mapf(getData(), lowerLimit, upperLimit, 0, 100));
+}
+
+/*==============================================================================================================*
+ GET COMMUNICATION RESULT
+ *==============================================================================================================*/
+
+byte ADS1110::getComResult() {
+ return _comBuffer;
+}
+
+/*==============================================================================================================*
+ GET CONFIGURATION SETTINGS (FROM DEVICE)
+ *==============================================================================================================*/
+
+byte ADS1110::getConfig() {
+ byte devConfig;
+ Wire.requestFrom(_devAddr, NUM_BYTES); // request 3 bytes from device
+ if (Wire.available() == NUM_BYTES) { // if 3 bytes were recieved...
+ for (byte i=2; i>0; i--) Wire.read(); // skip data register bytes
+ devConfig = Wire.read(); // store device config byte
+ } else { // if 3 bytes were not recieved...
+ emptyBuffer(); // empty I2C buffer
+ _comBuffer = ping(); // store I2C error code to find out what went wrong
+ }
+ return devConfig; // return device config byte
+}
+
+/*==============================================================================================================*
+ SET CONFIGURATION REGISTER
+ *==============================================================================================================*/
+
+void ADS1110::setConfig(byte newConfig) {
+ initCall(newConfig);
+ endCall();
+ if (_comBuffer == COM_SUCCESS) _config = newConfig;
+}
+
+/*==============================================================================================================*
+ FIND MINIMAL CODE (BASED ON SAMPLE RATE)
+ *==============================================================================================================*/
+
+byte ADS1110::findMinCode(sample_rate_t sampleRate) {
+ switch (sampleRate) {
+ case (SPS_15) : return MIN_CODE_15; break;
+ case (SPS_30) : return MIN_CODE_30; break;
+ case (SPS_60) : return MIN_CODE_60; break;
+ case (SPS_240): return MIN_CODE_240; break;
+ }
+}
+
+/*==============================================================================================================*
+ MAP FLOATING POINT HELPER FUNCTION (FOR PERCENT CALCULATION)
+ *==============================================================================================================*/
+
+double ADS1110::mapf(double val, double in_min, double in_max, double out_min, double out_max) {
+ return ((val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min);
+}
+
+/*==============================================================================================================*
+ INITIATE I2C COMMUNICATION
+ *==============================================================================================================*/
+
+void ADS1110::initCall(byte data) {
+ Wire.beginTransmission(_devAddr);
+ Wire.write(data);
+}
+
+/*==============================================================================================================*
+ END I2C COMMUNICATION
+ *==============================================================================================================*/
+
+void ADS1110::endCall() {
+ _comBuffer = Wire.endTransmission();
+}
+
+/*==============================================================================================================*
+ EMPTY I2C BUFFER
+ *==============================================================================================================*/
+
+void ADS1110::emptyBuffer() {
+ while (Wire.available()) Wire.read();
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.h
index 6d474e64ec1f32a69dc0cfc57a9daf317eaffdd0..e65b276ddf3be7072c1b25884b04c434af0e5bbd 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110.h
@@ -1,3 +1,230 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:46ccff38a0852c89beed231574dc5100b02880bdf482713cc3e443feba9d21cb
-size 10618
+/*==============================================================================================================*
+ ADS1110
+*===============================================================================================================*
+
+ @file ADS1110.h
+ @author Nadav Matalon
+ @license MIT (c) 2016 Nadav Matalon
+
+ ADS1110 Driver (16-BIT Single Channel ADC with PGA and I2C Interface)
+
+ Ver. 1.0.0 - First release (28.3.16)
+ Ver. 1.1.0 - Major code refactoring (10.10.16)
+ Ver. 1.2.0 - Added namespaces to prevent conflicts with other libraries (15.10.16)
+ Ver. 1.3.0 - Switched from 'WSWire' library to 'Wire' library for I2C communications (24.10.16)
+
+*===============================================================================================================*
+ INTRODUCTION
+*===============================================================================================================*
+
+ The ADS1110 is a 16-Bit Single-Channel Temperature Sensor with Hysteresis & Alert capabilities,
+ as well as a hardware I2C interface.
+
+ This library contains a complete driver for the ADS1110 offering full control over its Configuration
+ Settings, as well as the ability to recieve raw data, voltage readings (in mV, to avoid floating point
+ math) or percentage readings in either Single-Shot or Continuous mode.
+
+*===============================================================================================================*
+ I2C ADDRESSES
+*===============================================================================================================*
+
+ Each ADS1110 has 1 of 8 possible I2C addresses (factory hardwired & recognized by its specific
+ part number & top marking on the package itself):
+
+ PART DEVICE I2C ADDRESS PART
+ NUMBER BIN HEX DEC MARKING
+ --------- ------- ---- --- -------
+ ADS1110A0 1001000 0x48 72 ED0
+ ADS1110A1 1001001 0x49 73 ED1
+ ADS1110A2 1001010 0x4A 74 ED2
+ ADS1110A3 1001011 0x4B 75 ED3
+ ADS1110A4 1001100 0x4C 76 ED4
+ ADS1110A5 1001101 0x4D 77 ED5
+ ADS1110A6 1001110 0x4E 78 ED6
+ ADS1110A7 1001111 0x4F 79 ED7
+
+*===============================================================================================================*
+ POWER-UP DEFAULTS
+*===============================================================================================================*
+
+ // The ADS1110 Resets itself to the default configuration settings on each power-up
+
+ CONFIG BYTE: B10001100
+ GAIN: x1
+ SAMPLE RATE: 15 SPS
+ RESOLUTION: 16-BIT
+ CONVERSION MODE: CONTINUOUS
+
+*===============================================================================================================*
+ CONFIGURATION REGISTER
+*===============================================================================================================*
+
+ BITS 0 & 1: GAIN (PGA1 & PGA0)
+
+ GAIN_1 0x80 PGA 1 B00000000 (Default)
+ GAIN_2 0x81 PGA 2 B00000001
+ GAIN_4 0x82 PGA 4 B00000010
+ GAIN_8 0x83 PGA 8 B00000011
+
+ BITS 2 & 3: DATA RATE (DR1 & DR0)
+
+ SPS_15 0x8C 15 Samples per Second B00001100 (Default)
+ SPS_30 0x88 30 Samples per Second B00001000
+ SPS_60 0x84 60 Samples per Second B00000100
+ SPS_240 0x80 240 Samples per Second B00000000
+
+ BIT 4: CONVERSION MODE (SC)
+
+ CONT 0x80 Continuous Mode B10000000 (Default)
+ SINGLE 0x90 Single-Shot Mode B10010000
+
+ BITS 5 & 6: RESERVED
+
+ BIT 7 (READ): DATA STATUS (ST)
+
+ NEW_DATA 0x00 New data ready to be read B00000000
+ NO_DATA 0x80 No new data avialable yet B10000000 (Default)
+
+ BIT 7 (WRITE): START CONVERSION (DRDY)
+
+ SC 0x80 Start Conversion (Single-Shot Mode Only) B10000000
+
+*===============================================================================================================*
+ MINIMAL DATA VALUES (BASED ON SAMPLE RATE)
+*===============================================================================================================*
+
+ MIN_CODE_15 0x01 -1 * Minimum data value for 15 / 2048 (16-Bit)
+ MIN_CODE_30 0x04 -1 * Minimum data value for 30 / 2048 (15-Bit)
+ MIN_CODE_60 0x08 -1 * Minimum data value for 60 / 2048 (14-Bit)
+ MIN_CODE_240 0x10 -1 * Minimum data value for 240 / 2048 (12-Bit)
+
+*===============================================================================================================*
+ LICENSE
+*===============================================================================================================*
+
+ The MIT License (MIT)
+ Copyright (c) 2016 Nadav Matalon
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ documentation files (the "Software"), to deal in the Software without restriction, including without
+ limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial
+ portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*==============================================================================================================*/
+
+#if 1
+__asm volatile ("nop");
+#endif
+
+#ifndef ADS1110_h
+#define ADS1110_h
+
+#if !defined(ARDUINO_ARCH_AVR)
+ #error “The ADS1110 library only supports AVR processors.”
+#endif
+
+#include
+#include "Wire.h"
+#include "ADS1110_PString.h"
+
+namespace Ads1110 {
+
+ const byte DEFAULT_CONFIG = 12; // B00001100 (16-BIT, 15 SPS, GAIN x1, CONTINUOUS)
+ const byte DEFAULT_DATA = 0; // default value of Raw Data registers
+ const byte START_CONVERSION = 128; // B10000000 (employed in 'Single-Shot' Conversion Mode)
+ const byte COM_SUCCESS = 0; // I2C Communication Success (No Error)
+ const byte MIN_CON_TIME = 5; // minimum ADC Comversion time (in mS)
+ const byte NUM_BYTES = 3; // fixed number of bytes requested from the device
+ const int MAX_NUM_ATTEMPTS = 3; // number of attempts to get new data from device
+
+ typedef enum:byte {
+ GAIN_MASK = 0x03, // 3 - B00000011
+ GAIN_1 = 0x00, // 0 - B00000000 (Default)
+ GAIN_2 = 0x01, // 1 - B00000001
+ GAIN_4 = 0x02, // 2 - B00000010
+ GAIN_8 = 0x03 // 3 - B00000011
+ } gain_t;
+
+ typedef enum:byte {
+ SPS_MASK = 0x0C, // 12 - B00001100
+ SPS_15 = 0x0C, // 12 - B00001100 (Default)
+ SPS_30 = 0x08, // 8 - B00001000
+ SPS_60 = 0x04, // 4 - B00000100
+ SPS_240 = 0x00 // 0 - B00000000
+ } sample_rate_t;
+
+ typedef enum:byte {
+ CONT = 0x00, // B00000000 (Defualt)
+ SINGLE = 0x10 // B00010000
+ } con_mode_t;
+
+ typedef enum:byte {
+ MIN_CODE_240 = 0x01, // 1 - Minimal Data Value for 240_SPS / -2048 (12-BIT)
+ MIN_CODE_60 = 0x04, // 4 - Minimal Data Value for 60_SPS / -2048 (14-BIT)
+ MIN_CODE_30 = 0x08, // 8 - Minimal Data Value for 30_SPS / -2048 (15-BIT)
+ MIN_CODE_15 = 0x10 // 16 - Minimal Data Value for 15_SPS / -2048 (16-BIT) (Default)
+ } min_code_t;
+
+ typedef enum:byte {
+ RES_12, // 12-BIT Resolution
+ RES_14, // 14-BIT Resolution
+ RES_15, // 15-BIT Resolution
+ RES_16 // 16-BIT Resolution (Default)
+ } res_t;
+
+ typedef enum:int {
+ INT_REF = 0, // Inernal Reference: Pin Vin- is connected to GND (Default)
+ EXT_REF = 2048 // External Reference: Pin Vin- is connected to 2.048V source
+ } vref_t;
+
+ class ADS1110 {
+ public:
+ ADS1110(byte address);
+ ~ADS1110();
+ byte ping();
+ byte getGain();
+ byte getSampleRate();
+ byte getConMode();
+ byte getRes();
+ int getVref();
+ void setGain(gain_t newGain);
+ void setSampleRate(sample_rate_t newRate);
+ void setConMode(con_mode_t newConMode);
+ void setRes(res_t newRes);
+ void setVref(vref_t newVref);
+ void reset();
+ int getData();
+ int getVolt();
+ byte getPercent();
+ byte getComResult();
+ private:
+ byte _devAddr;
+ byte _config;
+ int _vref;
+ byte _comBuffer;
+ byte getConfig();
+ void setConfig(byte newConfig);
+ byte findMinCode(sample_rate_t sampleRate);
+ double mapf(double x, double in_min, double in_max, double out_min, double out_max);
+ void initCall(byte data);
+ void endCall();
+ void emptyBuffer();
+ friend ADS1110_PString ADS1110ComStr(const ADS1110&);
+ friend ADS1110_PString ADS1110InfoStr(const ADS1110&);
+ };
+
+}
+
+using namespace Ads1110;
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.cpp
index bfd9bf9304f3680542702cb8ab4a868b7261febb..7431212129b65739816cffc67019145a74cb4882 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.cpp
@@ -1,3 +1,44 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5c19833aa2aa350095f149383835dcad9bdd8d26ea6bb07d63de34e720aa1ebc
-size 929
+/*
+ADS1110_PString.cpp - Lightweight printable string class
+Original Code by: Mikal Hart (http://arduiniana.org/libraries/PString/)
+*/
+
+#if 1
+__asm volatile ("nop");
+#endif
+
+#include "ADS1110_PString.h"
+
+void ADS1110_PString::begin() {
+ _cur = _buf;
+ if (_size > 0)
+ _buf[0] = '\0';
+}
+
+#if defined(ARDUINO) && ARDUINO >= 100
+ size_t ADS1110_PString::write(uint8_t b)
+ #else
+ void ADS1110_PString::write(uint8_t b)
+#endif
+{
+ if (_cur + 1 < _buf + _size) {
+ *_cur++ = (char)b;
+ *_cur = '\0';
+ #if defined(ARDUINO) && ARDUINO >= 100
+ return 1;
+ #endif
+ }
+ #if defined(ARDUINO) && ARDUINO >= 100
+ return 0;
+ #endif
+}
+
+int ADS1110_PString::format(char *str, ...) {
+ va_list argptr;
+ va_start(argptr, str);
+ int ret = vsnprintf(_cur, _size - (_cur - _buf), str, argptr);
+ if (_size)
+ while (*_cur)
+ ++_cur;
+ return ret;
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.h
index 546fac5408bb69d3e6e01c386a15e331808bf5d1..9b078a8ceb0f09fcb80a0d1ddb1f819914a1d409 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ADS1110_PString.h
@@ -1,3 +1,86 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4b892b0ef3c7af17478ac5e6beae320e56f6ed1e0357c17f250374b6bf7cae54
-size 2440
+/*
+ADS1110_PString.h - Lightweight printable string class
+Original Code by: Mikal Hart (http://arduiniana.org/libraries/PString/)
+*/
+
+#if 1
+__asm volatile ("nop");
+#endif
+
+#ifndef ADS1110_PString_h
+#define ADS1110_PString_h
+
+#include "Print.h"
+#include
+#include
+#include
+#include
+
+class ADS1110_PString : public Print {
+ private:
+ char *_buf, *_cur;
+ size_t _size;
+ public:
+ #if defined(ARDUINO) && ARDUINO >= 100
+ virtual size_t write(uint8_t);
+ #else
+ virtual void write(uint8_t);
+ #endif
+
+ // Basic constructor requires a preallocated buffer
+ ADS1110_PString(char *buf, size_t size) : _buf(buf), _size(size) {
+ begin();
+ }
+
+ // templated constructors allow inline renderings of this type: ADS1110_PString(buf, size, myfloat[, modifier]);
+ template ADS1110_PString(char *buf, size_t size, T arg) : _buf(buf), _size(size) {
+ begin();
+ print(arg);
+ }
+
+ template ADS1110_PString(char *buf, size_t size, T arg, int modifier) : _buf(buf), _size(size) {
+ begin();
+ print(arg, modifier);
+ }
+
+ // returns the length of the current string, not counting the 0 terminator
+ inline const size_t length() {
+ return _cur - _buf;
+ }
+
+ // returns the capacity of the string
+ inline const size_t capacity() {
+ return _size;
+ }
+
+ // gives access to the internal string
+ inline operator const char *() {
+ return _buf;
+ }
+
+ // compare to another string
+ bool operator==(const char *str) {
+ return _size > 0 && !strcmp(_buf, str);
+ }
+
+ // call this to re-use an existing string
+ void begin();
+
+ // This function allows assignment to an arbitrary scalar value like str = myfloat;
+ template inline ADS1110_PString &operator =(T arg) {
+ begin();
+ print(arg);
+ return *this;
+ }
+
+ // Concatenation str += myfloat;
+ template inline ADS1110_PString &operator +=(T arg) {
+ print(arg);
+ return *this;
+ }
+
+ // Safe access to sprintf-like formatting, e.g. str.format("Hi, my name is %s and I'm %d years old", name, age);
+ int format(char *str, ...);
+};
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ads1110.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ads1110.xml
index 64d64356639a3286bce7c4a54d4a9040b1e7c881..0f918cd8d19d967e1f7c91cb4280fcb000991de3 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ads1110.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ADS1110/ads1110.xml
@@ -1,3 +1,85 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0d32332603f51af98d4b652ef7b71f27be49b6425556b8a2bf4f5f4a823f4654
-size 3359
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.cpp
index 737a8b3322fcb3b88423415632f1d427cdea5ca6..251044af8dfa496dc0b1f2a727b655ee0bb7d3e3 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.cpp
@@ -1,3 +1,23 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f85e9764c6aadf9b48cb6ad8fd43f829063928dc148521829945ef9a029b188f
-size 650
+#pragma once
+
+#include "AlphanumericLcd.h"
+
+AlphanumericLcd::AlphanumericLcd(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
+ : LiquidCrystal(rs,enable, d0, d1, d2, d3) { numrows=1, row=0; }
+
+void AlphanumericLcd::begin(uint8_t cols, uint8_t rows, uint8_t charsize)
+// Overload to capture the number of rows.
+ { LiquidCrystal::begin(cols,rows,charsize);
+ numrows = rows;
+ }
+
+size_t AlphanumericLcd::write(uint8_t c)
+// Overload this so that we can implement println.
+ { if (c == '\n')
+ setCursor(0, row+1);
+ else if (c != '\r')
+ LiquidCrystal::write(c);
+ return 1;
+ }
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.h
index 1d886ae7c42b46b8f88fa1782a331e60a4d3af68..40dbed61b9bd6bab31d3c8dd4242c87830bcc393 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.h
@@ -1,3 +1,23 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4445cc8630911167e80612f0dbdf866eaf6f64eb719d4758219754924211bae6
-size 836
+#pragma once
+
+#include
+#include
+
+class AlphanumericLcd : public LiquidCrystal
+ { public:
+ AlphanumericLcd(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
+ void begin(uint8_t cols, uint8_t rows, uint8_t charsize=LCD_5x8DOTS);
+ void clear() { LiquidCrystal::clear(); row = 0; }
+ void home() { LiquidCrystal::home(); row = 0; }
+ void setCursor(uint8_t c, uint8_t r) { LiquidCrystal::setCursor(c, row=r); }
+ PrintList &print() { return list.begin(false, this); }
+ PrintList &println() { return list.begin(true, this); }
+ void setPlaces(int p) { list.setPlaces(p); }
+ void setBase(int b) { list.setBase(b); }
+ private:
+ size_t write(uint8_t value);
+
+ private:
+ PrintList list;
+ uint8_t numrows, row;
+ };
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.xml
index 2c84fef272d39204a37c296ce42ecd22d13463ef..131c8d3f09c32525da5bdfe7d196fedc690352b0 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/AlphanumericLcd.xml
@@ -1,3 +1,50 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b78f8c5f044531c344405d8c777aea82a0eb928570742f49637514cfcc877a5f
-size 2371
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.h
index 5104e0ca12b57ce469fbe750cd0ebebfa613f86f..cd411b9b23dcfc110431aae96bbf871a914da30c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.h
@@ -1,3 +1,23 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7bac81c9c1aa62f78e6b297ae5af70f4d715a54e8e8a1364e122f4e85422cca0
-size 467
+#pragma once
+
+#include
+
+class LCDKeypad
+ { public:
+ LCDKeypad (){}
+ int readKey(){
+ adc_key_in = analogRead(0);
+ if (adc_key_in > 1000) return 0;
+ if (adc_key_in < 50) return 1;
+ if (adc_key_in < 250) return 2;
+ if (adc_key_in < 450) return 3;
+ if (adc_key_in < 650) return 4;
+ if (adc_key_in < 850) return 5;
+ return -1;
+
+ }
+
+ private:
+ int adc_key_in;
+
+};
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.xml
index 4b487f9ad70f200e9ab299281c95a68939c2d9a6..0336d59cf1bbe1c0e783ba43e24f5d25986a1476 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/AlphanumericLcd/Keys.xml
@@ -1,3 +1,8 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:12ca6f61c1731aa5ead23794ea95ad9ebc66361ffbd75c1d84c7b0c219cf1546
-size 343
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 16-channel PWM Servo Adafruit Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 16-channel PWM Servo Adafruit Shield.xml
index edb346cf07478311f0d66da6fb0951ca6ba6832e..91d1147b2af2f32379a59d7d2a707dec72421ce4 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 16-channel PWM Servo Adafruit Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 16-channel PWM Servo Adafruit Shield.xml
@@ -1,3 +1,28 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d524bf3a88741e828ff389ed384bb3d3bf176374a44559acd33e08102da36173
-size 1487
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 2 Channel Relay Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 2 Channel Relay Shield.xml
index 790b1bfe11326c324dd7624d37ce54ba135ef1b4..11d4bc9647a614f662ba85bcb79b9c9ff5ad4029 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 2 Channel Relay Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 2 Channel Relay Shield.xml
@@ -1,3 +1,14 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0ccb9907080ae164b8448d321fe43f14a0b68e619d405b0f889ef70b4d1b3fc6
-size 596
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 4 Channel Relay Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 4 Channel Relay Shield.xml
index 103b309864d7b9481c2add6e9f674559b497c08e..930e1ad470b9dcbb0c24302a87bceaa8b9a3bbb0 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 4 Channel Relay Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino 4 Channel Relay Shield.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:81c477bcfd4eb36b64315599b1c0f54f08d4babe0a0fcb16faa7601ac698eb43
-size 795
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ADS1110 16-bit ADC Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ADS1110 16-bit ADC Breakout Board.xml
index 633837ff719df6a73e6affbe1d265f3f6305fba5..889b38006be1a983e58a4c8b30dba0cfe49a4749 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ADS1110 16-bit ADC Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ADS1110 16-bit ADC Breakout Board.xml
@@ -1,3 +1,11 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bf51081cdca020fc982bbdec0b68ac3fa1b3de43a182b62f409edaaa0b44f1ef
-size 511
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Alphanumeric LCD Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Alphanumeric LCD Breakout Board.xml
index 5accd44db7fbe229b5a2e3129ecd5ff206248e5c..92192ed29aa992e49f1d7ffa45167d24cc36523e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Alphanumeric LCD Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Alphanumeric LCD Breakout Board.xml
@@ -1,3 +1,32 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b71ee6c7823de231b6ebafb31fcb2766602c2d5d84f39255abf025bf0a2d0b76
-size 1225
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BME280 Pressure Sensor Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BME280 Pressure Sensor Breakout Board.xml
index fec663605a3a3c8a456cc43e4358df9daf06f9e7..f2e66b250eba2c1c080883bcac69a24f56772504 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BME280 Pressure Sensor Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BME280 Pressure Sensor Breakout Board.xml
@@ -1,3 +1,17 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9b68bc1aa12b46405e4a3c8cdc63fec895b27edf8a4bd96fc3a3c9c697e3653e
-size 839
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BMP180 Pressure Sensor Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BMP180 Pressure Sensor Breakout Board.xml
index b5af89800e645f8805ef7b2d052e43d53cf5e1a1..5e2b6c847bfe75d74f19ee77ba702af3eed9f7d5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BMP180 Pressure Sensor Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino BMP180 Pressure Sensor Breakout Board.xml
@@ -1,3 +1,16 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:98dc62fdbfc5b84757b925ccd1ec70da8fdb9462b719d2aaa1168f17c2d6d4e4
-size 759
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Button Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Button Breakout Board.xml
index 553abdea3e86bf5f0e7dbdfb6ce0d87e34b59e29..e66590efb53095e1800a24963850e5722d7dbd5e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Button Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Button Breakout Board.xml
@@ -1,3 +1,19 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9e09d8916c80a0b46bcdf6feef341b63496a275a45ca6eaab067f1cd3c40cf4e
-size 668
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Buzzer Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Buzzer Breakout Board.xml
index b7a639fc9da9614a3a468cd44858d5110d62556e..36afea08e46fb0338e8335dd8df89add526c78fd 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Buzzer Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Buzzer Breakout Board.xml
@@ -1,3 +1,22 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7870c42dd52cd6dcc809841c9069d46bd45ef4d25a1118432b13159937a44c80
-size 851
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT11 Humidity Temperature Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT11 Humidity Temperature Breakout Board.xml
index 066f4645f4dfbe1025238d5f9c02541ea29c27c6..efaee8692ca73962f152de3bfa798dae9bc9850c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT11 Humidity Temperature Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT11 Humidity Temperature Breakout Board.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d3fadeac4e195fcec8c6ddc1c7e7f593b15553356f69d81e2bf554512cb790a4
-size 989
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT22 Humidity Temperature Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT22 Humidity Temperature Breakout Board.xml
index f8b1861f54ed908b27ab70c2175b98abd03e50c3..7847d79b55d24b50b3e7447118fb0efbdff29134 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT22 Humidity Temperature Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino DHT22 Humidity Temperature Breakout Board.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3a391c0a50a2758fb2647f0e49f6c46089b4b72fcc0707811a490e0282de46f7
-size 985
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Data Logger Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Data Logger Shield.xml
index 546b4d3a1816f54d078f06ef63f9622d54936bd0..fe437e38f0c46ce5c846ed224bb5a39d040ded4b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Data Logger Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Data Logger Shield.xml
@@ -1,3 +1,75 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0be13b9f39bb1bc0d27875bd1645ee54850e4d0ed228b5fdc5a267d6cca8a6be
-size 2416
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino FDC1004 Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino FDC1004 Breakout Board.xml
index fb4a6e5b7fc67261bbb7b789c21ea97c45cb825b..cfbeb0d08ef8435f878c06acc31fb95757b2ede9 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino FDC1004 Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino FDC1004 Breakout Board.xml
@@ -1,3 +1,10 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7dc36a1456155200d919c1cd0c7f13dbf3922d20aab411efed90ddd44dbb9f0c
-size 446
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino GPS Module Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino GPS Module Breakout Board.xml
index b915abf641736b2533263a919ce5b5a6c8e182a1..c976cddeade0960382f1e4e4ace2e5d39a315927 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino GPS Module Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino GPS Module Breakout Board.xml
@@ -1,3 +1,24 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b7637ebbd2cd47fbbd0e3942b16f127987aa10ec82a33bffea984a91bb322686
-size 784
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Generic Input Voltage.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Generic Input Voltage.xml
index dd914f8388e88cc9d91e7ce142c1495a6ffa9ffd..ac94ff0e3c02097c079398c3d7d37de820b8be75 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Generic Input Voltage.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Generic Input Voltage.xml
@@ -1,3 +1,39 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0723511253edcc6302be6e54c3588f4ef5ac6979135b7124251d0632fbf80a66
-size 1704
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HX711 for Load Cell Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HX711 for Load Cell Breakout Board.xml
index 87643200ed12712e455f72b0cbd788a70108264e..5137057daf41cc86ca990e2ff96ee0addecce120 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HX711 for Load Cell Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HX711 for Load Cell Breakout Board.xml
@@ -1,3 +1,15 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d1258846b5201cc5a55cb55929386005284fb1cf057cfc6742155442b9d59f70
-size 622
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HYT271 Precision Humidity Temperature Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HYT271 Precision Humidity Temperature Breakout Board.xml
index 07009661d820da6e71bcc550ad26d29b580d4071..6df14d99bae71794ee9923de38e55e4b6190439d 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HYT271 Precision Humidity Temperature Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino HYT271 Precision Humidity Temperature Breakout Board.xml
@@ -1,3 +1,17 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:4f9e69185cf163b0c9253592a0511544a1367700fd1e9572586a668ea26f50ad
-size 860
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Hall-Effect Current Sensor Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Hall-Effect Current Sensor Breakout Board.xml
index 0f413ef5774f56fc6586e338e8c2cf7fd3936c8c..a2022b278339489c3783bc13b22b27b7182589a5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Hall-Effect Current Sensor Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Hall-Effect Current Sensor Breakout Board.xml
@@ -1,3 +1,30 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1c2563653ce210ea33e32a252e0367229918b54fdb3e705d48e49f8db4f00d57
-size 1489
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ILI9341 TFT LCD Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ILI9341 TFT LCD Shield.xml
index 87bc9566bfd8e7c5fb0f2f518cf5da34022e5c7a..369549f775a18a8d0d43984b9bdf560066887f38 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ILI9341 TFT LCD Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ILI9341 TFT LCD Shield.xml
@@ -1,3 +1,41 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:18cd1549d10787aba876bc8ffc3f6aa06a42cb6979d7916ea48b937324d044e9
-size 1449
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Ina219 Current Sensor Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Ina219 Current Sensor Breakout Board.xml
index 3f38363ad02fa8910f6b1d15050ea4727f5c9ce0..852e9c8e2b85d47bbd2a890b1e84f1c95f8116f8 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Ina219 Current Sensor Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Ina219 Current Sensor Breakout Board.xml
@@ -1,3 +1,19 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:dd018f2224c00d3a1781c62d984063d40510ac483749e1d4d26f8b1449eab4d8
-size 896
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino K Type Thermocouple Amplifier Breakout board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino K Type Thermocouple Amplifier Breakout board.xml
index 8408619722c8eb66404a097a45211d71bdd3b9cc..2b6ee331ba0482be64ca5f023912af53e781d715 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino K Type Thermocouple Amplifier Breakout board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino K Type Thermocouple Amplifier Breakout board.xml
@@ -1,3 +1,31 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1ce50644b1d9822f1d998e26d1b037fddaef31f03ffa0ba5b752b4800dc79b3c
-size 1440
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Keyes remote.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Keyes remote.xml
index 7f2747e5d6cddd9d472a5b980c01bfe9c9f46ab6..a351eb8ec6da0fab5358f6a6216d51e290bbec4b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Keyes remote.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Keyes remote.xml
@@ -1,3 +1,14 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1be6be8d664251c5e59d5fc1c63a7d630cc75c67f01f184d339863fd8e272598
-size 549
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LCD Keypad Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LCD Keypad Shield.xml
index a0b2309060b07e5c793adc95a4e9048d3867717b..72370768e40ba13e8ed8970b0a80509f28a0a4f1 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LCD Keypad Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LCD Keypad Shield.xml
@@ -1,3 +1,37 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1bec1c1e78fc8d6938be5597941217fd8b9821187d2da17c1f3bf78e9e9f0dfe
-size 1372
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Blue Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Blue Breakout Board.xml
index 2374c5af3076ad099f02927d4daeac1b914266c7..c17bdb50f2e1258465152a65c0391b37f196bfaf 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Blue Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Blue Breakout Board.xml
@@ -1,3 +1,15 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5640015cb027d55785633e85e2b1fe5e52094ae90d44315cfc105a89b4a65968
-size 547
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Green Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Green Breakout Board.xml
index 2b259e1811a322b74b598a0b04048dcea513bfd8..24dd09816ad47f75b740ad36dd7c06851d9f1320 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Green Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Green Breakout Board.xml
@@ -1,3 +1,15 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e01eb8ab60b6ba6821c3bd9c9dc1256db74362b46858098aaf76198e51b02392
-size 548
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Red Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Red Breakout Board.xml
index bf47a4fa347db26972d9c4f5e6200ff44d1cc242..af656c590b12b95060c21310d748ce9ff0c365b2 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Red Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Red Breakout Board.xml
@@ -1,3 +1,15 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9d7087972967a8efe9b9a8d76d18b150de0227e7925453cacb56d59fefe5544d
-size 544
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Yellow Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Yellow Breakout Board.xml
index a26d304e64dcda51e367cc02957efed8c4b7461d..c7665f02cb9f45928c7b702a69e5839e9b7c5405 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Yellow Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino LED Yellow Breakout Board.xml
@@ -1,3 +1,15 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:60a061e5dc1e74c6f05112b3d1f381c399f962a7758ad07154ebb42727650ea6
-size 551
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Leonardo.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Leonardo.xml
index 3b32482e4862b4411d0cc7564f82bbe7767ec2c1..f3e0c9c7268ea8e9570702b72bc83f112228ea4b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Leonardo.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Leonardo.xml
@@ -1,3 +1,39 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c5f8795b5cfa3c492063bdb403839a173f4da6cf57420ad5fbc9fd351b8d43e6
-size 1586
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31856 THC to Digital Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31856 THC to Digital Breakout Board.xml
index 180209b058b03eb1223c8f9d5399702d46853384..cdc288c5afc86da74dbaeedb0fae1c5f5793d83f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31856 THC to Digital Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31856 THC to Digital Breakout Board.xml
@@ -1,3 +1,14 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:aecfe5c989155f0ce3c8d53cfb9edd1ae53047ea7866775be73681cb723e02c7
-size 598
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31865 RTD to Digital Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31865 RTD to Digital Breakout Board.xml
index 8584252ea60cdeb5f3474aa65db0851f84bbc8d7..4044672919d1da97b04901d3267d685d72c84144 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31865 RTD to Digital Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MAX31865 RTD to Digital Breakout Board.xml
@@ -1,3 +1,17 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:483e600e35c628bb9daa3fc3b3902d21b5e3d75ef3b1df54a513b7d6ed320af3
-size 750
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP23008 IO Expander Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP23008 IO Expander Breakout Board.xml
index 04c657fd11795913daf1f79d66511194ad96f03a..aaa826e1ebf4d94884b510581d29dd3914423337 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP23008 IO Expander Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP23008 IO Expander Breakout Board.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8ed465041e96126361d8114d17bc658da8e5c36e01d1cda0d4fc36e03cf47bdc
-size 1008
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP3208 12bit ADC Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP3208 12bit ADC Breakout Board.xml
index 2ed35ace59b612a5ce124eb261fe968189e5e957..91ec7ecad562e51d95f46276d147b2d2bf4093f2 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP3208 12bit ADC Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP3208 12bit ADC Breakout Board.xml
@@ -1,3 +1,14 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:816eaf1cc9790a8aad92d49cd747689ff4de2fc3b283077cdf62fa2d22b2cdca
-size 571
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP4921 12bit DAC Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP4921 12bit DAC Breakout Board.xml
index a61643e40c87b5d4786bede81766a6c37fc70661..9d10557a65966f465e26cb44973fa8117847f480 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP4921 12bit DAC Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MCP4921 12bit DAC Breakout Board.xml
@@ -1,3 +1,14 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d2df6caceeed7879de052ff4fcc1ab0f029ac1c522f5b8874b8d9cb380aca1a7
-size 607
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MPX4250AP Pressure Gauge Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MPX4250AP Pressure Gauge Breakout Board.xml
index c27ef59a300dcf7fa5dd6a422ab0909bdb3de37a..3af06dd357466831341b7789cd6ef2b373bbe112 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MPX4250AP Pressure Gauge Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino MPX4250AP Pressure Gauge Breakout Board.xml
@@ -1,3 +1,46 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:600644ac9fbd321aedbe1b55018c614136f0496fe3e2ffdb06ac70c919592a48
-size 1964
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Mega 2560.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Mega 2560.xml
index 4c674ad7a958b943965498c9bb813238ee115eba..b54164ecea355c332244ff00fc5eedbef4588609 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Mega 2560.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Mega 2560.xml
@@ -1,3 +1,59 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6937f7f6fa1bc708b45af5906a6064c4370405cfca0da0e5612a67400f668bba
-size 2455
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 motor party.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 motor party.xml
index cba0216f70530c69587340b5237ad80b7b341dd9..189aa2aca695c0de09fd22ccb76367141688f890 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 motor party.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 motor party.xml
@@ -1,3 +1,124 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8d8655596f1df9b9bafb92dbccba482a780382cc399ee07c910a2a15172335d0
-size 5549
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 2 Stepper motors.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 2 Stepper motors.xml
index 43049c33c04552a9032f9ca6bb428be281695d4d..faa29706c3165d76047009eda7b9332e90e7ba4d 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 2 Stepper motors.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 2 Stepper motors.xml
@@ -1,3 +1,102 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:711b5c113a1f515f193be3709fc0185df937e84db30aa910b993bde83d709504
-size 4639
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 4 DC motors.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 4 DC motors.xml
index b193828eb97e2034eb26ca6702b619c1761b1f50..17b8031c9c60c4c639af0622561869366a4cff59 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 4 DC motors.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield V2 with 4 DC motors.xml
@@ -1,3 +1,145 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b9211c1f92951048305e849c05b1023e45036b761d004e243d25f74eda114647
-size 6293
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with DC Motors.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with DC Motors.xml
index a4bafc12120298be3c87eac030313c2f36b4915a..bf284196dfc8e96ca0bf9bcec28d9b98329ea82f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with DC Motors.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with DC Motors.xml
@@ -1,3 +1,43 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:070a6ae7c80eaeeec18b8aa1b816943105b2a7a348dd23aba9b2d2218498ee5a
-size 1358
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with Stepper Motor.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with Stepper Motor.xml
index 41e210c8431cba0653fd11f1819a73348a028b93..6d225a5a8fe52d73fa2ca28f385c7c07e9cbf3f1 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with Stepper Motor.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Motor Shield with Stepper Motor.xml
@@ -1,3 +1,35 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:24ed47b56d218d72ca5bd550fc22d47bfc5022a158a0e8038cbe5607844f4668
-size 1200
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Nano.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Nano.xml
index 6edc617b75fea5a1a5bf405115ff91b7286364b5..0734ab1c921df7826632afd8e2c94f85c722244b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Nano.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Nano.xml
@@ -1,3 +1,34 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8944ee5f90fad6bbb00617a6602818829396da88a506f83dc5b87987ba2b38ac
-size 1335
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino NeoPixel Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino NeoPixel Shield.xml
index 19c795ce63ad1128cd01e12af94a69c151d85ab8..2ce0a717ce6affffedee2ced18a3f6e33df41b97 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino NeoPixel Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino NeoPixel Shield.xml
@@ -1,3 +1,68 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6aab72d49937f6bf5ab91beaf171ec1fea8dbf28297021504977cae280cbcd43
-size 3684
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino PCD8544 Nokia 3310 LCD Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino PCD8544 Nokia 3310 LCD Breakout Board.xml
index 8a8daa50b74e27049e6396eba002a9e65b052c0d..00ea4a146b30f4cb859f78b33190fcd788556153 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino PCD8544 Nokia 3310 LCD Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino PCD8544 Nokia 3310 LCD Breakout Board.xml
@@ -1,3 +1,132 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2c6d57236a985f5866053769bfa80cb417b2b9ee519dfe55b040603948b896d7
-size 7355
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Piezo Sounder Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Piezo Sounder Breakout Board.xml
index 2d384e0140039827dd5b62c6cb662bc7e2b28ed2..46084bd23b419cf498b3ff9a04e5b1eac83a351f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Piezo Sounder Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Piezo Sounder Breakout Board.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e625b250dc39bb57b1b9c791d285a1ebbbffc916f1a4eff2e4a1a9e85aaa1d75
-size 741
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Anode LED.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Anode LED.xml
index 6946db3ad9492775d768fe14e9257f72abfffdb0..07383747f6423477c029843903a05e05eed2e244 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Anode LED.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Anode LED.xml
@@ -1,3 +1,21 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:23c250029bfc17bc4bf01d92eae65c095886f40e334ad73b3180c0a39e58d15a
-size 769
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Cathode LED.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Cathode LED.xml
index b9fad64d595ceaea3ccbd8ddbb99dfc4b9f12570..2a72b97c400e841c52d04e3f08b82fae89fc1ee6 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Cathode LED.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino RGB Common Cathode LED.xml
@@ -1,3 +1,21 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9626fac2000dcb0575179dd953ed6616d4658a222ab2344872fc3229ea4b68c8
-size 773
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Real Time Clock Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Real Time Clock Breakout Board.xml
index afcd58139e969cadbb96cbcb6ceeeb86a24efa7f..9107a63fc1ee17594d69b918202f636130400cc3 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Real Time Clock Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Real Time Clock Breakout Board.xml
@@ -1,3 +1,19 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e86e786d3fcc1eb8e09c15d96a01af0ecb4814e4e19ef3c0d3bb9d7dc6467745
-size 751
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Rotary Angle Sensor Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Rotary Angle Sensor Breakout Board.xml
index 33f5c155689cb65e6d6ef0fa3529d0e8edffaa10..fb42382db9b53e25ebda9c88abfebd7d43da9758 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Rotary Angle Sensor Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Rotary Angle Sensor Breakout Board.xml
@@ -1,3 +1,33 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e9df7d3af6f4e5328f3a438347e6988f1302bf9c84a55109876815f0101179f6
-size 1446
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino SD Card Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino SD Card Breakout Board.xml
index 7203d33ae7c679cb9da2c3653084c3191c1836c5..f52a5d5d0a82b89f7505dd60dfcaace1beebf603 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino SD Card Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino SD Card Breakout Board.xml
@@ -1,3 +1,22 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9e5bbbcf118fbc353dbd8631b3c1ff0ebf0a314c477408aead3ef410df9cc0cc
-size 739
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ST7735R TFT LCD Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ST7735R TFT LCD Shield.xml
index 6ead5f908d1d6d078ff735c4e8145455a7df2dc2..75f53692d4fc85c677097d088515eef928e62499 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ST7735R TFT LCD Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino ST7735R TFT LCD Shield.xml
@@ -1,3 +1,45 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e7ac14297b2bdc0f74553e308beda9e019493558224b5df60a5646b3a55861e8
-size 1563
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Samsung remote.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Samsung remote.xml
index fbb62429a53f2b5222b828ddfab09f70ac877b9c..ffd3b70b3ed31dd82da4f9597a919dcc02f80d2e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Samsung remote.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Samsung remote.xml
@@ -1,3 +1,14 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:061840aa9ba5d552e9901ac9690ece5a733d162111f77e5e6480694e26bc606c
-size 553
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Servo Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Servo Breakout Board.xml
index 5c7689f241a88493ae954506980b47de7021fa9e..aba1115b0898383894e99e7777781dae61494340 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Servo Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Servo Breakout Board.xml
@@ -1,3 +1,38 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b35d6d43342f5f877c0a4c68f70cc74eda838f3a532a6d1da4a02f2b9b196f89
-size 1760
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Switch Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Switch Breakout Board.xml
index 66ce5fbe634ef67845e47cbfd6c23bd2e761c958..a4d77a27a6dae3c415f75ea4a296ecb9f42b665b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Switch Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Switch Breakout Board.xml
@@ -1,3 +1,19 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bbca7c0f78590221066841b9ef3347b603094a3258d02b5ef96b8f1a1dbcf299
-size 665
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Tc74 Breakout Board.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Tc74 Breakout Board.xml
index 5e949736d45733555be707b844f70de3733231f7..85655e585c7299b95e32221f0957a655a4af451d 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Tc74 Breakout Board.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Tc74 Breakout Board.xml
@@ -1,3 +1,36 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b6774026f807892692bd2e91f70fb8a69cc281cf6703983a588a943ef6310f88
-size 1375
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Trellis Adafruit Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Trellis Adafruit Shield.xml
index 1c80111bf09969eb409626b7c619ddbfd93918b9..705aa045f3d739988168099da0711768aa1c6f4a 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Trellis Adafruit Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Trellis Adafruit Shield.xml
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d38f2a4b779e6dd2d294e7e7175e05899a07ee810095187ec8653ba9e6c76a75
-size 953
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Turtle.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Turtle.xml
index 196fd68ee80d906a099f5e6dddc4fd2a4e0bb1b2..07e21b8fa7c84d092caa38fddcdb0c1d0c93625c 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Turtle.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Turtle.xml
@@ -1,3 +1,67 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ba0e6a5e5c0769419fb697a5a7589ca7adcf4a6c1ed4fc7c8ff0650d24925dd4
-size 2189
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Uno 328.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Uno 328.xml
index 1f7ccfc689d895dd5a766e0e2f0bccab4403bbff..1fe4c789de498a1e8ada2e41a98f096abcca854d 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Uno 328.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Uno 328.xml
@@ -1,3 +1,38 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:481ab12c9346847dc91a6b86779cb4f141aac1cd6ebb239e2ed0d876e178502f
-size 1571
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Wave Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Wave Shield.xml
index 1bab52b4b6365b729cba298804629c57787bc0cf..144db062fc317676e6f900fb9d59b6ed6e092f64 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Wave Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Wave Shield.xml
@@ -1,3 +1,84 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a35dbcab6e128904accd8d1ac85115c54fdc5bc9fa89514d766247ad6f00b0f5
-size 3557
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Weather Station Shield.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Weather Station Shield.xml
index 88dba6a6dbe494e2c79bb3c022d5b98dd22ba38c..78b44b2b6dc5dde8e0c4c8f7760fd5ac0370f360 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Weather Station Shield.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Weather Station Shield.xml
@@ -1,3 +1,80 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d301e7424d450786cfdd8dd39fd43bb5652ef3f2cbbb6d745f6af5a00d162120
-size 2862
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Yun.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Yun.xml
index a57e1cb951fda2e19b83ae6ff80a6cbe3edc2717..7b6431dd3bd434e25a97df404f42264b1b3e971f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Yun.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Yun.xml
@@ -1,3 +1,89 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a45044ba5307729717cd302ee2f8654649f83e05db5f8cd1516051890b9d9cce
-size 4294
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Zumo Robot.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Zumo Robot.xml
index 21266f169747a76349219d4b8edfe6bc9b15546b..752f728ce7b04838f43c1d477ceb8b6c3055a203 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Zumo Robot.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Arduino Zumo Robot.xml
@@ -1,3 +1,75 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2cf3915864037573d6aed6612b653188dd0b89552413ce7fe22093abf41f7552
-size 2291
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.cpp
index dc40eaefc279b94ed92754561e44037dde7b6f1d..708215c9ffb02e3c01805bc273391ba35c569088 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.cpp
@@ -1,3 +1,727 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e9fafcbfe74f3f1a1e6bbc0f78786bac8fab258bc1aea05a01384663e796ea5e
-size 23308
+/*!
+ * @file Adafruit_BME280.cpp
+ *
+ * @mainpage Adafruit BME280 humidity, temperature & pressure sensor
+ *
+ * @section intro_sec Introduction
+ *
+ * Driver for the BME280 humidity, temperature & pressure sensor
+ *
+ * These sensors use I2C or SPI to communicate, 2 or 4 pins are required
+ * to interface.
+ *
+ * Designed specifically to work with the Adafruit BME280 Breakout
+ * ----> http://www.adafruit.com/products/2652
+ *
+ * Adafruit invests time and resources providing this open source code,
+ * please support Adafruit and open-source hardware by purchasing
+ * products from Adafruit!
+ *
+ * @section author Author
+ *
+ * Written by Kevin "KTOWN" Townsend for Adafruit Industries.
+ *
+ * @section license License
+ *
+ * BSD license, all text here must be included in any redistribution.
+ * See the LICENSE file for details.
+ *
+ */
+
+#include "Adafruit_BME280.h"
+#include "Arduino.h"
+#include
+#include
+
+/*!
+ * @brief class constructor
+ */
+Adafruit_BME280::Adafruit_BME280() : _cs(-1), _mosi(-1), _miso(-1), _sck(-1) {}
+
+/*!
+ * @brief class constructor if using hardware SPI
+ * @param cspin the chip select pin to use
+ * @param *theSPI
+ * optional SPI object
+ */
+Adafruit_BME280::Adafruit_BME280(int8_t cspin, SPIClass *theSPI) {
+ _cs = cspin;
+ _mosi = _miso = _sck = -1;
+ _spi = theSPI;
+}
+
+/*!
+ * @brief class constructor if using software SPI
+ * @param cspin the chip select pin to use
+ * @param mosipin the MOSI pin to use
+ * @param misopin the MISO pin to use
+ * @param sckpin the SCK pin to use
+ */
+Adafruit_BME280::Adafruit_BME280(int8_t cspin, int8_t mosipin, int8_t misopin,
+ int8_t sckpin)
+ : _cs(cspin), _mosi(mosipin), _miso(misopin), _sck(sckpin) {}
+
+Adafruit_BME280::~Adafruit_BME280(void) {
+ if (temp_sensor) {
+ delete temp_sensor;
+ }
+ if (pressure_sensor) {
+ delete pressure_sensor;
+ }
+ if (humidity_sensor) {
+ delete humidity_sensor;
+ }
+}
+
+/*!
+ * @brief Initialise sensor with given parameters / settings
+ * @param addr the I2C address the device can be found on
+ * @param theWire the I2C object to use, defaults to &Wire
+ * @returns true on success, false otherwise
+ */
+bool Adafruit_BME280::begin(uint8_t addr, TwoWire *theWire) {
+ bool status = false;
+ _i2caddr = addr;
+ _wire = theWire;
+ status = init();
+
+ return status;
+}
+
+/*!
+ * @brief Initialise sensor with given parameters / settings
+ * @returns true on success, false otherwise
+ */
+bool Adafruit_BME280::init() {
+ // init I2C or SPI sensor interface
+ if (_cs == -1) {
+ // I2C
+ _wire->begin();
+ } else {
+ digitalWrite(_cs, HIGH);
+ pinMode(_cs, OUTPUT);
+ if (_sck == -1) {
+ // hardware SPI
+ _spi->begin();
+ } else {
+ // software SPI
+ pinMode(_sck, OUTPUT);
+ pinMode(_mosi, OUTPUT);
+ pinMode(_miso, INPUT);
+ }
+ }
+
+ // check if sensor, i.e. the chip ID is correct
+ _sensorID = read8(BME280_REGISTER_CHIPID);
+ if (_sensorID != 0x60)
+ return false;
+
+ // reset the device using soft-reset
+ // this makes sure the IIR is off, etc.
+ write8(BME280_REGISTER_SOFTRESET, 0xB6);
+
+ // wait for chip to wake up.
+ delay(10);
+
+ // if chip is still reading calibration, delay
+ while (isReadingCalibration())
+ delay(10);
+
+ readCoefficients(); // read trimming parameters, see DS 4.2.2
+
+ setSampling(); // use defaults
+
+ delay(100);
+
+ return true;
+}
+
+/*!
+ * @brief setup sensor with given parameters / settings
+ *
+ * This is simply a overload to the normal begin()-function, so SPI users
+ * don't get confused about the library requiring an address.
+ * @param mode the power mode to use for the sensor
+ * @param tempSampling the temp samping rate to use
+ * @param pressSampling the pressure sampling rate to use
+ * @param humSampling the humidity sampling rate to use
+ * @param filter the filter mode to use
+ * @param duration the standby duration to use
+ */
+void Adafruit_BME280::setSampling(sensor_mode mode,
+ sensor_sampling tempSampling,
+ sensor_sampling pressSampling,
+ sensor_sampling humSampling,
+ sensor_filter filter,
+ standby_duration duration) {
+ _measReg.mode = mode;
+ _measReg.osrs_t = tempSampling;
+ _measReg.osrs_p = pressSampling;
+
+ _humReg.osrs_h = humSampling;
+ _configReg.filter = filter;
+ _configReg.t_sb = duration;
+
+ // making sure sensor is in sleep mode before setting configuration
+ // as it otherwise may be ignored
+ write8(BME280_REGISTER_CONTROL, MODE_SLEEP);
+
+ // you must make sure to also set REGISTER_CONTROL after setting the
+ // CONTROLHUMID register, otherwise the values won't be applied (see
+ // DS 5.4.3)
+ write8(BME280_REGISTER_CONTROLHUMID, _humReg.get());
+ write8(BME280_REGISTER_CONFIG, _configReg.get());
+ write8(BME280_REGISTER_CONTROL, _measReg.get());
+}
+
+/*!
+ * @brief Encapsulate hardware and software SPI transfer into one
+ * function
+ * @param x the data byte to transfer
+ * @returns the data byte read from the device
+ */
+uint8_t Adafruit_BME280::spixfer(uint8_t x) {
+ // hardware SPI
+ if (_sck == -1)
+ return _spi->transfer(x);
+
+ // software SPI
+ uint8_t reply = 0;
+ for (int i = 7; i >= 0; i--) {
+ reply <<= 1;
+ digitalWrite(_sck, LOW);
+ digitalWrite(_mosi, x & (1 << i));
+ digitalWrite(_sck, HIGH);
+ if (digitalRead(_miso))
+ reply |= 1;
+ }
+ return reply;
+}
+
+/*!
+ * @brief Writes an 8 bit value over I2C or SPI
+ * @param reg the register address to write to
+ * @param value the value to write to the register
+ */
+void Adafruit_BME280::write8(byte reg, byte value) {
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->write((uint8_t)value);
+ _wire->endTransmission();
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg & ~0x80); // write, bit 7 low
+ spixfer(value);
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+}
+
+/*!
+ * @brief Reads an 8 bit value over I2C or SPI
+ * @param reg the register address to read from
+ * @returns the data byte read from the device
+ */
+uint8_t Adafruit_BME280::read8(byte reg) {
+ uint8_t value;
+
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->endTransmission();
+ _wire->requestFrom((uint8_t)_i2caddr, (byte)1);
+ value = _wire->read();
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg | 0x80); // read, bit 7 high
+ value = spixfer(0);
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+ return value;
+}
+
+/*!
+ * @brief Reads a 16 bit value over I2C or SPI
+ * @param reg the register address to read from
+ * @returns the 16 bit data value read from the device
+ */
+uint16_t Adafruit_BME280::read16(byte reg) {
+ uint16_t value;
+
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->endTransmission();
+ _wire->requestFrom((uint8_t)_i2caddr, (byte)2);
+ value = (_wire->read() << 8) | _wire->read();
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg | 0x80); // read, bit 7 high
+ value = (spixfer(0) << 8) | spixfer(0);
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+
+ return value;
+}
+
+/*!
+ * @brief Reads a signed 16 bit little endian value over I2C or SPI
+ * @param reg the register address to read from
+ * @returns the 16 bit data value read from the device
+ */
+uint16_t Adafruit_BME280::read16_LE(byte reg) {
+ uint16_t temp = read16(reg);
+ return (temp >> 8) | (temp << 8);
+}
+
+/*!
+ * @brief Reads a signed 16 bit value over I2C or SPI
+ * @param reg the register address to read from
+ * @returns the 16 bit data value read from the device
+ */
+int16_t Adafruit_BME280::readS16(byte reg) { return (int16_t)read16(reg); }
+
+/*!
+ * @brief Reads a signed little endian 16 bit value over I2C or SPI
+ * @param reg the register address to read from
+ * @returns the 16 bit data value read from the device
+ */
+int16_t Adafruit_BME280::readS16_LE(byte reg) {
+ return (int16_t)read16_LE(reg);
+}
+
+/*!
+ * @brief Reads a 24 bit value over I2C
+ * @param reg the register address to read from
+ * @returns the 24 bit data value read from the device
+ */
+uint32_t Adafruit_BME280::read24(byte reg) {
+ uint32_t value;
+
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->endTransmission();
+ _wire->requestFrom((uint8_t)_i2caddr, (byte)3);
+
+ value = _wire->read();
+ value <<= 8;
+ value |= _wire->read();
+ value <<= 8;
+ value |= _wire->read();
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg | 0x80); // read, bit 7 high
+
+ value = spixfer(0);
+ value <<= 8;
+ value |= spixfer(0);
+ value <<= 8;
+ value |= spixfer(0);
+
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+
+ return value;
+}
+
+/*!
+ * @brief Take a new measurement (only possible in forced mode)
+ @returns true in case of success else false
+ */
+bool Adafruit_BME280::takeForcedMeasurement(void) {
+ bool return_value = false;
+ // If we are in forced mode, the BME sensor goes back to sleep after each
+ // measurement and we need to set it to forced mode once at this point, so
+ // it will take the next measurement and then return to sleep again.
+ // In normal mode simply does new measurements periodically.
+ if (_measReg.mode == MODE_FORCED) {
+ return_value = true;
+ // set to forced mode, i.e. "take next measurement"
+ write8(BME280_REGISTER_CONTROL, _measReg.get());
+ // Store current time to measure the timeout
+ uint32_t timeout_start = millis();
+ // wait until measurement has been completed, otherwise we would read the
+ // the values from the last measurement or the timeout occurred after 2 sec.
+ while (read8(BME280_REGISTER_STATUS) & 0x08) {
+ // In case of a timeout, stop the while loop
+ if ((millis() - timeout_start) > 2000) {
+ return_value = false;
+ break;
+ }
+ delay(1);
+ }
+ }
+ return return_value;
+}
+
+/*!
+ * @brief Reads the factory-set coefficients
+ */
+void Adafruit_BME280::readCoefficients(void) {
+ _bme280_calib.dig_T1 = read16_LE(BME280_REGISTER_DIG_T1);
+ _bme280_calib.dig_T2 = readS16_LE(BME280_REGISTER_DIG_T2);
+ _bme280_calib.dig_T3 = readS16_LE(BME280_REGISTER_DIG_T3);
+
+ _bme280_calib.dig_P1 = read16_LE(BME280_REGISTER_DIG_P1);
+ _bme280_calib.dig_P2 = readS16_LE(BME280_REGISTER_DIG_P2);
+ _bme280_calib.dig_P3 = readS16_LE(BME280_REGISTER_DIG_P3);
+ _bme280_calib.dig_P4 = readS16_LE(BME280_REGISTER_DIG_P4);
+ _bme280_calib.dig_P5 = readS16_LE(BME280_REGISTER_DIG_P5);
+ _bme280_calib.dig_P6 = readS16_LE(BME280_REGISTER_DIG_P6);
+ _bme280_calib.dig_P7 = readS16_LE(BME280_REGISTER_DIG_P7);
+ _bme280_calib.dig_P8 = readS16_LE(BME280_REGISTER_DIG_P8);
+ _bme280_calib.dig_P9 = readS16_LE(BME280_REGISTER_DIG_P9);
+
+ _bme280_calib.dig_H1 = read8(BME280_REGISTER_DIG_H1);
+ _bme280_calib.dig_H2 = readS16_LE(BME280_REGISTER_DIG_H2);
+ _bme280_calib.dig_H3 = read8(BME280_REGISTER_DIG_H3);
+ _bme280_calib.dig_H4 = ((int8_t)read8(BME280_REGISTER_DIG_H4) << 4) |
+ (read8(BME280_REGISTER_DIG_H4 + 1) & 0xF);
+ _bme280_calib.dig_H5 = ((int8_t)read8(BME280_REGISTER_DIG_H5 + 1) << 4) |
+ (read8(BME280_REGISTER_DIG_H5) >> 4);
+ _bme280_calib.dig_H6 = (int8_t)read8(BME280_REGISTER_DIG_H6);
+}
+
+/*!
+ * @brief return true if chip is busy reading cal data
+ * @returns true if reading calibration, false otherwise
+ */
+bool Adafruit_BME280::isReadingCalibration(void) {
+ uint8_t const rStatus = read8(BME280_REGISTER_STATUS);
+
+ return (rStatus & (1 << 0)) != 0;
+}
+
+/*!
+ * @brief Returns the temperature from the sensor
+ * @returns the temperature read from the device
+ */
+float Adafruit_BME280::readTemperature(void) {
+ int32_t var1, var2;
+
+ int32_t adc_T = read24(BME280_REGISTER_TEMPDATA);
+ if (adc_T == 0x800000) // value in case temp measurement was disabled
+ return NAN;
+ adc_T >>= 4;
+
+ var1 = ((((adc_T >> 3) - ((int32_t)_bme280_calib.dig_T1 << 1))) *
+ ((int32_t)_bme280_calib.dig_T2)) >>
+ 11;
+
+ var2 = (((((adc_T >> 4) - ((int32_t)_bme280_calib.dig_T1)) *
+ ((adc_T >> 4) - ((int32_t)_bme280_calib.dig_T1))) >>
+ 12) *
+ ((int32_t)_bme280_calib.dig_T3)) >>
+ 14;
+
+ t_fine = var1 + var2 + t_fine_adjust;
+
+ float T = (t_fine * 5 + 128) >> 8;
+ return T / 100;
+}
+
+/*!
+ * @brief Returns the pressure from the sensor
+ * @returns the pressure value (in Pascal) read from the device
+ */
+float Adafruit_BME280::readPressure(void) {
+ int64_t var1, var2, p;
+
+ readTemperature(); // must be done first to get t_fine
+
+ int32_t adc_P = read24(BME280_REGISTER_PRESSUREDATA);
+ if (adc_P == 0x800000) // value in case pressure measurement was disabled
+ return NAN;
+ adc_P >>= 4;
+
+ var1 = ((int64_t)t_fine) - 128000;
+ var2 = var1 * var1 * (int64_t)_bme280_calib.dig_P6;
+ var2 = var2 + ((var1 * (int64_t)_bme280_calib.dig_P5) << 17);
+ var2 = var2 + (((int64_t)_bme280_calib.dig_P4) << 35);
+ var1 = ((var1 * var1 * (int64_t)_bme280_calib.dig_P3) >> 8) +
+ ((var1 * (int64_t)_bme280_calib.dig_P2) << 12);
+ var1 =
+ (((((int64_t)1) << 47) + var1)) * ((int64_t)_bme280_calib.dig_P1) >> 33;
+
+ if (var1 == 0) {
+ return 0; // avoid exception caused by division by zero
+ }
+ p = 1048576 - adc_P;
+ p = (((p << 31) - var2) * 3125) / var1;
+ var1 = (((int64_t)_bme280_calib.dig_P9) * (p >> 13) * (p >> 13)) >> 25;
+ var2 = (((int64_t)_bme280_calib.dig_P8) * p) >> 19;
+
+ p = ((p + var1 + var2) >> 8) + (((int64_t)_bme280_calib.dig_P7) << 4);
+ return (float)p / 256;
+}
+
+/*!
+ * @brief Returns the humidity from the sensor
+ * @returns the humidity value read from the device
+ */
+float Adafruit_BME280::readHumidity(void) {
+ readTemperature(); // must be done first to get t_fine
+
+ int32_t adc_H = read16(BME280_REGISTER_HUMIDDATA);
+ if (adc_H == 0x8000) // value in case humidity measurement was disabled
+ return NAN;
+
+ int32_t v_x1_u32r;
+
+ v_x1_u32r = (t_fine - ((int32_t)76800));
+
+ v_x1_u32r = (((((adc_H << 14) - (((int32_t)_bme280_calib.dig_H4) << 20) -
+ (((int32_t)_bme280_calib.dig_H5) * v_x1_u32r)) +
+ ((int32_t)16384)) >>
+ 15) *
+ (((((((v_x1_u32r * ((int32_t)_bme280_calib.dig_H6)) >> 10) *
+ (((v_x1_u32r * ((int32_t)_bme280_calib.dig_H3)) >> 11) +
+ ((int32_t)32768))) >>
+ 10) +
+ ((int32_t)2097152)) *
+ ((int32_t)_bme280_calib.dig_H2) +
+ 8192) >>
+ 14));
+
+ v_x1_u32r = (v_x1_u32r - (((((v_x1_u32r >> 15) * (v_x1_u32r >> 15)) >> 7) *
+ ((int32_t)_bme280_calib.dig_H1)) >>
+ 4));
+
+ v_x1_u32r = (v_x1_u32r < 0) ? 0 : v_x1_u32r;
+ v_x1_u32r = (v_x1_u32r > 419430400) ? 419430400 : v_x1_u32r;
+ float h = (v_x1_u32r >> 12);
+ return h / 1024.0;
+}
+
+/*!
+ * Calculates the altitude (in meters) from the specified atmospheric
+ * pressure (in hPa), and sea-level pressure (in hPa).
+ * @param seaLevel Sea-level pressure in hPa
+ * @returns the altitude value read from the device
+ */
+float Adafruit_BME280::readAltitude(float seaLevel) {
+ // Equation taken from BMP180 datasheet (page 16):
+ // http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf
+
+ // Note that using the equation from wikipedia can give bad results
+ // at high altitude. See this thread for more information:
+ // http://forums.adafruit.com/viewtopic.php?f=22&t=58064
+
+ float atmospheric = readPressure() / 100.0F;
+ return 44330.0 * (1.0 - pow(atmospheric / seaLevel, 0.1903));
+}
+
+/*!
+ * Calculates the pressure at sea level (in hPa) from the specified
+ * altitude (in meters), and atmospheric pressure (in hPa).
+ * @param altitude Altitude in meters
+ * @param atmospheric Atmospheric pressure in hPa
+ * @returns the pressure at sea level (in hPa) from the specified altitude
+ */
+float Adafruit_BME280::seaLevelForAltitude(float altitude, float atmospheric) {
+ // Equation taken from BMP180 datasheet (page 17):
+ // http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf
+
+ // Note that using the equation from wikipedia can give bad results
+ // at high altitude. See this thread for more information:
+ // http://forums.adafruit.com/viewtopic.php?f=22&t=58064
+
+ return atmospheric / pow(1.0 - (altitude / 44330.0), 5.255);
+}
+
+/*!
+ * Returns Sensor ID found by init() for diagnostics
+ * @returns Sensor ID 0x60 for BME280, 0x56, 0x57, 0x58 BMP280
+ */
+uint32_t Adafruit_BME280::sensorID(void) { return _sensorID; }
+
+/*!
+ * Returns the current temperature compensation value in degrees Celcius
+ * @returns the current temperature compensation value in degrees Celcius
+ */
+float Adafruit_BME280::getTemperatureCompensation(void) {
+ return float((t_fine_adjust * 5) >> 8) / 100.0;
+};
+
+/*!
+ * Sets a value to be added to each temperature reading. This adjusted
+ * temperature is used in pressure and humidity readings.
+ * @param adjustment Value to be added to each tempature reading in Celcius
+ */
+void Adafruit_BME280::setTemperatureCompensation(float adjustment) {
+ // convert the value in C into and adjustment to t_fine
+ t_fine_adjust = ((int32_t(adjustment * 100) << 8)) / 5;
+};
+
+/*!
+ @brief Gets an Adafruit Unified Sensor object for the temp sensor component
+ @return Adafruit_Sensor pointer to temperature sensor
+ */
+Adafruit_Sensor *Adafruit_BME280::getTemperatureSensor(void) {
+ if (!temp_sensor) {
+ temp_sensor = new Adafruit_BME280_Temp(this);
+ }
+
+ return temp_sensor;
+}
+
+/*!
+ @brief Gets an Adafruit Unified Sensor object for the pressure sensor
+ component
+ @return Adafruit_Sensor pointer to pressure sensor
+ */
+Adafruit_Sensor *Adafruit_BME280::getPressureSensor(void) {
+ if (!pressure_sensor) {
+ pressure_sensor = new Adafruit_BME280_Pressure(this);
+ }
+ return pressure_sensor;
+}
+
+/*!
+ @brief Gets an Adafruit Unified Sensor object for the humidity sensor
+ component
+ @return Adafruit_Sensor pointer to humidity sensor
+ */
+Adafruit_Sensor *Adafruit_BME280::getHumiditySensor(void) {
+ if (!humidity_sensor) {
+ humidity_sensor = new Adafruit_BME280_Humidity(this);
+ }
+ return humidity_sensor;
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the sensor_t data for the BME280's temperature sensor
+*/
+/**************************************************************************/
+void Adafruit_BME280_Temp::getSensor(sensor_t *sensor) {
+ /* Clear the sensor_t object */
+ memset(sensor, 0, sizeof(sensor_t));
+
+ /* Insert the sensor name in the fixed length char array */
+ strncpy(sensor->name, "BME280", sizeof(sensor->name) - 1);
+ sensor->name[sizeof(sensor->name) - 1] = 0;
+ sensor->version = 1;
+ sensor->sensor_id = _sensorID;
+ sensor->type = SENSOR_TYPE_AMBIENT_TEMPERATURE;
+ sensor->min_delay = 0;
+ sensor->min_value = -40.0; /* Temperature range -40 ~ +85 C */
+ sensor->max_value = +85.0;
+ sensor->resolution = 0.01; /* 0.01 C */
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the temperature as a standard sensor event
+ @param event Sensor event object that will be populated
+ @returns True
+*/
+/**************************************************************************/
+bool Adafruit_BME280_Temp::getEvent(sensors_event_t *event) {
+ /* Clear the event */
+ memset(event, 0, sizeof(sensors_event_t));
+
+ event->version = sizeof(sensors_event_t);
+ event->sensor_id = _sensorID;
+ event->type = SENSOR_TYPE_AMBIENT_TEMPERATURE;
+ event->timestamp = millis();
+ event->temperature = _theBME280->readTemperature();
+ return true;
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the sensor_t data for the BME280's pressure sensor
+*/
+/**************************************************************************/
+void Adafruit_BME280_Pressure::getSensor(sensor_t *sensor) {
+ /* Clear the sensor_t object */
+ memset(sensor, 0, sizeof(sensor_t));
+
+ /* Insert the sensor name in the fixed length char array */
+ strncpy(sensor->name, "BME280", sizeof(sensor->name) - 1);
+ sensor->name[sizeof(sensor->name) - 1] = 0;
+ sensor->version = 1;
+ sensor->sensor_id = _sensorID;
+ sensor->type = SENSOR_TYPE_PRESSURE;
+ sensor->min_delay = 0;
+ sensor->min_value = 300.0; /* 300 ~ 1100 hPa */
+ sensor->max_value = 1100.0;
+ sensor->resolution = 0.012; /* 0.12 hPa relative */
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the pressure as a standard sensor event
+ @param event Sensor event object that will be populated
+ @returns True
+*/
+/**************************************************************************/
+bool Adafruit_BME280_Pressure::getEvent(sensors_event_t *event) {
+ /* Clear the event */
+ memset(event, 0, sizeof(sensors_event_t));
+
+ event->version = sizeof(sensors_event_t);
+ event->sensor_id = _sensorID;
+ event->type = SENSOR_TYPE_PRESSURE;
+ event->timestamp = millis();
+ event->pressure = _theBME280->readPressure() / 100; // convert Pa to hPa
+ return true;
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the sensor_t data for the BME280's humidity sensor
+*/
+/**************************************************************************/
+void Adafruit_BME280_Humidity::getSensor(sensor_t *sensor) {
+ /* Clear the sensor_t object */
+ memset(sensor, 0, sizeof(sensor_t));
+
+ /* Insert the sensor name in the fixed length char array */
+ strncpy(sensor->name, "BME280", sizeof(sensor->name) - 1);
+ sensor->name[sizeof(sensor->name) - 1] = 0;
+ sensor->version = 1;
+ sensor->sensor_id = _sensorID;
+ sensor->type = SENSOR_TYPE_RELATIVE_HUMIDITY;
+ sensor->min_delay = 0;
+ sensor->min_value = 0;
+ sensor->max_value = 100; /* 0 - 100 % */
+ sensor->resolution = 3; /* 3% accuracy */
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the humidity as a standard sensor event
+ @param event Sensor event object that will be populated
+ @returns True
+*/
+/**************************************************************************/
+bool Adafruit_BME280_Humidity::getEvent(sensors_event_t *event) {
+ /* Clear the event */
+ memset(event, 0, sizeof(sensors_event_t));
+
+ event->version = sizeof(sensors_event_t);
+ event->sensor_id = _sensorID;
+ event->type = SENSOR_TYPE_RELATIVE_HUMIDITY;
+ event->timestamp = millis();
+ event->relative_humidity = _theBME280->readHumidity();
+ return true;
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.h
index 4fc0277b5f3442968c93a5287d82aaec36db65af..921a9966b67cab063cd905e5ab460a27ab2ba3aa 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_BME280.h
@@ -1,3 +1,378 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5b4493625a4204f7933937a6042f118b6367b9a8404c3638e55014a79511f3f9
-size 11788
+/*!
+ * @file Adafruit_BME280.h
+ *
+ * Designed specifically to work with the Adafruit BME280 Breakout
+ * ----> http://www.adafruit.com/products/2650
+ *
+ * These sensors use I2C or SPI to communicate, 2 or 4 pins are required
+ * to interface.
+ *
+ * Adafruit invests time and resources providing this open source code,
+ * please support Adafruit and open-source hardware by purchasing
+ * products from Adafruit!
+ *
+ * Written by Kevin "KTOWN" Townsend for Adafruit Industries.
+ *
+ * BSD license, all text here must be included in any redistribution.
+ * See the LICENSE file for details.
+ *
+ */
+
+#ifndef __BME280_H__
+#define __BME280_H__
+
+#include "Arduino.h"
+
+#include
+#include
+#include
+
+/*!
+ * @brief default I2C address
+ */
+#define BME280_ADDRESS (0x77) // Primary I2C Address
+ /*!
+ * @brief alternate I2C address
+ */
+#define BME280_ADDRESS_ALTERNATE (0x76) // Alternate Address
+
+/*!
+ * @brief Register addresses
+ */
+enum {
+ BME280_REGISTER_DIG_T1 = 0x88,
+ BME280_REGISTER_DIG_T2 = 0x8A,
+ BME280_REGISTER_DIG_T3 = 0x8C,
+
+ BME280_REGISTER_DIG_P1 = 0x8E,
+ BME280_REGISTER_DIG_P2 = 0x90,
+ BME280_REGISTER_DIG_P3 = 0x92,
+ BME280_REGISTER_DIG_P4 = 0x94,
+ BME280_REGISTER_DIG_P5 = 0x96,
+ BME280_REGISTER_DIG_P6 = 0x98,
+ BME280_REGISTER_DIG_P7 = 0x9A,
+ BME280_REGISTER_DIG_P8 = 0x9C,
+ BME280_REGISTER_DIG_P9 = 0x9E,
+
+ BME280_REGISTER_DIG_H1 = 0xA1,
+ BME280_REGISTER_DIG_H2 = 0xE1,
+ BME280_REGISTER_DIG_H3 = 0xE3,
+ BME280_REGISTER_DIG_H4 = 0xE4,
+ BME280_REGISTER_DIG_H5 = 0xE5,
+ BME280_REGISTER_DIG_H6 = 0xE7,
+
+ BME280_REGISTER_CHIPID = 0xD0,
+ BME280_REGISTER_VERSION = 0xD1,
+ BME280_REGISTER_SOFTRESET = 0xE0,
+
+ BME280_REGISTER_CAL26 = 0xE1, // R calibration stored in 0xE1-0xF0
+
+ BME280_REGISTER_CONTROLHUMID = 0xF2,
+ BME280_REGISTER_STATUS = 0XF3,
+ BME280_REGISTER_CONTROL = 0xF4,
+ BME280_REGISTER_CONFIG = 0xF5,
+ BME280_REGISTER_PRESSUREDATA = 0xF7,
+ BME280_REGISTER_TEMPDATA = 0xFA,
+ BME280_REGISTER_HUMIDDATA = 0xFD
+};
+
+/**************************************************************************/
+/*!
+ @brief calibration data
+*/
+/**************************************************************************/
+typedef struct {
+ uint16_t dig_T1; ///< temperature compensation value
+ int16_t dig_T2; ///< temperature compensation value
+ int16_t dig_T3; ///< temperature compensation value
+
+ uint16_t dig_P1; ///< pressure compensation value
+ int16_t dig_P2; ///< pressure compensation value
+ int16_t dig_P3; ///< pressure compensation value
+ int16_t dig_P4; ///< pressure compensation value
+ int16_t dig_P5; ///< pressure compensation value
+ int16_t dig_P6; ///< pressure compensation value
+ int16_t dig_P7; ///< pressure compensation value
+ int16_t dig_P8; ///< pressure compensation value
+ int16_t dig_P9; ///< pressure compensation value
+
+ uint8_t dig_H1; ///< humidity compensation value
+ int16_t dig_H2; ///< humidity compensation value
+ uint8_t dig_H3; ///< humidity compensation value
+ int16_t dig_H4; ///< humidity compensation value
+ int16_t dig_H5; ///< humidity compensation value
+ int8_t dig_H6; ///< humidity compensation value
+} bme280_calib_data;
+/*=========================================================================*/
+
+class Adafruit_BME280;
+
+/** Adafruit Unified Sensor interface for temperature component of BME280 */
+class Adafruit_BME280_Temp : public Adafruit_Sensor {
+public:
+ /** @brief Create an Adafruit_Sensor compatible object for the temp sensor
+ @param parent A pointer to the BME280 class */
+ Adafruit_BME280_Temp(Adafruit_BME280 *parent) { _theBME280 = parent; }
+ bool getEvent(sensors_event_t *);
+ void getSensor(sensor_t *);
+
+private:
+ int _sensorID = 280;
+ Adafruit_BME280 *_theBME280 = NULL;
+};
+
+/** Adafruit Unified Sensor interface for pressure component of BME280 */
+class Adafruit_BME280_Pressure : public Adafruit_Sensor {
+public:
+ /** @brief Create an Adafruit_Sensor compatible object for the pressure sensor
+ @param parent A pointer to the BME280 class */
+ Adafruit_BME280_Pressure(Adafruit_BME280 *parent) { _theBME280 = parent; }
+ bool getEvent(sensors_event_t *);
+ void getSensor(sensor_t *);
+
+private:
+ int _sensorID = 280;
+ Adafruit_BME280 *_theBME280 = NULL;
+};
+
+/** Adafruit Unified Sensor interface for humidity component of BME280 */
+class Adafruit_BME280_Humidity : public Adafruit_Sensor {
+public:
+ /** @brief Create an Adafruit_Sensor compatible object for the humidity sensor
+ @param parent A pointer to the BME280 class */
+ Adafruit_BME280_Humidity(Adafruit_BME280 *parent) { _theBME280 = parent; }
+ bool getEvent(sensors_event_t *);
+ void getSensor(sensor_t *);
+
+private:
+ int _sensorID = 280;
+ Adafruit_BME280 *_theBME280 = NULL;
+};
+
+/**************************************************************************/
+/*!
+ @brief Class that stores state and functions for interacting with BME280 IC
+*/
+/**************************************************************************/
+class Adafruit_BME280 {
+public:
+ /**************************************************************************/
+ /*!
+ @brief sampling rates
+ */
+ /**************************************************************************/
+ enum sensor_sampling {
+ SAMPLING_NONE = 0b000,
+ SAMPLING_X1 = 0b001,
+ SAMPLING_X2 = 0b010,
+ SAMPLING_X4 = 0b011,
+ SAMPLING_X8 = 0b100,
+ SAMPLING_X16 = 0b101
+ };
+
+ /**************************************************************************/
+ /*!
+ @brief power modes
+ */
+ /**************************************************************************/
+ enum sensor_mode {
+ MODE_SLEEP = 0b00,
+ MODE_FORCED = 0b01,
+ MODE_NORMAL = 0b11
+ };
+
+ /**************************************************************************/
+ /*!
+ @brief filter values
+ */
+ /**************************************************************************/
+ enum sensor_filter {
+ FILTER_OFF = 0b000,
+ FILTER_X2 = 0b001,
+ FILTER_X4 = 0b010,
+ FILTER_X8 = 0b011,
+ FILTER_X16 = 0b100
+ };
+
+ /**************************************************************************/
+ /*!
+ @brief standby duration in ms
+ */
+ /**************************************************************************/
+ enum standby_duration {
+ STANDBY_MS_0_5 = 0b000,
+ STANDBY_MS_10 = 0b110,
+ STANDBY_MS_20 = 0b111,
+ STANDBY_MS_62_5 = 0b001,
+ STANDBY_MS_125 = 0b010,
+ STANDBY_MS_250 = 0b011,
+ STANDBY_MS_500 = 0b100,
+ STANDBY_MS_1000 = 0b101
+ };
+
+ // constructors
+ Adafruit_BME280();
+ Adafruit_BME280(int8_t cspin, SPIClass *theSPI = &SPI);
+ Adafruit_BME280(int8_t cspin, int8_t mosipin, int8_t misopin, int8_t sckpin);
+ ~Adafruit_BME280(void);
+ bool begin(uint8_t addr = BME280_ADDRESS, TwoWire *theWire = &Wire);
+ bool init();
+
+ void setSampling(sensor_mode mode = MODE_NORMAL,
+ sensor_sampling tempSampling = SAMPLING_X16,
+ sensor_sampling pressSampling = SAMPLING_X16,
+ sensor_sampling humSampling = SAMPLING_X16,
+ sensor_filter filter = FILTER_OFF,
+ standby_duration duration = STANDBY_MS_0_5);
+
+ bool takeForcedMeasurement(void);
+ float readTemperature(void);
+ float readPressure(void);
+ float readHumidity(void);
+
+ float readAltitude(float seaLevel);
+ float seaLevelForAltitude(float altitude, float pressure);
+ uint32_t sensorID(void);
+
+ float getTemperatureCompensation(void);
+ void setTemperatureCompensation(float);
+
+ Adafruit_Sensor *getTemperatureSensor(void);
+ Adafruit_Sensor *getPressureSensor(void);
+ Adafruit_Sensor *getHumiditySensor(void);
+
+protected:
+ TwoWire *_wire; //!< pointer to a TwoWire object
+ SPIClass *_spi; //!< pointer to SPI object
+
+ Adafruit_BME280_Temp *temp_sensor = NULL;
+ //!< Adafruit_Sensor compat temperature sensor component
+
+ Adafruit_BME280_Pressure *pressure_sensor = NULL;
+ //!< Adafruit_Sensor compat pressure sensor component
+
+ Adafruit_BME280_Humidity *humidity_sensor = NULL;
+ //!< Adafruit_Sensor compat humidity sensor component
+
+ void readCoefficients(void);
+ bool isReadingCalibration(void);
+ uint8_t spixfer(uint8_t x);
+
+ void write8(byte reg, byte value);
+ uint8_t read8(byte reg);
+ uint16_t read16(byte reg);
+ uint32_t read24(byte reg);
+ int16_t readS16(byte reg);
+ uint16_t read16_LE(byte reg); // little endian
+ int16_t readS16_LE(byte reg); // little endian
+
+ uint8_t _i2caddr; //!< I2C addr for the TwoWire interface
+ int32_t _sensorID; //!< ID of the BME Sensor
+ int32_t t_fine; //!< temperature with high resolution, stored as an attribute
+ //!< as this is used for temperature compensation reading
+ //!< humidity and pressure
+
+ int8_t _cs; //!< for the SPI interface
+ int8_t _mosi; //!< for the SPI interface
+ int8_t _miso; //!< for the SPI interface
+ int8_t _sck; //!< for the SPI interface
+
+ int32_t t_fine_adjust = 0; //!< add to compensate temp readings and in turn
+ //!< to pressure and humidity readings
+
+ bme280_calib_data _bme280_calib; //!< here calibration data is stored
+
+ /**************************************************************************/
+ /*!
+ @brief config register
+ */
+ /**************************************************************************/
+ struct config {
+ // inactive duration (standby time) in normal mode
+ // 000 = 0.5 ms
+ // 001 = 62.5 ms
+ // 010 = 125 ms
+ // 011 = 250 ms
+ // 100 = 500 ms
+ // 101 = 1000 ms
+ // 110 = 10 ms
+ // 111 = 20 ms
+ unsigned int t_sb : 3; ///< inactive duration (standby time) in normal mode
+
+ // filter settings
+ // 000 = filter off
+ // 001 = 2x filter
+ // 010 = 4x filter
+ // 011 = 8x filter
+ // 100 and above = 16x filter
+ unsigned int filter : 3; ///< filter settings
+
+ // unused - don't set
+ unsigned int none : 1; ///< unused - don't set
+ unsigned int spi3w_en : 1; ///< unused - don't set
+
+ /// @return combined config register
+ unsigned int get() { return (t_sb << 5) | (filter << 2) | spi3w_en; }
+ };
+ config _configReg; //!< config register object
+
+ /**************************************************************************/
+ /*!
+ @brief ctrl_meas register
+ */
+ /**************************************************************************/
+ struct ctrl_meas {
+ // temperature oversampling
+ // 000 = skipped
+ // 001 = x1
+ // 010 = x2
+ // 011 = x4
+ // 100 = x8
+ // 101 and above = x16
+ unsigned int osrs_t : 3; ///< temperature oversampling
+
+ // pressure oversampling
+ // 000 = skipped
+ // 001 = x1
+ // 010 = x2
+ // 011 = x4
+ // 100 = x8
+ // 101 and above = x16
+ unsigned int osrs_p : 3; ///< pressure oversampling
+
+ // device mode
+ // 00 = sleep
+ // 01 or 10 = forced
+ // 11 = normal
+ unsigned int mode : 2; ///< device mode
+
+ /// @return combined ctrl register
+ unsigned int get() { return (osrs_t << 5) | (osrs_p << 2) | mode; }
+ };
+ ctrl_meas _measReg; //!< measurement register object
+
+ /**************************************************************************/
+ /*!
+ @brief ctrl_hum register
+ */
+ /**************************************************************************/
+ struct ctrl_hum {
+ /// unused - don't set
+ unsigned int none : 5;
+
+ // pressure oversampling
+ // 000 = skipped
+ // 001 = x1
+ // 010 = x2
+ // 011 = x4
+ // 100 = x8
+ // 101 and above = x16
+ unsigned int osrs_h : 3; ///< pressure oversampling
+
+ /// @return combined ctrl hum register
+ unsigned int get() { return (osrs_h); }
+ };
+ ctrl_hum _humReg; //!< hum register object
+};
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.cpp
index e9b2bb2bf65ae7a15cd0216c1beee4fdfaec3605..2a4513e0ec0557924ca1bf00c93a82a8c8110247 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.cpp
@@ -1,3 +1,78 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bb8d13aa96c7648cea16eeee46915b1fb12d0b3f5a210d694b2f7476c5cfca82
-size 2344
+#include "Adafruit_Sensor.h"
+
+/**************************************************************************/
+/*!
+ @brief Prints sensor information to serial console
+*/
+/**************************************************************************/
+void Adafruit_Sensor::printSensorDetails(void) {
+ sensor_t sensor;
+ getSensor(&sensor);
+ Serial.println(F("------------------------------------"));
+ Serial.print(F("Sensor: "));
+ Serial.println(sensor.name);
+ Serial.print(F("Type: "));
+ switch ((sensors_type_t)sensor.type) {
+ case SENSOR_TYPE_ACCELEROMETER:
+ Serial.print(F("Acceleration (m/s2)"));
+ break;
+ case SENSOR_TYPE_MAGNETIC_FIELD:
+ Serial.print(F("Magnetic (uT)"));
+ break;
+ case SENSOR_TYPE_ORIENTATION:
+ Serial.print(F("Orientation (degrees)"));
+ break;
+ case SENSOR_TYPE_GYROSCOPE:
+ Serial.print(F("Gyroscopic (rad/s)"));
+ break;
+ case SENSOR_TYPE_LIGHT:
+ Serial.print(F("Light (lux)"));
+ break;
+ case SENSOR_TYPE_PRESSURE:
+ Serial.print(F("Pressure (hPa)"));
+ break;
+ case SENSOR_TYPE_PROXIMITY:
+ Serial.print(F("Distance (cm)"));
+ break;
+ case SENSOR_TYPE_GRAVITY:
+ Serial.print(F("Gravity (m/s2)"));
+ break;
+ case SENSOR_TYPE_LINEAR_ACCELERATION:
+ Serial.print(F("Linear Acceleration (m/s2)"));
+ break;
+ case SENSOR_TYPE_ROTATION_VECTOR:
+ Serial.print(F("Rotation vector"));
+ break;
+ case SENSOR_TYPE_RELATIVE_HUMIDITY:
+ Serial.print(F("Relative Humidity (%)"));
+ break;
+ case SENSOR_TYPE_AMBIENT_TEMPERATURE:
+ Serial.print(F("Ambient Temp (C)"));
+ break;
+ case SENSOR_TYPE_OBJECT_TEMPERATURE:
+ Serial.print(F("Object Temp (C)"));
+ break;
+ case SENSOR_TYPE_VOLTAGE:
+ Serial.print(F("Voltage (V)"));
+ break;
+ case SENSOR_TYPE_CURRENT:
+ Serial.print(F("Current (mA)"));
+ break;
+ case SENSOR_TYPE_COLOR:
+ Serial.print(F("Color (RGBA)"));
+ break;
+ }
+
+ Serial.println();
+ Serial.print(F("Driver Ver: "));
+ Serial.println(sensor.version);
+ Serial.print(F("Unique ID: "));
+ Serial.println(sensor.sensor_id);
+ Serial.print(F("Min Value: "));
+ Serial.println(sensor.min_value);
+ Serial.print(F("Max Value: "));
+ Serial.println(sensor.max_value);
+ Serial.print(F("Resolution: "));
+ Serial.println(sensor.resolution);
+ Serial.println(F("------------------------------------\n"));
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.h
index 9978a1559c508bece1b3cc10b9508546f485f525..087eda5a3f8c07eae22b7796c568553ee3b0285e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/Adafruit_Sensor.h
@@ -1,3 +1,188 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:54360875ddb5850a4f68991fb522ea72b620226c84f0d21a88d7268cea0b9307
-size 7781
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software< /span>
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Update by K. Townsend (Adafruit Industries) for lighter typedefs, and
+ * extended sensor support to include color, voltage and current */
+
+#ifndef _ADAFRUIT_SENSOR_H
+#define _ADAFRUIT_SENSOR_H
+
+#ifndef ARDUINO
+#include
+#elif ARDUINO >= 100
+#include "Arduino.h"
+#include "Print.h"
+#else
+#include "WProgram.h"
+#endif
+
+/* Constants */
+#define SENSORS_GRAVITY_EARTH (9.80665F) /**< Earth's gravity in m/s^2 */
+#define SENSORS_GRAVITY_MOON (1.6F) /**< The moon's gravity in m/s^2 */
+#define SENSORS_GRAVITY_SUN (275.0F) /**< The sun's gravity in m/s^2 */
+#define SENSORS_GRAVITY_STANDARD (SENSORS_GRAVITY_EARTH)
+#define SENSORS_MAGFIELD_EARTH_MAX \
+ (60.0F) /**< Maximum magnetic field on Earth's surface */
+#define SENSORS_MAGFIELD_EARTH_MIN \
+ (30.0F) /**< Minimum magnetic field on Earth's surface */
+#define SENSORS_PRESSURE_SEALEVELHPA \
+ (1013.25F) /**< Average sea level pressure is 1013.25 hPa */
+#define SENSORS_DPS_TO_RADS \
+ (0.017453293F) /**< Degrees/s to rad/s multiplier \
+ */
+#define SENSORS_RADS_TO_DPS \
+ (57.29577793F) /**< Rad/s to degrees/s multiplier */
+#define SENSORS_GAUSS_TO_MICROTESLA \
+ (100) /**< Gauss to micro-Tesla multiplier */
+
+/** Sensor types */
+typedef enum {
+ SENSOR_TYPE_ACCELEROMETER = (1), /**< Gravity + linear acceleration */
+ SENSOR_TYPE_MAGNETIC_FIELD = (2),
+ SENSOR_TYPE_ORIENTATION = (3),
+ SENSOR_TYPE_GYROSCOPE = (4),
+ SENSOR_TYPE_LIGHT = (5),
+ SENSOR_TYPE_PRESSURE = (6),
+ SENSOR_TYPE_PROXIMITY = (8),
+ SENSOR_TYPE_GRAVITY = (9),
+ SENSOR_TYPE_LINEAR_ACCELERATION =
+ (10), /**< Acceleration not including gravity */
+ SENSOR_TYPE_ROTATION_VECTOR = (11),
+ SENSOR_TYPE_RELATIVE_HUMIDITY = (12),
+ SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
+ SENSOR_TYPE_OBJECT_TEMPERATURE = (14),
+ SENSOR_TYPE_VOLTAGE = (15),
+ SENSOR_TYPE_CURRENT = (16),
+ SENSOR_TYPE_COLOR = (17)
+} sensors_type_t;
+
+/** struct sensors_vec_s is used to return a vector in a common format. */
+typedef struct {
+ union {
+ float v[3]; ///< 3D vector elements
+ struct {
+ float x; ///< X component of vector
+ float y; ///< Y component of vector
+ float z; ///< Z component of vector
+ }; ///< Struct for holding XYZ component
+ /* Orientation sensors */
+ struct {
+ float roll; /**< Rotation around the longitudinal axis (the plane body, 'X
+ axis'). Roll is positive and increasing when moving
+ downward. -90 degrees <= roll <= 90 degrees */
+ float pitch; /**< Rotation around the lateral axis (the wing span, 'Y
+ axis'). Pitch is positive and increasing when moving
+ upwards. -180 degrees <= pitch <= 180 degrees) */
+ float heading; /**< Angle between the longitudinal axis (the plane body)
+ and magnetic north, measured clockwise when viewing from
+ the top of the device. 0-359 degrees */
+ }; ///< Struct for holding roll/pitch/heading
+ }; ///< Union that can hold 3D vector array, XYZ components or
+ ///< roll/pitch/heading
+ int8_t status; ///< Status byte
+ uint8_t reserved[3]; ///< Reserved
+} sensors_vec_t;
+
+/** struct sensors_color_s is used to return color data in a common format. */
+typedef struct {
+ union {
+ float c[3]; ///< Raw 3-element data
+ /* RGB color space */
+ struct {
+ float r; /**< Red component */
+ float g; /**< Green component */
+ float b; /**< Blue component */
+ }; ///< RGB data in floating point notation
+ }; ///< Union of various ways to describe RGB colorspace
+ uint32_t rgba; /**< 24-bit RGBA value */
+} sensors_color_t;
+
+/* Sensor event (36 bytes) */
+/** struct sensor_event_s is used to provide a single sensor event in a common
+ * format. */
+typedef struct {
+ int32_t version; /**< must be sizeof(struct sensors_event_t) */
+ int32_t sensor_id; /**< unique sensor identifier */
+ int32_t type; /**< sensor type */
+ int32_t reserved0; /**< reserved */
+ int32_t timestamp; /**< time is in milliseconds */
+ union {
+ float data[4]; ///< Raw data
+ sensors_vec_t acceleration; /**< acceleration values are in meter per second
+ per second (m/s^2) */
+ sensors_vec_t
+ magnetic; /**< magnetic vector values are in micro-Tesla (uT) */
+ sensors_vec_t orientation; /**< orientation values are in degrees */
+ sensors_vec_t gyro; /**< gyroscope values are in rad/s */
+ float temperature; /**< temperature is in degrees centigrade (Celsius) */
+ float distance; /**< distance in centimeters */
+ float light; /**< light in SI lux units */
+ float pressure; /**< pressure in hectopascal (hPa) */
+ float relative_humidity; /**< relative humidity in percent */
+ float current; /**< current in milliamps (mA) */
+ float voltage; /**< voltage in volts (V) */
+ sensors_color_t color; /**< color in RGB component values */
+ }; ///< Union for the wide ranges of data we can carry
+} sensors_event_t;
+
+/* Sensor details (40 bytes) */
+/** struct sensor_s is used to describe basic information about a specific
+ * sensor. */
+typedef struct {
+ char name[12]; /**< sensor name */
+ int32_t version; /**< version of the hardware + driver */
+ int32_t sensor_id; /**< unique sensor identifier */
+ int32_t type; /**< this sensor's type (ex. SENSOR_TYPE_LIGHT) */
+ float max_value; /**< maximum value of this sensor's value in SI units */
+ float min_value; /**< minimum value of this sensor's value in SI units */
+ float resolution; /**< smallest difference between two values reported by this
+ sensor */
+ int32_t min_delay; /**< min delay in microseconds between events. zero = not a
+ constant rate */
+} sensor_t;
+
+/** @brief Common sensor interface to unify various sensors.
+ * Intentionally modeled after sensors.h in the Android API:
+ * https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/sensors.h
+ */
+class Adafruit_Sensor {
+public:
+ // Constructor(s)
+ Adafruit_Sensor() {}
+ virtual ~Adafruit_Sensor() {}
+
+ // These must be defined by the subclass
+
+ /*! @brief Whether we should automatically change the range (if possible) for
+ higher precision
+ @param enabled True if we will try to autorange */
+ virtual void enableAutoRange(bool enabled) {
+ (void)enabled; /* suppress unused warning */
+ };
+
+ /*! @brief Get the latest sensor event
+ @returns True if able to fetch an event */
+ virtual bool getEvent(sensors_event_t *) = 0;
+ /*! @brief Get info about the sensor itself */
+ virtual void getSensor(sensor_t *) = 0;
+
+ void printSensorDetails(void);
+
+private:
+ bool _autoRange;
+};
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.h
index 5822923813a4ec1d3f01a7e63978bdb0d6bd1b9a..111045de1b9377f2393d27a8c6589cc5e0a79476 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.h
@@ -1,3 +1,21 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a054ce0401bd05658f1f07af945b01ceee527fac71f6be2df3724f8090696502
-size 940
+#pragma once
+
+#include
+#include
+#include
+#include
+
+#ifndef __ADAFRUIT_BME280_H__
+#define __ADAFRUIT_BME280_H__
+
+class BME280 : public Adafruit_BME280
+ { public:
+ bool operator()(float trigger) { return readPressure() >= trigger; }
+ // These functions are wrapped here as we want the Pressure value in
+ // hPa not in Pa, for consistence with BME280 active component setting.
+ float readPressure(void) { return Adafruit_BME280::readPressure()/100.0; }
+ float readAltitude(float seaLevel=1013.25) { return Adafruit_BME280::readAltitude(seaLevel); }
+ float readSealevelPressure(float altitude=0.0,float seaLevel=1013.25) { return (float) Adafruit_BME280::seaLevelForAltitude(altitude,seaLevel); }
+ };
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.xml
index fb9f79e6f19ec0b952a962604f028795a6a68d5c..47434c10f02cfb93a6cefd68b326b07d159bf1d0 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BME280/bme280.xml
@@ -1,3 +1,34 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:771a5f6c2b9fd2199d18880dc2b4cf75e1a7c15905e61dbb69af692b02d5a7f5
-size 1550
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.cpp
index a4523053403b5608d0944a24c662407d40881a22..aad7564e8a3e332c782e6d89401c140d70484bfa 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.cpp
@@ -1,3 +1,317 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:918b9e2d4535834b97e9de942079b66bb66f4bf1c2231ae4bd35741d0bc0a4ae
-size 8445
+/***************************************************
+ This is a library for the Adafruit BMP085/BMP180 Barometric Pressure + Temp sensor
+
+ Designed specifically to work with the Adafruit BMP085 or BMP180 Breakout
+ ----> http://www.adafruit.com/products/391
+ ----> http://www.adafruit.com/products/1603
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include "Adafruit_BMP085.h"
+
+Adafruit_BMP085::Adafruit_BMP085() {
+}
+
+
+boolean Adafruit_BMP085::begin(uint8_t mode) {
+ if (mode > BMP085_ULTRAHIGHRES)
+ mode = BMP085_ULTRAHIGHRES;
+ oversampling = mode;
+
+ Wire.begin();
+
+ if (read8(0xD0) != 0x55) return false;
+
+ /* read calibration data */
+ ac1 = read16(BMP085_CAL_AC1);
+ ac2 = read16(BMP085_CAL_AC2);
+ ac3 = read16(BMP085_CAL_AC3);
+ ac4 = read16(BMP085_CAL_AC4);
+ ac5 = read16(BMP085_CAL_AC5);
+ ac6 = read16(BMP085_CAL_AC6);
+
+ b1 = read16(BMP085_CAL_B1);
+ b2 = read16(BMP085_CAL_B2);
+
+ mb = read16(BMP085_CAL_MB);
+ mc = read16(BMP085_CAL_MC);
+ md = read16(BMP085_CAL_MD);
+#if (BMP085_DEBUG == 1)
+ Serial.print("ac1 = "); Serial.println(ac1, DEC);
+ Serial.print("ac2 = "); Serial.println(ac2, DEC);
+ Serial.print("ac3 = "); Serial.println(ac3, DEC);
+ Serial.print("ac4 = "); Serial.println(ac4, DEC);
+ Serial.print("ac5 = "); Serial.println(ac5, DEC);
+ Serial.print("ac6 = "); Serial.println(ac6, DEC);
+
+ Serial.print("b1 = "); Serial.println(b1, DEC);
+ Serial.print("b2 = "); Serial.println(b2, DEC);
+
+ Serial.print("mb = "); Serial.println(mb, DEC);
+ Serial.print("mc = "); Serial.println(mc, DEC);
+ Serial.print("md = "); Serial.println(md, DEC);
+#endif
+
+ return true;
+}
+
+int32_t Adafruit_BMP085::computeB5(int32_t UT) {
+ int32_t X1 = (UT - (int32_t)ac6) * ((int32_t)ac5) >> 15;
+ int32_t X2 = ((int32_t)mc << 11) / (X1+(int32_t)md);
+ return X1 + X2;
+}
+
+uint16_t Adafruit_BMP085::readRawTemperature(void) {
+ write8(BMP085_CONTROL, BMP085_READTEMPCMD);
+ delay(5);
+#if BMP085_DEBUG == 1
+ Serial.print("Raw temp: "); Serial.println(read16(BMP085_TEMPDATA));
+#endif
+ return read16(BMP085_TEMPDATA);
+}
+
+uint32_t Adafruit_BMP085::readRawPressure(void) {
+ uint32_t raw;
+
+ write8(BMP085_CONTROL, BMP085_READPRESSURECMD + (oversampling << 6));
+
+ if (oversampling == BMP085_ULTRALOWPOWER)
+ delay(5);
+ else if (oversampling == BMP085_STANDARD)
+ delay(8);
+ else if (oversampling == BMP085_HIGHRES)
+ delay(14);
+ else
+ delay(26);
+
+ raw = read16(BMP085_PRESSUREDATA);
+
+ raw <<= 8;
+ raw |= read8(BMP085_PRESSUREDATA+2);
+ raw >>= (8 - oversampling);
+
+ /* this pull broke stuff, look at it later?
+ if (oversampling==0) {
+ raw <<= 8;
+ raw |= read8(BMP085_PRESSUREDATA+2);
+ raw >>= (8 - oversampling);
+ }
+ */
+
+#if BMP085_DEBUG == 1
+ Serial.print("Raw pressure: "); Serial.println(raw);
+#endif
+ return raw;
+}
+
+
+int32_t Adafruit_BMP085::readPressure(void) {
+ int32_t UT, UP, B3, B5, B6, X1, X2, X3, p;
+ uint32_t B4, B7;
+
+ UT = readRawTemperature();
+ UP = readRawPressure();
+
+#if BMP085_DEBUG == 1
+ // use datasheet numbers!
+ UT = 27898;
+ UP = 23843;
+ ac6 = 23153;
+ ac5 = 32757;
+ mc = -8711;
+ md = 2868;
+ b1 = 6190;
+ b2 = 4;
+ ac3 = -14383;
+ ac2 = -72;
+ ac1 = 408;
+ ac4 = 32741;
+ oversampling = 0;
+#endif
+
+ B5 = computeB5(UT);
+
+#if BMP085_DEBUG == 1
+ Serial.print("X1 = "); Serial.println(X1);
+ Serial.print("X2 = "); Serial.println(X2);
+ Serial.print("B5 = "); Serial.println(B5);
+#endif
+
+ // do pressure calcs
+ B6 = B5 - 4000;
+ X1 = ((int32_t)b2 * ( (B6 * B6)>>12 )) >> 11;
+ X2 = ((int32_t)ac2 * B6) >> 11;
+ X3 = X1 + X2;
+ B3 = ((((int32_t)ac1*4 + X3) << oversampling) + 2) / 4;
+
+#if BMP085_DEBUG == 1
+ Serial.print("B6 = "); Serial.println(B6);
+ Serial.print("X1 = "); Serial.println(X1);
+ Serial.print("X2 = "); Serial.println(X2);
+ Serial.print("B3 = "); Serial.println(B3);
+#endif
+
+ X1 = ((int32_t)ac3 * B6) >> 13;
+ X2 = ((int32_t)b1 * ((B6 * B6) >> 12)) >> 16;
+ X3 = ((X1 + X2) + 2) >> 2;
+ B4 = ((uint32_t)ac4 * (uint32_t)(X3 + 32768)) >> 15;
+ B7 = ((uint32_t)UP - B3) * (uint32_t)( 50000UL >> oversampling );
+
+#if BMP085_DEBUG == 1
+ Serial.print("X1 = "); Serial.println(X1);
+ Serial.print("X2 = "); Serial.println(X2);
+ Serial.print("B4 = "); Serial.println(B4);
+ Serial.print("B7 = "); Serial.println(B7);
+#endif
+
+ if (B7 < 0x80000000) {
+ p = (B7 * 2) / B4;
+ } else {
+ p = (B7 / B4) * 2;
+ }
+ X1 = (p >> 8) * (p >> 8);
+ X1 = (X1 * 3038) >> 16;
+ X2 = (-7357 * p) >> 16;
+
+#if BMP085_DEBUG == 1
+ Serial.print("p = "); Serial.println(p);
+ Serial.print("X1 = "); Serial.println(X1);
+ Serial.print("X2 = "); Serial.println(X2);
+#endif
+
+ p = p + ((X1 + X2 + (int32_t)3791)>>4);
+#if BMP085_DEBUG == 1
+ Serial.print("p = "); Serial.println(p);
+#endif
+ return p;
+}
+
+int32_t Adafruit_BMP085::readSealevelPressure(float altitude_meters) {
+ float pressure = readPressure();
+ return (int32_t)(pressure / pow(1.0-altitude_meters/44330, 5.255));
+}
+
+float Adafruit_BMP085::readTemperature(void) {
+ int32_t UT, B5; // following ds convention
+ float temp;
+
+ UT = readRawTemperature();
+
+#if BMP085_DEBUG == 1
+ // use datasheet numbers!
+ UT = 27898;
+ ac6 = 23153;
+ ac5 = 32757;
+ mc = -8711;
+ md = 2868;
+#endif
+
+ B5 = computeB5(UT);
+ temp = (B5+8) >> 4;
+ temp /= 10;
+
+ return temp;
+}
+
+float Adafruit_BMP085::readAltitude(float sealevelPressure) {
+ float altitude;
+
+ float pressure = readPressure();
+
+ altitude = 44330 * (1.0 - pow(pressure /sealevelPressure,0.1903));
+
+ return altitude;
+}
+
+
+/*********************************************************************/
+
+uint8_t Adafruit_BMP085::read8(uint8_t a) {
+ uint8_t ret;
+
+ Wire.beginTransmission(BMP085_I2CADDR); // start transmission to device
+#if (ARDUINO >= 100)
+ Wire.write(a); // sends register address to read from
+#else
+ Wire.send(a); // sends register address to read from
+#endif
+ Wire.endTransmission(); // end transmission
+
+ Wire.beginTransmission(BMP085_I2CADDR); // start transmission to device
+ Wire.requestFrom(BMP085_I2CADDR, 1);// send data n-bytes read
+#if (ARDUINO >= 100)
+ ret = Wire.read(); // receive DATA
+#else
+ ret = Wire.receive(); // receive DATA
+#endif
+ Wire.endTransmission(); // end transmission
+
+ return ret;
+}
+
+uint16_t Adafruit_BMP085::read16(uint8_t a) {
+ uint16_t ret;
+
+ Wire.beginTransmission(BMP085_I2CADDR); // start transmission to device
+#if (ARDUINO >= 100)
+ Wire.write(a); // sends register address to read from
+#else
+ Wire.send(a); // sends register address to read from
+#endif
+ Wire.endTransmission(); // end transmission
+
+ Wire.beginTransmission(BMP085_I2CADDR); // start transmission to device
+ Wire.requestFrom(BMP085_I2CADDR, 2);// send data n-bytes read
+#if (ARDUINO >= 100)
+ ret = Wire.read(); // receive DATA
+ ret <<= 8;
+ ret |= Wire.read(); // receive DATA
+#else
+ ret = Wire.receive(); // receive DATA
+ ret <<= 8;
+ ret |= Wire.receive(); // receive DATA
+#endif
+ Wire.endTransmission(); // end transmission
+
+ return ret;
+}
+
+void Adafruit_BMP085::write8(uint8_t a, uint8_t d) {
+ Wire.beginTransmission(BMP085_I2CADDR); // start transmission to device
+#if (ARDUINO >= 100)
+ Wire.write(a); // sends register address to read from
+ Wire.write(d); // write data
+#else
+ Wire.send(a); // sends register address to read from
+ Wire.send(d); // write data
+#endif
+ Wire.endTransmission(); // end transmission
+}
+
+// Added to retrieve the calibration coefficients.
+// The parameter coeffIdx is the index in the coefficient table such that coeffIdx=0 is AC1, coeffIdx=1 ia AC2 and so on.
+float Adafruit_BMP085::getCalibrationCoeff (uint8_t coeffIdx)
+ { switch (coeffIdx)
+ { case 0: return (int16_t) ac1; break;
+ case 1: return (int16_t) ac2; break;
+ case 2: return (int16_t) ac3; break;
+ case 3: return (uint16_t) ac4; break;
+ case 4: return (uint16_t) ac5; break;
+ case 5: return (uint16_t) ac6; break;
+ case 6: return (int16_t) b1; break;
+ case 7: return (int16_t) b2; break;
+ case 8: return (int16_t) mb; break;
+ case 9: return (int16_t) mc; break;
+ case 10: return (int16_t) md; break;
+ default: return 0;
+ }
+ }
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.h
index bdc1af6f7f3fb83ff4151b951863482dde3a4951..4723ae717253726a9c34249eb2ed9c362ee788ea 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/Adafruit_BMP085.h
@@ -1,3 +1,87 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7b11dde004ded210880e71a5f06e5cfb0a392c97d35f22dce9cea49f9f01de4b
-size 3181
+/***************************************************
+ This is a library for the Adafruit BMP085/BMP180 Barometric Pressure + Temp sensor
+
+ Designed specifically to work with the Adafruit BMP085 or BMP180 Breakout
+ ----> http://www.adafruit.com/products/391
+ ----> http://www.adafruit.com/products/1603
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#ifndef ADAFRUIT_BMP085_H
+#define ADAFRUIT_BMP085_H
+
+#if (ARDUINO >= 100)
+ #include "Arduino.h"
+#else
+ #include "WProgram.h"
+#endif
+#include "Wire.h"
+
+#define BMP085_DEBUG 0
+
+#define BMP085_I2CADDR 0x77
+
+#define BMP085_ULTRALOWPOWER 0
+#define BMP085_STANDARD 1
+#define BMP085_HIGHRES 2
+#define BMP085_ULTRAHIGHRES 3
+#define BMP085_CAL_AC1 0xAA // R Calibration data (16 bits)
+#define BMP085_CAL_AC2 0xAC // R Calibration data (16 bits)
+#define BMP085_CAL_AC3 0xAE // R Calibration data (16 bits)
+#define BMP085_CAL_AC4 0xB0 // R Calibration data (16 bits)
+#define BMP085_CAL_AC5 0xB2 // R Calibration data (16 bits)
+#define BMP085_CAL_AC6 0xB4 // R Calibration data (16 bits)
+#define BMP085_CAL_B1 0xB6 // R Calibration data (16 bits)
+#define BMP085_CAL_B2 0xB8 // R Calibration data (16 bits)
+#define BMP085_CAL_MB 0xBA // R Calibration data (16 bits)
+#define BMP085_CAL_MC 0xBC // R Calibration data (16 bits)
+#define BMP085_CAL_MD 0xBE // R Calibration data (16 bits)
+
+#define BMP085_CONTROL 0xF4
+#define BMP085_TEMPDATA 0xF6
+#define BMP085_PRESSUREDATA 0xF6
+#define BMP085_READTEMPCMD 0x2E
+#define BMP085_READPRESSURECMD 0x34
+
+
+class Adafruit_BMP085 {
+ public:
+ Adafruit_BMP085();
+ boolean begin(uint8_t mode = BMP085_ULTRAHIGHRES); // by default go highres
+ float readTemperature(void);
+ int32_t readPressure(void);
+ int32_t readSealevelPressure(float altitude_meters = 0);
+ float readAltitude(float sealevelPressure = 101325); // std atmosphere
+ uint16_t readRawTemperature(void);
+ uint32_t readRawPressure(void);
+
+ // Added to original Adafruit library:
+ // Sets the oversample mode.
+ // We could make private oversampling as a public member but this solution is safer.
+ void setMode(uint8_t mode) { oversampling = mode; }
+ // Retrieve the calibration coefficients.
+ // The parameter coeffIdx is the index in the coefficient table such that coeffIdx=0 is AC1, coeffIdx=1 ia AC2 and so on.
+ float getCalibrationCoeff (uint8_t coeffIdx);
+
+ private:
+ int32_t computeB5(int32_t UT);
+ uint8_t read8(uint8_t addr);
+ uint16_t read16(uint8_t addr);
+ void write8(uint8_t addr, uint8_t data);
+
+ uint8_t oversampling;
+
+ int16_t ac1, ac2, ac3, b1, b2, mb, mc, md;
+ uint16_t ac4, ac5, ac6;
+};
+
+
+#endif // ADAFRUIT_BMP085_H
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.h
index d7d067891b013852c2e5237f49ccb52d10086fa9..8b071541e15e2cea99c511f230dd32ba9e5cb84b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.h
@@ -1,3 +1,20 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0db810d63efc3f56f24abffcf03e988af5a5c130317dc9ad3e3138b8bebe2fc8
-size 917
+#pragma once
+
+#include
+#include
+
+#ifndef __BMP180_H__
+#define __BMP180_H__
+
+class BMP180 : public Adafruit_BMP085
+ { public:
+ bool operator()(float trigger) { return readPressure() >= trigger; }
+ void setMode(uint8_t mode) { Adafruit_BMP085::setMode(mode); }
+ // These functions are wrapped here as we want the Pressure value in
+ // hPa not in Pa, for consistence with BMP180 active component setting.
+ float readPressure(void) { return Adafruit_BMP085::readPressure()/100.0; }
+ float readAltitude(float sealevelPressure=1013.25) { return Adafruit_BMP085::readAltitude(sealevelPressure*100.0); }
+ float readSealevelPressure(float altitude_meters=0.0) { return (float) Adafruit_BMP085::readSealevelPressure(altitude_meters)/100.0; }
+ };
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.xml
index 7b7e75b50f18436658c6c914490d2795c5d2fdd7..ba2fa4956eb429900d6b53446cfd7bb1dc213ba2 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP180/bmp180.xml
@@ -1,3 +1,70 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:29b430022a347acab6d6714de9c8e504907bc0b2bd59a090cb13d1f8eb8b7d0e
-size 2963
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.cpp
index eb56629a2f38773b19c1e3197ba37425c64feea5..8fe9f4f8176ae1b8ae5f56b637ba6fe9f81c023f 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.cpp
@@ -1,3 +1,559 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8d160656c843982b0fd74c64c6a387e83bf5fbad5f4b87631a3b83647c1fecff
-size 16543
+/*!
+ * @file Adafruit_BMP280.cpp
+ *
+ * This is a library for the BMP280 orientation sensor
+ *
+ * Designed specifically to work with the Adafruit BMP280 Sensor.
+ *
+ * Pick one up today in the adafruit shop!
+ * ------> https://www.adafruit.com/product/2651
+ *
+ * These sensors use I2C to communicate, 2 pins are required to interface.
+ *
+ * Adafruit invests time and resources providing this open source code,
+ * please support Adafruit andopen-source hardware by purchasing products
+ * from Adafruit!
+ *
+ * K.Townsend (Adafruit Industries)
+ *
+ * BSD license, all text above must be included in any redistribution
+ */
+
+#include "Adafruit_BMP280.h"
+#include "Arduino.h"
+#include
+
+/*!
+ * @brief BMP280 constructor using i2c
+ * @param *theWire
+ * optional wire
+ */
+Adafruit_BMP280::Adafruit_BMP280(TwoWire *theWire)
+ : _cs(-1), _mosi(-1), _miso(-1), _sck(-1) {
+ _wire = theWire;
+ temp_sensor = new Adafruit_BMP280_Temp(this);
+ pressure_sensor = new Adafruit_BMP280_Pressure(this);
+}
+
+Adafruit_BMP280::~Adafruit_BMP280(void) {
+ delete temp_sensor;
+ delete pressure_sensor;
+}
+
+/*!
+ * @brief BMP280 constructor using hardware SPI
+ * @param cspin
+ * cs pin number
+ * @param theSPI
+ * optional SPI object
+ */
+Adafruit_BMP280::Adafruit_BMP280(int8_t cspin, SPIClass *theSPI)
+ : _cs(cspin), _mosi(-1), _miso(-1), _sck(-1) {
+ _spi = theSPI;
+ temp_sensor = new Adafruit_BMP280_Temp(this);
+ pressure_sensor = new Adafruit_BMP280_Pressure(this);
+}
+
+/*!
+ * @brief BMP280 constructor using bitbang SPI
+ * @param cspin
+ * The pin to use for CS/SSEL.
+ * @param mosipin
+ * The pin to use for MOSI.
+ * @param misopin
+ * The pin to use for MISO.
+ * @param sckpin
+ * The pin to use for SCK.
+ */
+Adafruit_BMP280::Adafruit_BMP280(int8_t cspin, int8_t mosipin, int8_t misopin,
+ int8_t sckpin)
+ : _cs(cspin), _mosi(mosipin), _miso(misopin), _sck(sckpin) {
+ temp_sensor = new Adafruit_BMP280_Temp(this);
+ pressure_sensor = new Adafruit_BMP280_Pressure(this);
+}
+
+/*!
+ * Initialises the sensor.
+ * @param addr
+ * The I2C address to use (default = 0x77)
+ * @param chipid
+ * The expected chip ID (used to validate connection).
+ * @return True if the init was successful, otherwise false.
+ */
+bool Adafruit_BMP280::begin(uint8_t addr, uint8_t chipid) {
+ _i2caddr = addr;
+
+ if (_cs == -1) {
+ // i2c
+ _wire->begin();
+ } else {
+ digitalWrite(_cs, HIGH);
+ pinMode(_cs, OUTPUT);
+
+ if (_sck == -1) {
+ // hardware SPI
+ _spi->begin();
+ } else {
+ // software SPI
+ pinMode(_sck, OUTPUT);
+ pinMode(_mosi, OUTPUT);
+ pinMode(_miso, INPUT);
+ }
+ }
+
+ if (read8(BMP280_REGISTER_CHIPID) != chipid)
+ return false;
+
+ readCoefficients();
+ // write8(BMP280_REGISTER_CONTROL, 0x3F); /* needed? */
+ setSampling();
+ delay(100);
+ return true;
+}
+
+/*!
+ * Sets the sampling config for the device.
+ * @param mode
+ * The operating mode of the sensor.
+ * @param tempSampling
+ * The sampling scheme for temp readings.
+ * @param pressSampling
+ * The sampling scheme for pressure readings.
+ * @param filter
+ * The filtering mode to apply (if any).
+ * @param duration
+ * The sampling duration.
+ */
+void Adafruit_BMP280::setSampling(sensor_mode mode,
+ sensor_sampling tempSampling,
+ sensor_sampling pressSampling,
+ sensor_filter filter,
+ standby_duration duration) {
+ _measReg.mode = mode;
+ _measReg.osrs_t = tempSampling;
+ _measReg.osrs_p = pressSampling;
+
+ _configReg.filter = filter;
+ _configReg.t_sb = duration;
+
+ write8(BMP280_REGISTER_CONFIG, _configReg.get());
+ write8(BMP280_REGISTER_CONTROL, _measReg.get());
+}
+
+uint8_t Adafruit_BMP280::spixfer(uint8_t x) {
+ if (_sck == -1)
+ return _spi->transfer(x);
+
+ // software spi
+ // Serial.println("Software SPI");
+ uint8_t reply = 0;
+ for (int i = 7; i >= 0; i--) {
+ reply <<= 1;
+ digitalWrite(_sck, LOW);
+ digitalWrite(_mosi, x & (1 << i));
+ digitalWrite(_sck, HIGH);
+ if (digitalRead(_miso))
+ reply |= 1;
+ }
+ return reply;
+}
+
+/**************************************************************************/
+/*!
+ @brief Writes an 8 bit value over I2C/SPI
+*/
+/**************************************************************************/
+void Adafruit_BMP280::write8(byte reg, byte value) {
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->write((uint8_t)value);
+ _wire->endTransmission();
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg & ~0x80); // write, bit 7 low
+ spixfer(value);
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+}
+
+/*!
+ * @brief Reads an 8 bit value over I2C/SPI
+ * @param reg
+ * selected register
+ * @return value from selected register
+ */
+uint8_t Adafruit_BMP280::read8(byte reg) {
+ uint8_t value;
+
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->endTransmission();
+ _wire->requestFrom((uint8_t)_i2caddr, (byte)1);
+ value = _wire->read();
+
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg | 0x80); // read, bit 7 high
+ value = spixfer(0);
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+ return value;
+}
+
+/*!
+ * @brief Reads a 16 bit value over I2C/SPI
+ */
+uint16_t Adafruit_BMP280::read16(byte reg) {
+ uint16_t value;
+
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->endTransmission();
+ _wire->requestFrom((uint8_t)_i2caddr, (byte)2);
+ value = (_wire->read() << 8) | _wire->read();
+
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg | 0x80); // read, bit 7 high
+ value = (spixfer(0) << 8) | spixfer(0);
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+
+ return value;
+}
+
+uint16_t Adafruit_BMP280::read16_LE(byte reg) {
+ uint16_t temp = read16(reg);
+ return (temp >> 8) | (temp << 8);
+}
+
+/*!
+ * @brief Reads a signed 16 bit value over I2C/SPI
+ */
+int16_t Adafruit_BMP280::readS16(byte reg) { return (int16_t)read16(reg); }
+
+int16_t Adafruit_BMP280::readS16_LE(byte reg) {
+ return (int16_t)read16_LE(reg);
+}
+
+/*!
+ * @brief Reads a 24 bit value over I2C/SPI
+ */
+uint32_t Adafruit_BMP280::read24(byte reg) {
+ uint32_t value;
+
+ if (_cs == -1) {
+ _wire->beginTransmission((uint8_t)_i2caddr);
+ _wire->write((uint8_t)reg);
+ _wire->endTransmission();
+ _wire->requestFrom((uint8_t)_i2caddr, (byte)3);
+
+ value = _wire->read();
+ value <<= 8;
+ value |= _wire->read();
+ value <<= 8;
+ value |= _wire->read();
+
+ } else {
+ if (_sck == -1)
+ _spi->beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
+ digitalWrite(_cs, LOW);
+ spixfer(reg | 0x80); // read, bit 7 high
+
+ value = spixfer(0);
+ value <<= 8;
+ value |= spixfer(0);
+ value <<= 8;
+ value |= spixfer(0);
+
+ digitalWrite(_cs, HIGH);
+ if (_sck == -1)
+ _spi->endTransaction(); // release the SPI bus
+ }
+
+ return value;
+}
+
+/*!
+ * @brief Reads the factory-set coefficients
+ */
+void Adafruit_BMP280::readCoefficients() {
+ _bmp280_calib.dig_T1 = read16_LE(BMP280_REGISTER_DIG_T1);
+ _bmp280_calib.dig_T2 = readS16_LE(BMP280_REGISTER_DIG_T2);
+ _bmp280_calib.dig_T3 = readS16_LE(BMP280_REGISTER_DIG_T3);
+
+ _bmp280_calib.dig_P1 = read16_LE(BMP280_REGISTER_DIG_P1);
+ _bmp280_calib.dig_P2 = readS16_LE(BMP280_REGISTER_DIG_P2);
+ _bmp280_calib.dig_P3 = readS16_LE(BMP280_REGISTER_DIG_P3);
+ _bmp280_calib.dig_P4 = readS16_LE(BMP280_REGISTER_DIG_P4);
+ _bmp280_calib.dig_P5 = readS16_LE(BMP280_REGISTER_DIG_P5);
+ _bmp280_calib.dig_P6 = readS16_LE(BMP280_REGISTER_DIG_P6);
+ _bmp280_calib.dig_P7 = readS16_LE(BMP280_REGISTER_DIG_P7);
+ _bmp280_calib.dig_P8 = readS16_LE(BMP280_REGISTER_DIG_P8);
+ _bmp280_calib.dig_P9 = readS16_LE(BMP280_REGISTER_DIG_P9);
+}
+
+/*!
+ * Reads the temperature from the device.
+ * @return The temperature in degress celcius.
+ */
+float Adafruit_BMP280::readTemperature() {
+ int32_t var1, var2;
+
+ int32_t adc_T = read24(BMP280_REGISTER_TEMPDATA);
+ adc_T >>= 4;
+
+ var1 = ((((adc_T >> 3) - ((int32_t)_bmp280_calib.dig_T1 << 1))) *
+ ((int32_t)_bmp280_calib.dig_T2)) >>
+ 11;
+
+ var2 = (((((adc_T >> 4) - ((int32_t)_bmp280_calib.dig_T1)) *
+ ((adc_T >> 4) - ((int32_t)_bmp280_calib.dig_T1))) >>
+ 12) *
+ ((int32_t)_bmp280_calib.dig_T3)) >>
+ 14;
+
+ t_fine = var1 + var2;
+
+ float T = (t_fine * 5 + 128) >> 8;
+ return T / 100;
+}
+
+/*!
+ * Reads the barometric pressure from the device.
+ * @return Barometric pressure in Pa.
+ */
+float Adafruit_BMP280::readPressure() {
+ int64_t var1, var2, p;
+
+ // Must be done first to get the t_fine variable set up
+ readTemperature();
+
+ int32_t adc_P = read24(BMP280_REGISTER_PRESSUREDATA);
+ adc_P >>= 4;
+
+ var1 = ((int64_t)t_fine) - 128000;
+ var2 = var1 * var1 * (int64_t)_bmp280_calib.dig_P6;
+ var2 = var2 + ((var1 * (int64_t)_bmp280_calib.dig_P5) << 17);
+ var2 = var2 + (((int64_t)_bmp280_calib.dig_P4) << 35);
+ var1 = ((var1 * var1 * (int64_t)_bmp280_calib.dig_P3) >> 8) +
+ ((var1 * (int64_t)_bmp280_calib.dig_P2) << 12);
+ var1 =
+ (((((int64_t)1) << 47) + var1)) * ((int64_t)_bmp280_calib.dig_P1) >> 33;
+
+ if (var1 == 0) {
+ return 0; // avoid exception caused by division by zero
+ }
+ p = 1048576 - adc_P;
+ p = (((p << 31) - var2) * 3125) / var1;
+ var1 = (((int64_t)_bmp280_calib.dig_P9) * (p >> 13) * (p >> 13)) >> 25;
+ var2 = (((int64_t)_bmp280_calib.dig_P8) * p) >> 19;
+
+ p = ((p + var1 + var2) >> 8) + (((int64_t)_bmp280_calib.dig_P7) << 4);
+ return (float)p / 256;
+}
+
+/*!
+ * @brief Calculates the approximate altitude using barometric pressure and the
+ * supplied sea level hPa as a reference.
+ * @param seaLevelhPa
+ * The current hPa at sea level.
+ * @return The approximate altitude above sea level in meters.
+ */
+float Adafruit_BMP280::readAltitude(float seaLevelhPa) {
+ float altitude;
+
+ float pressure = readPressure(); // in Si units for Pascal
+ pressure /= 100;
+
+ altitude = 44330 * (1.0 - pow(pressure / seaLevelhPa, 0.1903));
+
+ return altitude;
+}
+
+/*!
+ * Calculates the pressure at sea level (QFH) from the specified altitude,
+ * and atmospheric pressure (QFE).
+ * @param altitude Altitude in m
+ * @param atmospheric Atmospheric pressure in hPa
+ * @return The approximate pressure in hPa
+ */
+float Adafruit_BMP280::seaLevelForAltitude(float altitude, float atmospheric) {
+ // Equation taken from BMP180 datasheet (page 17):
+ // http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf
+
+ // Note that using the equation from wikipedia can give bad results
+ // at high altitude. See this thread for more information:
+ // http://forums.adafruit.com/viewtopic.php?f=22&t=58064
+ return atmospheric / pow(1.0 - (altitude / 44330.0), 5.255);
+}
+
+/*!
+ @brief calculates the boiling point of water by a given pressure
+ @param pressure pressure in hPa
+ @return temperature in °C
+*/
+
+float Adafruit_BMP280::waterBoilingPoint(float pressure) {
+ // Magnusformular for calculation of the boiling point of water at a given
+ // pressure
+ return (234.175 * log(pressure / 6.1078)) /
+ (17.08085 - log(pressure / 6.1078));
+}
+
+/*!
+ * @brief Take a new measurement (only possible in forced mode)
+ * !!!todo!!!
+ */
+/*
+void Adafruit_BMP280::takeForcedMeasurement()
+{
+ // If we are in forced mode, the BME sensor goes back to sleep after each
+ // measurement and we need to set it to forced mode once at this point, so
+ // it will take the next measurement and then return to sleep again.
+ // In normal mode simply does new measurements periodically.
+ if (_measReg.mode == MODE_FORCED) {
+ // set to forced mode, i.e. "take next measurement"
+ write8(BMP280_REGISTER_CONTROL, _measReg.get());
+ // wait until measurement has been completed, otherwise we would read
+ // the values from the last measurement
+ while (read8(BMP280_REGISTER_STATUS) & 0x08)
+ delay(1);
+ }
+}
+*/
+
+/*!
+ * @brief Resets the chip via soft reset
+ */
+void Adafruit_BMP280::reset(void) {
+ write8(BMP280_REGISTER_SOFTRESET, MODE_SOFT_RESET_CODE);
+}
+
+/*!
+ * Returns Sensor ID for diagnostics
+ * @returns 0x61 for BME680, 0x60 for BME280, 0x56, 0x57, 0x58 for BMP280
+ */
+uint8_t Adafruit_BMP280::sensorID(void) {
+ return read8(BMP280_REGISTER_CHIPID);
+};
+
+/*!
+ @brief Gets the most recent sensor event from the hardware status register.
+ @return Sensor status as a byte.
+ */
+uint8_t Adafruit_BMP280::getStatus(void) {
+ return read8(BMP280_REGISTER_STATUS);
+}
+
+/*!
+ @brief Gets an Adafruit Unified Sensor object for the temp sensor component
+ @return Adafruit_Sensor pointer to temperature sensor
+ */
+Adafruit_Sensor *Adafruit_BMP280::getTemperatureSensor(void) {
+ return temp_sensor;
+}
+
+/*!
+ @brief Gets an Adafruit Unified Sensor object for the pressure sensor
+ component
+ @return Adafruit_Sensor pointer to pressure sensor
+ */
+Adafruit_Sensor *Adafruit_BMP280::getPressureSensor(void) {
+ return pressure_sensor;
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the sensor_t data for the BMP280's temperature sensor
+*/
+/**************************************************************************/
+void Adafruit_BMP280_Temp::getSensor(sensor_t *sensor) {
+ /* Clear the sensor_t object */
+ memset(sensor, 0, sizeof(sensor_t));
+
+ /* Insert the sensor name in the fixed length char array */
+ strncpy(sensor->name, "BMP280", sizeof(sensor->name) - 1);
+ sensor->name[sizeof(sensor->name) - 1] = 0;
+ sensor->version = 1;
+ sensor->sensor_id = _sensorID;
+ sensor->type = SENSOR_TYPE_AMBIENT_TEMPERATURE;
+ sensor->min_delay = 0;
+ sensor->min_value = -40.0; /* Temperature range -40 ~ +85 C */
+ sensor->max_value = +85.0;
+ sensor->resolution = 0.01; /* 0.01 C */
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the temperature as a standard sensor event
+ @param event Sensor event object that will be populated
+ @returns True
+*/
+/**************************************************************************/
+bool Adafruit_BMP280_Temp::getEvent(sensors_event_t *event) {
+ /* Clear the event */
+ memset(event, 0, sizeof(sensors_event_t));
+
+ event->version = sizeof(sensors_event_t);
+ event->sensor_id = _sensorID;
+ event->type = SENSOR_TYPE_AMBIENT_TEMPERATURE;
+ event->timestamp = millis();
+ event->temperature = _theBMP280->readTemperature();
+ return true;
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the sensor_t data for the BMP280's pressure sensor
+*/
+/**************************************************************************/
+void Adafruit_BMP280_Pressure::getSensor(sensor_t *sensor) {
+ /* Clear the sensor_t object */
+ memset(sensor, 0, sizeof(sensor_t));
+
+ /* Insert the sensor name in the fixed length char array */
+ strncpy(sensor->name, "BMP280", sizeof(sensor->name) - 1);
+ sensor->name[sizeof(sensor->name) - 1] = 0;
+ sensor->version = 1;
+ sensor->sensor_id = _sensorID;
+ sensor->type = SENSOR_TYPE_PRESSURE;
+ sensor->min_delay = 0;
+ sensor->min_value = 300.0; /* 300 ~ 1100 hPa */
+ sensor->max_value = 1100.0;
+ sensor->resolution = 0.012; /* 0.12 hPa relative */
+}
+
+/**************************************************************************/
+/*!
+ @brief Gets the pressure as a standard sensor event
+ @param event Sensor event object that will be populated
+ @returns True
+*/
+/**************************************************************************/
+bool Adafruit_BMP280_Pressure::getEvent(sensors_event_t *event) {
+ /* Clear the event */
+ memset(event, 0, sizeof(sensors_event_t));
+
+ event->version = sizeof(sensors_event_t);
+ event->sensor_id = _sensorID;
+ event->type = SENSOR_TYPE_PRESSURE;
+ event->timestamp = millis();
+ event->pressure = _theBMP280->readPressure() / 100; // convert Pa to hPa
+ return true;
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.h
index 3fe8873920838a1725a5c025971c71e117d8ba61..c699c9824fd534657745c0ae62b2c8b40419c22b 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_BMP280.h
@@ -1,3 +1,264 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:caedad55516e20860927d64a6ab7d1bfd1d16410d8c5ea19fe448603619ffa91
-size 7868
+/*!
+ * @file Adafruit_BMP280.h
+ *
+ * This is a library for the Adafruit BMP280 Breakout.
+ *
+ * Designed specifically to work with the Adafruit BMP280 Breakout.
+ *
+ * Pick one up today in the adafruit shop!
+ * ------> https://www.adafruit.com/product/2651
+ *
+ * These sensors use I2C to communicate, 2 pins are required to interface.
+ *
+ * Adafruit invests time and resources providing this open source code,
+ * please support Adafruit andopen-source hardware by purchasing products
+ * from Adafruit!
+ *
+ * K.Townsend (Adafruit Industries)
+ *
+ * BSD license, all text above must be included in any redistribution
+ */
+#ifndef __BMP280_H__
+#define __BMP280_H__
+
+#include "Adafruit_Sensor.h"
+#include "Arduino.h"
+#include
+#include
+
+/*!
+ * I2C ADDRESS/BITS/SETTINGS
+ */
+#define BMP280_ADDRESS (0x77) /**< The default I2C address for the sensor. */
+#define BMP280_ADDRESS_ALT \
+ (0x76) /**< Alternative I2C address for the sensor. */
+#define BMP280_CHIPID (0x58) /**< Default chip ID. */
+
+// Forward declarations of Wire and SPI for board/variant combinations that
+// don't have a default 'Wire' or 'SPI'
+extern TwoWire Wire; /**< Forward declaration of Wire object */
+extern SPIClass SPI; /**< Forward declaration of SPI object */
+
+/*!
+ * Registers available on the sensor.
+ */
+enum {
+ BMP280_REGISTER_DIG_T1 = 0x88,
+ BMP280_REGISTER_DIG_T2 = 0x8A,
+ BMP280_REGISTER_DIG_T3 = 0x8C,
+ BMP280_REGISTER_DIG_P1 = 0x8E,
+ BMP280_REGISTER_DIG_P2 = 0x90,
+ BMP280_REGISTER_DIG_P3 = 0x92,
+ BMP280_REGISTER_DIG_P4 = 0x94,
+ BMP280_REGISTER_DIG_P5 = 0x96,
+ BMP280_REGISTER_DIG_P6 = 0x98,
+ BMP280_REGISTER_DIG_P7 = 0x9A,
+ BMP280_REGISTER_DIG_P8 = 0x9C,
+ BMP280_REGISTER_DIG_P9 = 0x9E,
+ BMP280_REGISTER_CHIPID = 0xD0,
+ BMP280_REGISTER_VERSION = 0xD1,
+ BMP280_REGISTER_SOFTRESET = 0xE0,
+ BMP280_REGISTER_CAL26 = 0xE1, /**< R calibration = 0xE1-0xF0 */
+ BMP280_REGISTER_STATUS = 0xF3,
+ BMP280_REGISTER_CONTROL = 0xF4,
+ BMP280_REGISTER_CONFIG = 0xF5,
+ BMP280_REGISTER_PRESSUREDATA = 0xF7,
+ BMP280_REGISTER_TEMPDATA = 0xFA,
+};
+
+/*!
+ * Struct to hold calibration data.
+ */
+typedef struct {
+ uint16_t dig_T1; /**< dig_T1 cal register. */
+ int16_t dig_T2; /**< dig_T2 cal register. */
+ int16_t dig_T3; /**< dig_T3 cal register. */
+
+ uint16_t dig_P1; /**< dig_P1 cal register. */
+ int16_t dig_P2; /**< dig_P2 cal register. */
+ int16_t dig_P3; /**< dig_P3 cal register. */
+ int16_t dig_P4; /**< dig_P4 cal register. */
+ int16_t dig_P5; /**< dig_P5 cal register. */
+ int16_t dig_P6; /**< dig_P6 cal register. */
+ int16_t dig_P7; /**< dig_P7 cal register. */
+ int16_t dig_P8; /**< dig_P8 cal register. */
+ int16_t dig_P9; /**< dig_P9 cal register. */
+} bmp280_calib_data;
+
+class Adafruit_BMP280;
+
+/** Adafruit Unified Sensor interface for temperature component of BMP280 */
+class Adafruit_BMP280_Temp : public Adafruit_Sensor {
+public:
+ /** @brief Create an Adafruit_Sensor compatible object for the temp sensor
+ @param parent A pointer to the BMP280 class */
+ Adafruit_BMP280_Temp(Adafruit_BMP280 *parent) { _theBMP280 = parent; }
+ bool getEvent(sensors_event_t *);
+ void getSensor(sensor_t *);
+
+private:
+ int _sensorID = 280;
+ Adafruit_BMP280 *_theBMP280 = NULL;
+};
+
+/** Adafruit Unified Sensor interface for pressure component of BMP280 */
+class Adafruit_BMP280_Pressure : public Adafruit_Sensor {
+public:
+ /** @brief Create an Adafruit_Sensor compatible object for the pressure sensor
+ @param parent A pointer to the BMP280 class */
+ Adafruit_BMP280_Pressure(Adafruit_BMP280 *parent) { _theBMP280 = parent; }
+ bool getEvent(sensors_event_t *);
+ void getSensor(sensor_t *);
+
+private:
+ int _sensorID = 0;
+ Adafruit_BMP280 *_theBMP280 = NULL;
+};
+
+/**
+ * Driver for the Adafruit BMP280 barometric pressure sensor.
+ */
+class Adafruit_BMP280 {
+public:
+ /** Oversampling rate for the sensor. */
+ enum sensor_sampling {
+ /** No over-sampling. */
+ SAMPLING_NONE = 0x00,
+ /** 1x over-sampling. */
+ SAMPLING_X1 = 0x01,
+ /** 2x over-sampling. */
+ SAMPLING_X2 = 0x02,
+ /** 4x over-sampling. */
+ SAMPLING_X4 = 0x03,
+ /** 8x over-sampling. */
+ SAMPLING_X8 = 0x04,
+ /** 16x over-sampling. */
+ SAMPLING_X16 = 0x05
+ };
+
+ /** Operating mode for the sensor. */
+ enum sensor_mode {
+ /** Sleep mode. */
+ MODE_SLEEP = 0x00,
+ /** Forced mode. */
+ MODE_FORCED = 0x01,
+ /** Normal mode. */
+ MODE_NORMAL = 0x03,
+ /** Software reset. */
+ MODE_SOFT_RESET_CODE = 0xB6
+ };
+
+ /** Filtering level for sensor data. */
+ enum sensor_filter {
+ /** No filtering. */
+ FILTER_OFF = 0x00,
+ /** 2x filtering. */
+ FILTER_X2 = 0x01,
+ /** 4x filtering. */
+ FILTER_X4 = 0x02,
+ /** 8x filtering. */
+ FILTER_X8 = 0x03,
+ /** 16x filtering. */
+ FILTER_X16 = 0x04
+ };
+
+ /** Standby duration in ms */
+ enum standby_duration {
+ /** 1 ms standby. */
+ STANDBY_MS_1 = 0x00,
+ /** 62.5 ms standby. */
+ STANDBY_MS_63 = 0x01,
+ /** 125 ms standby. */
+ STANDBY_MS_125 = 0x02,
+ /** 250 ms standby. */
+ STANDBY_MS_250 = 0x03,
+ /** 500 ms standby. */
+ STANDBY_MS_500 = 0x04,
+ /** 1000 ms standby. */
+ STANDBY_MS_1000 = 0x05,
+ /** 2000 ms standby. */
+ STANDBY_MS_2000 = 0x06,
+ /** 4000 ms standby. */
+ STANDBY_MS_4000 = 0x07
+ };
+
+ Adafruit_BMP280(TwoWire *theWire = &Wire);
+ Adafruit_BMP280(int8_t cspin, SPIClass *theSPI = &SPI);
+ Adafruit_BMP280(int8_t cspin, int8_t mosipin, int8_t misopin, int8_t sckpin);
+ ~Adafruit_BMP280(void);
+
+ bool begin(uint8_t addr = BMP280_ADDRESS, uint8_t chipid = BMP280_CHIPID);
+ void reset(void);
+ uint8_t getStatus(void);
+ uint8_t sensorID(void);
+
+ float readTemperature();
+ float readPressure(void);
+ float readAltitude(float seaLevelhPa = 1013.25);
+ float seaLevelForAltitude(float altitude, float atmospheric);
+ float waterBoilingPoint(float pressure);
+
+ Adafruit_Sensor *getTemperatureSensor(void);
+ Adafruit_Sensor *getPressureSensor(void);
+
+ // void takeForcedMeasurement();
+ void setSampling(sensor_mode mode = MODE_NORMAL,
+ sensor_sampling tempSampling = SAMPLING_X16,
+ sensor_sampling pressSampling = SAMPLING_X16,
+ sensor_filter filter = FILTER_OFF,
+ standby_duration duration = STANDBY_MS_1);
+
+private:
+ TwoWire *_wire; /**< Wire object */
+ SPIClass *_spi; /**< SPI object */
+
+ Adafruit_BMP280_Temp *temp_sensor = NULL;
+ Adafruit_BMP280_Pressure *pressure_sensor = NULL;
+
+ /** Encapsulates the config register */
+ struct config {
+ /** Inactive duration (standby time) in normal mode */
+ unsigned int t_sb : 3;
+ /** Filter settings */
+ unsigned int filter : 3;
+ /** Unused - don't set */
+ unsigned int none : 1;
+ /** Enables 3-wire SPI */
+ unsigned int spi3w_en : 1;
+ /** Used to retrieve the assembled config register's byte value. */
+ unsigned int get() { return (t_sb << 5) | (filter << 2) | spi3w_en; }
+ };
+
+ /** Encapsulates trhe ctrl_meas register */
+ struct ctrl_meas {
+ /** Temperature oversampling. */
+ unsigned int osrs_t : 3;
+ /** Pressure oversampling. */
+ unsigned int osrs_p : 3;
+ /** Device mode */
+ unsigned int mode : 2;
+ /** Used to retrieve the assembled ctrl_meas register's byte value. */
+ unsigned int get() { return (osrs_t << 5) | (osrs_p << 2) | mode; }
+ };
+
+ void readCoefficients(void);
+ uint8_t spixfer(uint8_t x);
+ void write8(byte reg, byte value);
+ uint8_t read8(byte reg);
+ uint16_t read16(byte reg);
+ uint32_t read24(byte reg);
+ int16_t readS16(byte reg);
+ uint16_t read16_LE(byte reg);
+ int16_t readS16_LE(byte reg);
+
+ uint8_t _i2caddr;
+
+ int32_t _sensorID;
+ int32_t t_fine;
+ int8_t _cs, _mosi, _miso, _sck;
+ bmp280_calib_data _bmp280_calib;
+ config _configReg;
+ ctrl_meas _measReg;
+};
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.cpp
index e9b2bb2bf65ae7a15cd0216c1beee4fdfaec3605..2a4513e0ec0557924ca1bf00c93a82a8c8110247 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.cpp
@@ -1,3 +1,78 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bb8d13aa96c7648cea16eeee46915b1fb12d0b3f5a210d694b2f7476c5cfca82
-size 2344
+#include "Adafruit_Sensor.h"
+
+/**************************************************************************/
+/*!
+ @brief Prints sensor information to serial console
+*/
+/**************************************************************************/
+void Adafruit_Sensor::printSensorDetails(void) {
+ sensor_t sensor;
+ getSensor(&sensor);
+ Serial.println(F("------------------------------------"));
+ Serial.print(F("Sensor: "));
+ Serial.println(sensor.name);
+ Serial.print(F("Type: "));
+ switch ((sensors_type_t)sensor.type) {
+ case SENSOR_TYPE_ACCELEROMETER:
+ Serial.print(F("Acceleration (m/s2)"));
+ break;
+ case SENSOR_TYPE_MAGNETIC_FIELD:
+ Serial.print(F("Magnetic (uT)"));
+ break;
+ case SENSOR_TYPE_ORIENTATION:
+ Serial.print(F("Orientation (degrees)"));
+ break;
+ case SENSOR_TYPE_GYROSCOPE:
+ Serial.print(F("Gyroscopic (rad/s)"));
+ break;
+ case SENSOR_TYPE_LIGHT:
+ Serial.print(F("Light (lux)"));
+ break;
+ case SENSOR_TYPE_PRESSURE:
+ Serial.print(F("Pressure (hPa)"));
+ break;
+ case SENSOR_TYPE_PROXIMITY:
+ Serial.print(F("Distance (cm)"));
+ break;
+ case SENSOR_TYPE_GRAVITY:
+ Serial.print(F("Gravity (m/s2)"));
+ break;
+ case SENSOR_TYPE_LINEAR_ACCELERATION:
+ Serial.print(F("Linear Acceleration (m/s2)"));
+ break;
+ case SENSOR_TYPE_ROTATION_VECTOR:
+ Serial.print(F("Rotation vector"));
+ break;
+ case SENSOR_TYPE_RELATIVE_HUMIDITY:
+ Serial.print(F("Relative Humidity (%)"));
+ break;
+ case SENSOR_TYPE_AMBIENT_TEMPERATURE:
+ Serial.print(F("Ambient Temp (C)"));
+ break;
+ case SENSOR_TYPE_OBJECT_TEMPERATURE:
+ Serial.print(F("Object Temp (C)"));
+ break;
+ case SENSOR_TYPE_VOLTAGE:
+ Serial.print(F("Voltage (V)"));
+ break;
+ case SENSOR_TYPE_CURRENT:
+ Serial.print(F("Current (mA)"));
+ break;
+ case SENSOR_TYPE_COLOR:
+ Serial.print(F("Color (RGBA)"));
+ break;
+ }
+
+ Serial.println();
+ Serial.print(F("Driver Ver: "));
+ Serial.println(sensor.version);
+ Serial.print(F("Unique ID: "));
+ Serial.println(sensor.sensor_id);
+ Serial.print(F("Min Value: "));
+ Serial.println(sensor.min_value);
+ Serial.print(F("Max Value: "));
+ Serial.println(sensor.max_value);
+ Serial.print(F("Resolution: "));
+ Serial.println(sensor.resolution);
+ Serial.println(F("------------------------------------\n"));
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.h
index 9978a1559c508bece1b3cc10b9508546f485f525..087eda5a3f8c07eae22b7796c568553ee3b0285e 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/Adafruit_Sensor.h
@@ -1,3 +1,188 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:54360875ddb5850a4f68991fb522ea72b620226c84f0d21a88d7268cea0b9307
-size 7781
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software< /span>
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Update by K. Townsend (Adafruit Industries) for lighter typedefs, and
+ * extended sensor support to include color, voltage and current */
+
+#ifndef _ADAFRUIT_SENSOR_H
+#define _ADAFRUIT_SENSOR_H
+
+#ifndef ARDUINO
+#include
+#elif ARDUINO >= 100
+#include "Arduino.h"
+#include "Print.h"
+#else
+#include "WProgram.h"
+#endif
+
+/* Constants */
+#define SENSORS_GRAVITY_EARTH (9.80665F) /**< Earth's gravity in m/s^2 */
+#define SENSORS_GRAVITY_MOON (1.6F) /**< The moon's gravity in m/s^2 */
+#define SENSORS_GRAVITY_SUN (275.0F) /**< The sun's gravity in m/s^2 */
+#define SENSORS_GRAVITY_STANDARD (SENSORS_GRAVITY_EARTH)
+#define SENSORS_MAGFIELD_EARTH_MAX \
+ (60.0F) /**< Maximum magnetic field on Earth's surface */
+#define SENSORS_MAGFIELD_EARTH_MIN \
+ (30.0F) /**< Minimum magnetic field on Earth's surface */
+#define SENSORS_PRESSURE_SEALEVELHPA \
+ (1013.25F) /**< Average sea level pressure is 1013.25 hPa */
+#define SENSORS_DPS_TO_RADS \
+ (0.017453293F) /**< Degrees/s to rad/s multiplier \
+ */
+#define SENSORS_RADS_TO_DPS \
+ (57.29577793F) /**< Rad/s to degrees/s multiplier */
+#define SENSORS_GAUSS_TO_MICROTESLA \
+ (100) /**< Gauss to micro-Tesla multiplier */
+
+/** Sensor types */
+typedef enum {
+ SENSOR_TYPE_ACCELEROMETER = (1), /**< Gravity + linear acceleration */
+ SENSOR_TYPE_MAGNETIC_FIELD = (2),
+ SENSOR_TYPE_ORIENTATION = (3),
+ SENSOR_TYPE_GYROSCOPE = (4),
+ SENSOR_TYPE_LIGHT = (5),
+ SENSOR_TYPE_PRESSURE = (6),
+ SENSOR_TYPE_PROXIMITY = (8),
+ SENSOR_TYPE_GRAVITY = (9),
+ SENSOR_TYPE_LINEAR_ACCELERATION =
+ (10), /**< Acceleration not including gravity */
+ SENSOR_TYPE_ROTATION_VECTOR = (11),
+ SENSOR_TYPE_RELATIVE_HUMIDITY = (12),
+ SENSOR_TYPE_AMBIENT_TEMPERATURE = (13),
+ SENSOR_TYPE_OBJECT_TEMPERATURE = (14),
+ SENSOR_TYPE_VOLTAGE = (15),
+ SENSOR_TYPE_CURRENT = (16),
+ SENSOR_TYPE_COLOR = (17)
+} sensors_type_t;
+
+/** struct sensors_vec_s is used to return a vector in a common format. */
+typedef struct {
+ union {
+ float v[3]; ///< 3D vector elements
+ struct {
+ float x; ///< X component of vector
+ float y; ///< Y component of vector
+ float z; ///< Z component of vector
+ }; ///< Struct for holding XYZ component
+ /* Orientation sensors */
+ struct {
+ float roll; /**< Rotation around the longitudinal axis (the plane body, 'X
+ axis'). Roll is positive and increasing when moving
+ downward. -90 degrees <= roll <= 90 degrees */
+ float pitch; /**< Rotation around the lateral axis (the wing span, 'Y
+ axis'). Pitch is positive and increasing when moving
+ upwards. -180 degrees <= pitch <= 180 degrees) */
+ float heading; /**< Angle between the longitudinal axis (the plane body)
+ and magnetic north, measured clockwise when viewing from
+ the top of the device. 0-359 degrees */
+ }; ///< Struct for holding roll/pitch/heading
+ }; ///< Union that can hold 3D vector array, XYZ components or
+ ///< roll/pitch/heading
+ int8_t status; ///< Status byte
+ uint8_t reserved[3]; ///< Reserved
+} sensors_vec_t;
+
+/** struct sensors_color_s is used to return color data in a common format. */
+typedef struct {
+ union {
+ float c[3]; ///< Raw 3-element data
+ /* RGB color space */
+ struct {
+ float r; /**< Red component */
+ float g; /**< Green component */
+ float b; /**< Blue component */
+ }; ///< RGB data in floating point notation
+ }; ///< Union of various ways to describe RGB colorspace
+ uint32_t rgba; /**< 24-bit RGBA value */
+} sensors_color_t;
+
+/* Sensor event (36 bytes) */
+/** struct sensor_event_s is used to provide a single sensor event in a common
+ * format. */
+typedef struct {
+ int32_t version; /**< must be sizeof(struct sensors_event_t) */
+ int32_t sensor_id; /**< unique sensor identifier */
+ int32_t type; /**< sensor type */
+ int32_t reserved0; /**< reserved */
+ int32_t timestamp; /**< time is in milliseconds */
+ union {
+ float data[4]; ///< Raw data
+ sensors_vec_t acceleration; /**< acceleration values are in meter per second
+ per second (m/s^2) */
+ sensors_vec_t
+ magnetic; /**< magnetic vector values are in micro-Tesla (uT) */
+ sensors_vec_t orientation; /**< orientation values are in degrees */
+ sensors_vec_t gyro; /**< gyroscope values are in rad/s */
+ float temperature; /**< temperature is in degrees centigrade (Celsius) */
+ float distance; /**< distance in centimeters */
+ float light; /**< light in SI lux units */
+ float pressure; /**< pressure in hectopascal (hPa) */
+ float relative_humidity; /**< relative humidity in percent */
+ float current; /**< current in milliamps (mA) */
+ float voltage; /**< voltage in volts (V) */
+ sensors_color_t color; /**< color in RGB component values */
+ }; ///< Union for the wide ranges of data we can carry
+} sensors_event_t;
+
+/* Sensor details (40 bytes) */
+/** struct sensor_s is used to describe basic information about a specific
+ * sensor. */
+typedef struct {
+ char name[12]; /**< sensor name */
+ int32_t version; /**< version of the hardware + driver */
+ int32_t sensor_id; /**< unique sensor identifier */
+ int32_t type; /**< this sensor's type (ex. SENSOR_TYPE_LIGHT) */
+ float max_value; /**< maximum value of this sensor's value in SI units */
+ float min_value; /**< minimum value of this sensor's value in SI units */
+ float resolution; /**< smallest difference between two values reported by this
+ sensor */
+ int32_t min_delay; /**< min delay in microseconds between events. zero = not a
+ constant rate */
+} sensor_t;
+
+/** @brief Common sensor interface to unify various sensors.
+ * Intentionally modeled after sensors.h in the Android API:
+ * https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/sensors.h
+ */
+class Adafruit_Sensor {
+public:
+ // Constructor(s)
+ Adafruit_Sensor() {}
+ virtual ~Adafruit_Sensor() {}
+
+ // These must be defined by the subclass
+
+ /*! @brief Whether we should automatically change the range (if possible) for
+ higher precision
+ @param enabled True if we will try to autorange */
+ virtual void enableAutoRange(bool enabled) {
+ (void)enabled; /* suppress unused warning */
+ };
+
+ /*! @brief Get the latest sensor event
+ @returns True if able to fetch an event */
+ virtual bool getEvent(sensors_event_t *) = 0;
+ /*! @brief Get info about the sensor itself */
+ virtual void getSensor(sensor_t *) = 0;
+
+ void printSensorDetails(void);
+
+private:
+ bool _autoRange;
+};
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.h
index 9f45790316d960364f45f4d7dd4aa4de066a0792..ecc3a65045b7239889413c762eb4bf0fda31daa5 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.h
@@ -1,3 +1,21 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c271a1c25ed3e1367ce975febdb952be54dc3a70a2ee9400a621fd33fd375227
-size 940
+#pragma once
+
+#include
+#include
+#include
+#include
+
+#ifndef __ADAFRUIT_BMP280_H__
+#define __ADAFRUIT_BMP280_H__
+
+class BMP280 : public Adafruit_BMP280
+ { public:
+ bool operator()(float trigger) { return readPressure() >= trigger; }
+ // These functions are wrapped here as we want the Pressure value in
+ // hPa not in Pa, for consistence with BME280 active component setting.
+ float readPressure(void) { return Adafruit_BMP280::readPressure()/100.0; }
+ float readAltitude(float seaLevel=1013.25) { return Adafruit_BMP280::readAltitude(seaLevel); }
+ float readSealevelPressure(float altitude=0.0,float seaLevel=1013.25) { return (float) Adafruit_BMP280::seaLevelForAltitude(altitude,seaLevel); }
+ };
+
+#endif
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.xml
index 4b72f42fc115c7af486679a9116779cf46b37b6b..a72b28ebad1b2cd33d1c5637d26aa2c10301e1d7 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/BMP280/bmp280.xml
@@ -1,3 +1,31 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6c0c5bd8d492d8e9f1a1d1366afd00d517b708cf36d0e246982a14a62dd8ad90
-size 1423
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.cpp
index 4125e345d6b2a1bd02dfd88a27e92f570bd512c4..61e589675861a8f8abb9d6e46688d269f31e01f4 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.cpp
@@ -1,3 +1,175 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c35edc879994b8970fd6d7dc508c73ccbc4a89c52cfa7918d6fdb94ca2fe977a
-size 5454
+/*
+ * Copyright (C) 2012 Paulo Marques (pjp.marques@gmail.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/* Information about the P9813 protocol obtained from:
+ * http://www.seeedstudio.com/wiki/index.php?title=Twig_-_Chainable_RGB_LED
+ *
+ * HSB to RGB routine adapted from:
+ * http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
+ */
+
+
+// --------------------------------------------------------------------------------------
+
+#include "ChainableLED.h"
+
+// Forward declaration
+float hue2rgb(float p, float q, float t);
+
+// --------------------------------------------------------------------------------------
+
+ChainableLED::ChainableLED(byte clk_pin, byte data_pin, byte number_of_leds) :
+ _clk_pin(clk_pin), _data_pin(data_pin), _num_leds(number_of_leds)
+{
+ _led_state = (byte*) calloc(_num_leds*3, sizeof(byte));
+}
+
+ChainableLED::~ChainableLED()
+{
+ free(_led_state);
+}
+
+// --------------------------------------------------------------------------------------
+
+void ChainableLED::init()
+{
+ pinMode(_clk_pin, OUTPUT);
+ pinMode(_data_pin, OUTPUT);
+
+ for (byte i=0; i<_num_leds; i++)
+ setColorRGB(i, 0, 0, 0);
+}
+
+void ChainableLED::clk(void)
+{
+ digitalWrite(_clk_pin, LOW);
+ delayMicroseconds(_CLK_PULSE_DELAY);
+ digitalWrite(_clk_pin, HIGH);
+ delayMicroseconds(_CLK_PULSE_DELAY);
+}
+
+void ChainableLED::sendByte(byte b)
+{
+ // Send one bit at a time, starting with the MSB
+ for (byte i=0; i<8; i++)
+ {
+ // If MSB is 1, write one and clock it, else write 0 and clock
+ if ((b & 0x80) != 0)
+ digitalWrite(_data_pin, HIGH);
+ else
+ digitalWrite(_data_pin, LOW);
+ clk();
+
+ // Advance to the next bit to send
+ b <<= 1;
+ }
+}
+
+void ChainableLED::sendColor(byte red, byte green, byte blue)
+{
+ // Start by sending a byte with the format "1 1 /B7 /B6 /G7 /G6 /R7 /R6"
+ byte prefix = 0b11000000;
+ if ((blue & 0x80) == 0) prefix|= 0b00100000;
+ if ((blue & 0x40) == 0) prefix|= 0b00010000;
+ if ((green & 0x80) == 0) prefix|= 0b00001000;
+ if ((green & 0x40) == 0) prefix|= 0b00000100;
+ if ((red & 0x80) == 0) prefix|= 0b00000010;
+ if ((red & 0x40) == 0) prefix|= 0b00000001;
+ sendByte(prefix);
+
+ // Now must send the 3 colors
+ sendByte(blue);
+ sendByte(green);
+ sendByte(red);
+}
+
+void ChainableLED::setColorRGB(byte led, byte red, byte green, byte blue)
+{
+ // Send data frame prefix (32x "0")
+ sendByte(0x00);
+ sendByte(0x00);
+ sendByte(0x00);
+ sendByte(0x00);
+
+ // Send color data for each one of the leds
+ for (byte i=0; i<_num_leds; i++)
+ {
+ if (i == led)
+ {
+ _led_state[i*3 + _CL_RED] = red;
+ _led_state[i*3 + _CL_GREEN] = green;
+ _led_state[i*3 + _CL_BLUE] = blue;
+ }
+
+ sendColor(_led_state[i*3 + _CL_RED],
+ _led_state[i*3 + _CL_GREEN],
+ _led_state[i*3 + _CL_BLUE]);
+ }
+
+ // Terminate data frame (32x "0")
+ sendByte(0x00);
+ sendByte(0x00);
+ sendByte(0x00);
+ sendByte(0x00);
+}
+
+void ChainableLED::setColorHSB(byte led, float hue, float saturation, float brightness)
+{
+ float r, g, b;
+
+ constrain(hue, 0.0, 1.0);
+ constrain(saturation, 0.0, 1.0);
+ constrain(brightness, 0.0, 1.0);
+
+ if(saturation == 0.0)
+ {
+ r = g = b = brightness;
+ }
+ else
+ {
+ float q = brightness < 0.5 ?
+ brightness * (1.0 + saturation) : brightness + saturation - brightness * saturation;
+ float p = 2.0 * brightness - q;
+ r = hue2rgb(p, q, hue + 1.0/3.0);
+ g = hue2rgb(p, q, hue);
+ b = hue2rgb(p, q, hue - 1.0/3.0);
+ }
+
+ setColorRGB(led, (byte)(255.0*r), (byte)(255.0*g), (byte)(255.0*b));
+}
+
+// --------------------------------------------------------------------------------------
+
+float hue2rgb(float p, float q, float t)
+{
+ if (t < 0.0)
+ t += 1.0;
+ if(t > 1.0)
+ t -= 1.0;
+ if(t < 1.0/6.0)
+ return p + (q - p) * 6.0 * t;
+ if(t < 1.0/2.0)
+ return q;
+ if(t < 2.0/3.0)
+ return p + (q - p) * (2.0/3.0 - t) * 6.0;
+
+ return p;
+}
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.h b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.h
index 9e6ab5e529694e6143711f232347f4ae5c675a37..f2dde1b7c9179c117f0eadfca5269bb28c32092d 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.h
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.h
@@ -1,3 +1,69 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:61d4eeaad6f6c736015dd223a07f6e44ea9d41f74701764a7bfcb5a255a65b7f
-size 2124
+/*
+Copyright (C) 2012 Paulo Marques (pjp.marques@gmail.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*
+ * Library for controlling a chain of RGB LEDs based on the P9813 protocol.
+ * E.g., supports the Grove Chainable RGB LED product.
+ *
+ * Information about the P9813 protocol obtained from:
+ * http://www.seeedstudio.com/wiki/index.php?title=Twig_-_Chainable_RGB_LED
+ */
+
+
+
+#ifndef __ChainableLED_h__
+#define __ChainableLED_h__
+
+#if defined (SPARK)
+ #include "application.h"
+#else
+ #include "Arduino.h"
+#endif
+
+#define _CL_RED 0
+#define _CL_GREEN 1
+#define _CL_BLUE 2
+#define _CLK_PULSE_DELAY 20
+
+class ChainableLED
+{
+public:
+ ChainableLED(byte clk_pin, byte data_pin, byte number_of_leds=1);
+ ~ChainableLED();
+
+ void init();
+ void setColorRGB(byte led, byte red, byte green, byte blue);
+ void setColorHSB(byte led, float hue, float saturation, float brightness);
+
+private:
+ byte _clk_pin;
+ byte _data_pin;
+ byte _num_leds;
+
+ byte* _led_state;
+
+ void clk(void);
+ void sendByte(byte b);
+ void sendColor(byte red, byte green, byte blue);
+};
+
+#endif
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.xml b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.xml
index 0d6b99af639624c6d848fd1498ce3a8bf5d67639..bbc8e9f8e432558fe936f96cb1dfa9b52fe8e8cb 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.xml
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/ChainableLED/ChainableLED.xml
@@ -1,3 +1,16 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1288880bd613e7a78d1ee494882d205301e1bde40a0030caf87d16260b277a33
-size 925
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/BarChart.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/BarChart.cpp
index 433b351c0a6b4c4d910014377aac59adde39a3f7..7d8d4551f93f69d7094fbd13dd83d39ab6f6cac9 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/BarChart.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/BarChart.cpp
@@ -1,3 +1,105 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:882167d7a6a7a029e9ab3c58f107590cd8a7dd9a0b78c0e470b69d08ef4dfe8b
-size 3040
+#include "core.h"
+#include "vfpserver.h"
+#include "filestore.h"
+#include "controls.h"
+
+/***********************************************************************
+ **** BarChart ****
+ *****************/
+
+// A series holds totals for each of the declared catagories for the
+// BarChart.
+
+BarChart::BarChart (const char *id)
+: Control (id),
+ catCount (-1),
+ activeSeries (NULL)
+ { setDelimiter(',');
+ }
+
+BarChart::~BarChart()
+ { if (activeSeries != NULL)
+ { free (activeSeries);
+ }
+ }
+
+// This is used to obtain info from the js config. Here the memory for
+// the series is allocated and initialised.
+void BarChart::init (int _catCount)
+ { catCount = _catCount;
+ activeSeries = (float *) malloc (sizeof(float) * _catCount);
+ for (uint8_t i = 0; i < catCount; ++i)
+ { activeSeries[i] = 0.0f;
+ }
+ }
+
+// Called on client-reconnect. Only properties not set with "VFP.set" need be refreshed.
+void BarChart::reload()
+ { for (uint8_t i = 0; i < catCount; ++i)
+ { VFP.call(id, F("setData")).arg(0).arg(i).arg(activeSeries[i]).end();
+ }
+ }
+
+// Show or hide a series.
+void BarChart::setSeriesVisible (uint8_t seriesIdx, bool visible)
+ { String key = F("seriesVisible");
+ VFP.set(id, key).arg(seriesIdx).arg(visible).end();
+ }
+
+// Set suggested min and max values for the y-axis.
+void BarChart::setYRange (float min, float max)
+ { String key = F("YRange");
+ VFP.set(id, key).arg(min).arg(max).end();
+ }
+
+// TODO: When is this called? Can we rely on it?
+void BarChart::clearData()
+ { VFP.call(id, F("clearData")).end();
+ VFP.erase(id);
+ }
+
+// Increment a data point in the activeSeries
+void BarChart::incrementData(uint8_t catIdx, float amount)
+ { if (catIdx < catCount)
+ { setData (catIdx, activeSeries[catIdx] + amount);
+ }
+ }
+
+// Overwrite a data point
+void BarChart::setData(uint8_t catIdx, float value)
+ { if (catIdx < catCount)
+ { VFP.call(id, F("setData")).arg(0).arg(catIdx).arg(value).end();
+ activeSeries[catIdx] = value;
+ }
+ }
+
+// Reset the data for the series seriesIdx to 0.
+void BarChart::resetSeries(uint8_t seriesIdx)
+ { VFP.call(id, F("clearSeriesData")).arg(seriesIdx).end();
+ if (seriesIdx == 0)
+ { for (int i = 0; i < catCount; ++i)
+ { activeSeries[i] = 0.0f;
+ }
+ }
+ }
+
+// Write series seriesIdx to a named file.
+void BarChart::writeSeries(String filename)
+ { if (FS(filename))
+ { FS.remove(filename);
+ }
+ Handle fh = FS.open(filename, FILE_WRITE);
+ for (int i = 0; i < catCount; ++i)
+ { FS.println(fh).arg(String(activeSeries[i])).end();
+ }
+ FS.close(fh);
+ }
+
+// Instruct the js to load the data from file "filename" into the series
+// of index seriesIdx (provided that that isn't 0)
+void BarChart::loadSeries(uint8_t seriesIdx, String filename)
+ { VFP.set(id, F("SeriesDataFile")).arg(seriesIdx).arg(filename).end();
+ // TODO: what if seriesIdx == 0? Should we load the activeSeries?
+ // This would require code to read the files.
+ }
+
diff --git a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/Clock.cpp b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/Clock.cpp
index 9561d4de7f8cd9154669475496328459b35f6730..3abd0d02d497e806d786dadf04b1fa1dce8076b8 100644
--- a/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/Clock.cpp
+++ b/Proteus 8 Professional/DATA/VSM Studio/drivers/arduino/Controls/Clock.cpp
@@ -1,3 +1,103 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3b819e5a5e3f9095f62ec108d067bdadd978f7e1ff4bf910299a6b166c51ea02
-size 3151
+/********************************************************************/
+/********************************************************************/
+/***** *****/
+/***** L A B C E N T E R E L E C T R O N I C S *****/
+/***** *****/
+/***** Proteus IoT Builder *****/
+/***** *****/
+/***** Clock Control *****/
+/***** *****/
+/********************************************************************/
+/********************************************************************/
+
+#include "vfpserver.h"
+#include "controls.h"
+
+Clock::Clock (const char *id) : Control (id)
+ { time = 0;
+ for (uint8_t i=0; i= 0)
+ { time = (time+1) % 86400L;
+ sync();
+ for (uint8_t i=0; i= time && time < alarms[id]+60;
+ }
+
+void Clock::setTimeMode (uint8_t id)
+ { uint8_t h, m;
+ if (id == 0)
+ h = hour(time), m=minute(time);
+ else if (id <= CLOCK_ALARMS)
+ h = hour(alarms[id-1]), m = minute(alarms[id-1]);
+ VFP.call(this->id, F("setMode")).arg(id).arg(h).arg(m).end();
+ }
+
+void Clock::setTime (time_t t)
+// Set the time and update the display.
+ { time = t;
+ sync();
+ }
+
+void Clock::setAlarm(uint8_t id, uint8_t hour, uint8_t min)
+// Set an alarm time.
+ { if (id >= 1 && id <= CLOCK_ALARMS)
+ { alarms[id-1] = min*60L + hour*3600L;
+ enableAlarm(id, true);
+ }
+ }
+
+void Clock::trigger()
+ { VFP.call(id, F("trigger")).end();
+ if (alarmHandler != NULL)
+ alarmHandler();
+ }
+
+void Clock::sync ()
+ { bool alarm = false;
+ for (uint8_t i=0; i
+
+class Indicator : public Control
+ { public:
+ Indicator (const char *_id) : Control(_id) {}
+ void setState(int n) { VFP.set(id, F("state")).arg(n).end(); }
+ void setState(long n) { VFP.set(id, F("state")).arg(n).end(); }
+ void setState(float n) { VFP.set(id, F("state")).arg(n).end(); }
+ void setState(const String &s) { VFP.set(id, F("state")).arg(s).end(); }
+ void setState(const char *s) { VFP.set(id, F("state")).arg(s).end(); }
+ void setValue(float n) { VFP.set(id, F("value")).arg(n).end(); }
+ void setLabel(const String &t) { VFP.set(id, F("label")).arg(t).end(); }
+ };
+
+typedef Indicator BarGraph;
+typedef Indicator LED;
+typedef Indicator PanelMeter;
+typedef Indicator Speedometer;
+typedef Indicator LoadingBar;
+typedef Indicator Gauge;
+typedef Indicator LEDStrip;
+typedef Indicator Bearing;
+
+
+class TrafficLights : public Control
+ { public:
+ TrafficLights (const char *_id) : Control(_id), state(0) {}
+ void setState(uint8_t s) { VFP.set(id, F("state")).arg(state=s).end(); }
+ void setRed(bool b) { setState(b ? (state | 1) : (state & ~1)); }
+ void setAmber(bool b) { setState(b ? (state | 2) : (state & ~2)); }
+ void setGreen(bool b) { setState(b ? (state | 4) : (state & ~4)); }
+ private:
+ uint8_t state;
+ };
+
+
+class Thermometer : public Control
+ { public:
+ Thermometer (const char *_id) : Control (_id) {}
+ void setTemperature(float t) { VFP.set(id, F("temperature")).arg(t).end(); }
+ };
+
+
+template
+class Actuator : public Control
+ { public:
+ Actuator (const char *_id) : Control(_id), state(0) { }
+ StreamList &parseArgs(StreamList &request) { return request.arg(state); }
+ const T &operator()() const { return state; }
+ void begin(T s) { setState(s); }
+ void setState(const T &s) { VFP.set(id, F("state")).arg(state=s).end(); }
+ const T &getState() const { return state; }
+ void setValue(T n) { VFP.set(id, F("value")).arg(state=n).end(); }
+ const T &getValue() const { return state; }
+ protected:
+ T state;
+ };
+
+typedef Actuator RotaryKnob;
+typedef Actuator Slider;
+typedef Actuator Dial;
+typedef Actuator RotarySwitch;
+typedef Actuator SlideSwitch;
+typedef Actuator SteeringWheel;
+typedef Actuator Throttle;
+typedef Actuator ToggleSwitch;
+
+class Button : public Actuator
+ { public:
+ Button (const char *_id) : Actuator (_id) {}
+ void setLamp(bool f) { VFP.set(id, F("lamp")).arg(f).end(); }
+ };
+
+typedef Button PushButton;
+typedef Button ButtonGroup;
+
+class Login : public Control
+ { public:
+ Login (const char *_id);
+ StreamList &parseArgs(StreamList &request);
+ void init (String initPassword);
+ bool operator()() { return VFP.isAuthorized(); }
+ void setPassword(String newPassword);
+ void logOut();
+ protected:
+ static String storedPassword;
+ };
+
+class NumericDisplay : public Control
+ { public:
+ NumericDisplay (const char *_id, uint8_t size) : Control(_id) {}
+ void clear() { VFP.call(id, F("clear")).end(); }
+ void setValue(float value) { VFP.call(id, F("setValue")).arg(value).end(); }
+ void setValue(long value) { VFP.call(id, F("setValue")).arg(value).end(); }
+ void setValue(int value) { VFP.call(id, F("setValue")).arg(value).end(); }
+ void setRange(long value) { VFP.call(id, F("setRange")).arg(value).end(); }
+ void setDigit(uint8_t digit, uint8_t value) { VFP.call(id, F("setDigit")).arg(digit).arg(value).end(); }
+ void setPoint(uint8_t digit, bool value) { VFP.call(id, F("setPoint")).arg(digit).arg(value).end(); }
+ void setSegs(uint8_t digit, uint8_t value) { VFP.call(id, F("setSegs")).arg(digit).arg(value).end(); }
+ };
+
+class SegmentedDisplay : public Control, public PrintList
+ { public:
+ SegmentedDisplay (const char *_id, uint8_t size) : Control(_id) {}
+ void clear() { VFP.set(id, F("value"), ""); }
+ void setValue(double n) { begin(false, &value).arg(n).end(); }
+ void setValue(long n) { begin(false, &value).arg(n).end(); }
+ void setValue(int n) { return begin(false, &value).arg(n).end(); }
+ void setError() { VFP.set(id, F("value"), F("ERR")); }
+ PrintList &print() { return begin(false, &value); }
+ private:
+ void end() { VFP.set(id, F("value"), value.buffer()); value.clear(); }
+ private:
+ PrintBuffer value;
+ };
+
+class LineChart : public Control, PrintList
+ { public:
+ LineChart (const char *id);
+ void setXrange (float min, float max) { VFP.set(id, F("XRange")).arg(min).arg(max).end(); }
+ void setTimeRange (uint8_t unit, long range, bool absolute) { VFP.set(id, F("TimeRange")).arg(unit).arg(range).arg(absolute).end(); }
+ void setYrange (uint8_t axis, float min, float max);
+ void setDataFile (const String &fileName) ;
+ void setPlaces(uint8_t n) { PrintList::setPlaces(n); }
+ void showColumn (uint8_t column, bool visible);
+ PrintList &writeData ();
+ void clearData();
+ protected:
+ void end();
+ protected:
+ String fileName;
+ bool recording;
+ PrintBuffer data;
+ };
+
+class Histogram : public Control, PrintList
+ { public:
+ Histogram (const char *id);
+ void setXRange (float min, float max, int bars) { VFP.set(id, F("XRange")).arg(min).arg(max).arg(bars).end(); }
+ void setTimeRange (uint8_t unit, long range, int bars, bool absolute) { VFP.set(id, F("TimeRange")).arg(unit).arg(range).arg(bars).arg(absolute).end(); }
+ void setYRange (float min, float max);
+ void setDataFile (const String &fileName);
+ void setPlaces(uint8_t n) { PrintList::setPlaces(n); }
+ void showColumn (uint8_t column, bool visible);
+ PrintList &writeData ();
+ void clearData();
+ protected:
+ void end();
+
+ protected:
+ String fileName;
+ bool recording;
+ PrintBuffer data;
+ };
+
+class BarChart : public Control, PrintList
+ { public:
+ BarChart (const char *id);
+ ~BarChart();
+ void init (int _catCount);
+ void reload();
+
+ void setSeriesVisible (uint8_t seriesIdx, bool visible);
+ void setYRange (float min, float max);
+ void setData (uint8_t catIdx, float value);
+ void incrementData (uint8_t catIdx, float amount = 1.0f);
+ void decrementData (uint8_t catIdx, float amount = 1.0f) { incrementData (catIdx, -amount); }
+ void resetSeries(uint8_t seriesIdx);
+ void writeSeries(String filename);
+ void loadSeries(uint8_t seriesIdx, String filename);
+ void clearData();
+
+ protected:
+ float * activeSeries;
+ int8_t catCount;
+ };
+
+#define WIND_DIRS 16
+#define WIND_BANDS 6
+
+class WindRose : public Control
+ { public:
+ WindRose (const char *id);
+ void begin (const String &file, const String &bands);
+ void setTimeRange (uint8_t unit, long range);
+ void storeReading (float wind_dir, float wind_speed);
+ void storeRecord ();
+ void clearRecord();
+ void clearData();
+
+ private:
+ String fileName;
+ int thresholds[WIND_BANDS-1];
+ uint8_t calm;
+ uint8_t bins[WIND_DIRS][WIND_BANDS-1];
+ };
+
+
+class LineEdit : public Control
+ { public:
+ LineEdit (const char *_id) : Control(_id) { }
+ StreamList &parseArgs(StreamList &request) { return request.arg(text); }
+ void setText(const String &t) { VFP.set(id, F("text")).arg(text=t).end(); }
+ void setError(const String &t) { VFP.call(id, F("setError")).arg(t).end(); }
+ const String &getText() const { return text; }
+ void setReadOnly(bool readOnly) { VFP.set(id, F("readOnly")).end(); }
+ void clear() { setText(F("")); }
+
+ protected:
+ String text;
+ };
+
+class Terminal : public Control, public PrintList
+ { public:
+ Terminal (const char *_id);
+ StreamList &parseArgs(StreamList &request) { return request.arg(command); }
+ void setPrompt(const String &t) { VFP.set(id, F("prompt")).arg(t).end(); }
+ const String &getCommand () { return command; }
+ void cls();
+ PrintList &print();
+ PrintList &println();
+
+ protected:
+ void end();
+
+ protected:
+ PrintBuffer text;
+ String command;
+ };
+
+class TextLog : public Control, public PrintList
+ { public:
+ TextLog (const char *_id);
+ void setFile (const String &fileName) ;
+ PrintList &info();
+ PrintList &warning();
+ PrintList &error();
+ void clear();
+
+ protected:
+ void end();
+
+ private:
+ String fileName;
+ bool recording;
+ PrintBuffer text;
+ };
+
+class AlertBox : public Control
+ { public:
+ AlertBox (const char *id) : Control (id) { }
+ void reload() { VFP.create(id, F("AlertBox")); } // Create the JS object on a page reload
+ void info (const String &msg) { VFP.call(id, F("info")).arg(msg).end(); }
+ void warning (const String &msg) { VFP.call(id, F("warning")).arg(msg).end(); }
+ void error (const String &msg) { VFP.call(id, F("error")).arg(msg).end(); }
+ void confirm (const String &msg) { VFP.call(id, F("confirm")).arg(msg).end(); }
+ };
+
+class TextIn : public Control
+ { public:
+ TextIn (const char *_id) : Control(_id) { }
+ StreamList &parseArgs(StreamList &request) { return request.arg(text); }
+ const String &operator()() const { return text; }
+ const String &getInput () const { return text; }
+
+ protected:
+ String text;
+ };
+
+typedef TextIn KeyPad;
+
+class Timer : public Control
+ { public:
+ Timer (const char *id);
+ void begin (int8_t dir, uint8_t mode, uint8_t h, uint8_t m, uint8_t s, bool e);
+ void poll();
+ void reload() { sync(); }
+ bool operator() () { bool t = triggered; triggered = false; return t; }
+ void restart() { reset(true); }
+ void reset (bool run=false);
+ void start();
+ void stop() { running = false; sync(); }
+ void setPeriod(uint8_t hour, uint8_t min, uint8_t sec);
+ void enableAlarm(bool flag) { enabled = flag; }
+ const int getTime() { return time; }
+ private:
+ void trigger();
+ void sync ();
+ private:
+ int8_t dir;
+ uint8_t mode;
+ time_t period, time;
+ bool running, triggered;
+ bool enabled;
+ unsigned long nexttick;
+ };
+
+#define CLOCK_ALARMS 8
+
+class Clock : public Control
+ { public:
+ Clock (const char *id);
+ StreamList &parseArgs(StreamList &request);
+ void poll();
+ void reload() { sync(); }
+ bool operator() (uint8_t alarm);
+ void setTime(time_t time);
+ time_t getTime() { return time; }
+ void setTimeMode(uint8_t m);
+ void cancelSetMode() { VFP.call(id, F("cancelMode")).end(); }
+ void setAlarm(uint8_t id, uint8_t hour, uint8_t min);
+ void enableAlarm(uint8_t id, bool flag) { enabled[id-1] = flag; }
+ time_t getAlarm(uint8_t id) { return alarms[id-1]; }
+ void attachAlarmHandler(void (*isr)()) { alarmHandler=isr; }
+ private:
+ void trigger();
+ void sync ();
+ private:
+ time_t time, alarms[CLOCK_ALARMS];
+ bool enabled[CLOCK_ALARMS];
+ void (*alarmHandler)();
+ unsigned long nexttick;
+ };
+
+ class JoyStick : public Control
+ { public:
+ JoyStick (const char *_id) : Control(_id), x(0), y(0){ }
+ StreamList &parseArgs(StreamList &request) { return request.arg(x).arg(y); }
+ void begin(int x, int y) { setPos(x, y); }
+ void setPos(int _x, int _y) { VFP.set(id, F("value")).arg(_x).arg(_y).end(); }
+ const int &getValueX() const { return x; }
+ const int &getValueY() const { return y; }
+ void getValues(long *ptr_x, long *ptr_y) { *ptr_x = x; *ptr_y = y; }
+ protected:
+ int x, y;
+ };
\ No newline at end of file