Skip to content

Commit

Permalink
Merge branch 'tinker_function_remove' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	ChangeLog.txt
	pom.xml
	src/main/resources/com/ardublock/block/ardublock.properties
  • Loading branch information
gregcorbett committed Jul 27, 2016
2 parents e26ffa8 + fe13141 commit 47351aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
5 changes: 4 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Alter loop counters to be more pythonic (starting at 0)
Minor Changes:
Defines loop counters in the loop

Patches and Bug Fixes:
Tinker blocks in loops no longer generate functions

========== Version 1.1.0 ==========

Major Changes:
Expand All @@ -25,4 +28,4 @@ Rename 'Tests' to 'Logical Operators'

========== Version 1.0.0 ==========

First Release (of this fork)
First Release (of this fork)
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1505,4 +1505,4 @@ bg.FaireBot_AddRight.description=Save "right" in memory

bg.FaireBot_Go.description=Run saved commands
bg.FaireBot_Distance.description=Set the forward/back distance of the FaireBot
bg.FaireBot_Turn.description=Set the turn of the FaireBot
bg.FaireBot_Turn.description=Set the turn of the FaireBot

0 comments on commit 47351aa

Please sign in to comment.