Skip to content

Commit 960fee9

Browse files
authored
Merge pull request #316 from parallaxinc/patch-develop-311
Patch develop 311
2 parents 812f84a + 4511bed commit 960fee9

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ <h4 class="modal-title w-100" id="licenseLabel">BlocklyProp Solo License</h4>
156156
<li><a onclick="showLicense()">License</a></li>
157157
<li>
158158
<a href="http://www.parallax.com" target="_blank">
159-
v1.4.2.3 Parallax &copy; 2015 - <span id="footer_copyright"></span></a>
159+
v1.4.2.4 Parallax &copy; 2015 - <span id="footer_copyright"></span></a>
160160
</li>
161161
</ul>
162162
</div>

src/blockly/generators/propc/sensors.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,21 +1082,21 @@ Blockly.Blocks.lis3dh_init = {
10821082
.appendField(
10831083
new Blockly.FieldNumber(
10841084
'0',
1085-
-500,
1086-
500,
1085+
null,
1086+
null,
10871087
1
10881088
),"VSS_VOLTAGE")
10891089
.appendField(' 3.3V ')
10901090
.appendField(
10911091
new Blockly.FieldNumber(
10921092
'0',
1093-
2700,
1094-
3800,
1093+
null,
1094+
null,
10951095
1
10961096
), "VDD_VOLTAGE");
10971097

10981098
this.setFieldValue(vssVoltField || '0', 'VSS_VOLTAGE');
1099-
this.setFieldValue(vddVoltField || '3300', 'VDD_VOLTAGE');
1099+
this.setFieldValue(vddVoltField || '0', 'VDD_VOLTAGE');
11001100

11011101
// Move this input field to the bottom of the init block
11021102
this.moveInputBefore('VOLT_CALIBRATE', null);
@@ -1176,7 +1176,14 @@ Blockly.propc.lis3dh_init = function () {
11761176
var vddVoltField = this.getFieldValue('VDD_VOLTAGE');
11771177

11781178
if ((vssVoltField !== undefined) && (vddVoltField !== undefined)) {
1179-
setupCode += 'lis3dh_adcCal_mV(lis3dh_sensor, 0, 3300, ' + vssVoltField + ', ' + vddVoltField + ');';
1179+
setupCode += 'lis3dh_adcCal_mV(lis3dh_sensor, ';
1180+
1181+
if (vssVoltField === 0 && vddVoltField === 0) {
1182+
setupCode += '0, 0, 0, 0 );';
1183+
}
1184+
else {
1185+
setupCode += '0, 3300, ' + vssVoltField + ', ' + vddVoltField + ');';
1186+
}
11801187
}
11811188
}
11821189

0 commit comments

Comments
 (0)