Skip to content

Commit

Permalink
Update leaphy_common.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JeftadeGraaf committed Dec 29, 2023
1 parent ab42697 commit 5e7dd68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions generators/arduino/leaphy_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getCodeGenerators(Arduino) {
branch =
Arduino.prefixLines(
Arduino.STATEMENT_PREFIX.replace(/%1/g, "'" + id + "'"),
Arduino.INDENT,
Arduino.INDENT
) + branch;
}
if (Arduino.INFINITE_LOOP_TRAP) {
Expand Down Expand Up @@ -54,11 +54,11 @@ function getCodeGenerators(Arduino) {
" compass.read();\n" +
" int azimuth = compass.getAzimuth();\n" +
" return round((azimuth > -0.5) ? azimuth : azimuth + 360);\n" +
"}\n",
"}\n"
);
Arduino.addSetup(
"leaphy_compass",
"compass.init();\n compass.setMagneticDeclination(2, 30);",
"compass.init();\n compass.setMagneticDeclination(2, 30);"
);
var code = "getCompassDegrees()";
return [code, Arduino.ORDER_ATOMIC];
Expand All @@ -69,7 +69,7 @@ function getCodeGenerators(Arduino) {
Arduino.addDeclaration("leaphy_gas_sensor", "Adafruit_SGP30 sgp;");
Arduino.addSetup(
"leaphy_gas_sensor",
"if (! sgp.begin()){\n" + "\treturn -1;\n" + "}",
"if (! sgp.begin()){\n" + "\treturn -1;\n" + "}"
);

var gasValue = block.getFieldValue("GAS");
Expand Down

0 comments on commit 5e7dd68

Please sign in to comment.