From 2c479f95a548465f8214ea8a7c601b3a0c11978b Mon Sep 17 00:00:00 2001 From: Greg Corbett Date: Wed, 27 Jul 2016 15:40:32 +0100 Subject: [PATCH 1/3] Replace the Tinker function with digitalWrite --- .../AbstractTinkerWriteDigitalBlock.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/ardublock/translator/block/tinker/AbstractTinkerWriteDigitalBlock.java b/src/main/java/com/ardublock/translator/block/tinker/AbstractTinkerWriteDigitalBlock.java index 374041ba..210f4757 100644 --- a/src/main/java/com/ardublock/translator/block/tinker/AbstractTinkerWriteDigitalBlock.java +++ b/src/main/java/com/ardublock/translator/block/tinker/AbstractTinkerWriteDigitalBlock.java @@ -22,22 +22,16 @@ public String toCode() throws SocketNullException, SubroutineNotDeclaredExceptio TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0); String ret = ""; - if (translatorBlock instanceof NumberBlock || translatorBlock instanceof TinkerOutputPortBlock) + String number = translatorBlock.toCode(); + + if (translatorBlock instanceof NumberBlock) { - String number = translatorBlock.toCode(); String setupCode = "pinMode( " + number + " , OUTPUT);"; translator.addSetupCommand(setupCode); - - ret = "digitalWrite( "; - ret = ret + number; - } - else - { - translator.addDefinitionCommand(DigitalOutputBlock.ARDUBLOCK_DIGITAL_WRITE_DEFINE); - ret = "__ardublockDigitalWrite("; - - ret = ret + translatorBlock.toCode(); } + + ret = "digitalWrite( "; + ret = ret + number; ret = ret + " , "; translatorBlock = this.getRequiredTranslatorBlockAtSocket(1); From 6d535a6163e095aa3b6dd1f92fc24e9ceceb5636 Mon Sep 17 00:00:00 2001 From: Greg Corbett Date: Wed, 27 Jul 2016 15:44:01 +0100 Subject: [PATCH 2/3] Update ChangeLog.txt --- ChangeLog.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3bb1c394..c283420a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,11 @@ Changelog + +========== Version 1.1.1 ========== + +Patches and Bug Fixes: +Tinker blocks in loops no longer generate functions + ========== Version 1.1.0 ========== Major Changes: From fe13141c946c9a2b48ea467e527e0aefc34bdf90 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 27 Jul 2016 19:21:45 +0100 Subject: [PATCH 3/3] Version Bump to 1.1.1-1.beta --- ChangeLog.txt | 2 +- pom.xml | 2 +- src/main/resources/com/ardublock/block/ardublock.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c283420a..ae671dcb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,7 +1,7 @@ Changelog -========== Version 1.1.1 ========== +========== Version 1.1.1-1.beta ========== Patches and Bug Fixes: Tinker blocks in loops no longer generate functions diff --git a/pom.xml b/pom.xml index 4e859de7..c1e26e79 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.ardublock ardublock jar - 1.1.0-SNAPSHOT + 1.1.1-1.beta-SNAPSHOT ArduBlock A Block Programming Language for Arduino diff --git a/src/main/resources/com/ardublock/block/ardublock.properties b/src/main/resources/com/ardublock/block/ardublock.properties index 698fa2ba..eb895cb2 100644 --- a/src/main/resources/com/ardublock/block/ardublock.properties +++ b/src/main/resources/com/ardublock/block/ardublock.properties @@ -437,7 +437,7 @@ ardublock.ui.create_refer=create reference ardublock.ui.website=Go to Web Site ardublock.ui.serialMonitor=Serial Monitor ardublock.ui.saveImage=Save as image... -ardublock.ui.version=1.1.0 +ardublock.ui.version=1.1.1.beta ardublock.error_msg.digital_var_slot=Digital variable slot must take a 'digital variable' name.\nHint: Look at the 'variable' socket on the highlighted block ardublock.error_msg.number_var_slot=Standard variable slot must take a standard 'numeric' variable name.\nHint: Look at the 'variable' socket on the highlighted block