Skip to content

Commit

Permalink
Merge pull request #131 from karlTH/master
Browse files Browse the repository at this point in the history
new block for duinoedu and add anol and digital connector
  • Loading branch information
taweili committed Jan 15, 2015
2 parents 1319206 + 125d17d commit b758410
Show file tree
Hide file tree
Showing 48 changed files with 1,412 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ public String toCode() throws SocketNullException, SubroutineNotDeclaredExceptio
String Clk;
String Dio;
String Niveau;
String Min;
String Max;
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
Dio = translatorBlock.toCode();
translatorBlock = this.getRequiredTranslatorBlockAtSocket(1);
Clk = translatorBlock.toCode();
translatorBlock = this.getRequiredTranslatorBlockAtSocket(2);
Niveau = translatorBlock.toCode();
translatorBlock = this.getRequiredTranslatorBlockAtSocket(3);
Min = translatorBlock.toCode();
translatorBlock = this.getRequiredTranslatorBlockAtSocket(4);
Max = translatorBlock.toCode();


translator.addHeaderFile("LED_Bar.h");
Expand All @@ -30,7 +36,7 @@ public String toCode() throws SocketNullException, SubroutineNotDeclaredExceptio
translator.addDefinitionCommand("//libraries at http://duinoedu.com/dl/lib/grove/EDU_LedBar_Grove/ \n// Pin Led Bar\n"
+ "LED_Bar mesLeds_pin"+Dio+Clk+"(" + Clk
+ "," + Dio + ");");
String ret = "mesLeds_pin"+Dio+Clk+".displayVoltage("+ Niveau +");\n";
String ret = "mesLeds_pin"+Dio+Clk+".afficherTension("+ Niveau +","+ Min+","+ Max+");\n";

return codePrefix + ret + codeSuffix;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ public Ultrasonic(Long blockId, Translator translator, String codePrefix, String
public String toCode() throws SocketNullException, SubroutineNotDeclaredException
{
String Pin;
String Sample;
TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
Pin = translatorBlock.toCode();
translatorBlock = this.getRequiredTranslatorBlockAtSocket(1);
Sample = translatorBlock.toCode();


translator.addHeaderFile("Ultrasonic.h");
translator.addDefinitionCommand("//libraries at http://duinoedu.com/dl/lib/grove/EDU_Ultrasonic_Grove/ \nUltrasonic monUltrasonic_pin"+Pin+"("+Pin +");" );

String ret = "monUltrasonic_pin"+Pin+".mesurer()";
String ret = "monUltrasonic_pin"+Pin+".mesurer("+Sample+")";


return codePrefix + ret + codeSuffix;
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A0.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A0 extends TranslatorBlock
{

public A0(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "0" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A1 extends TranslatorBlock
{

public A1(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "1" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A10.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A10 extends TranslatorBlock
{

public A10(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "10" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A11.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A11 extends TranslatorBlock
{

public A11(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "11" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A12.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A12 extends TranslatorBlock
{

public A12(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "12" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A13.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A13 extends TranslatorBlock
{

public A13(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "13" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A14.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A14 extends TranslatorBlock
{

public A14(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "14" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A15.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A15 extends TranslatorBlock
{

public A15(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "15" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A2 extends TranslatorBlock
{

public A2(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "2" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A3 extends TranslatorBlock
{

public A3(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "3" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A4.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A4 extends TranslatorBlock
{

public A4(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "4" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A5.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A5 extends TranslatorBlock
{

public A5(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "6" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A6.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A6 extends TranslatorBlock
{

public A6(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "0" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A7.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A7 extends TranslatorBlock
{

public A7(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "7" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A8.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A8 extends TranslatorBlock
{

public A8(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "8" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/A9.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class A9 extends TranslatorBlock
{

public A9(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "9" + codeSuffix;
}

}
19 changes: 19 additions & 0 deletions src/main/java/com/ardublock/translator/block/Duinoedu/D10.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.ardublock.translator.block.Duinoedu;

import com.ardublock.translator.Translator;
import com.ardublock.translator.block.TranslatorBlock;
import com.ardublock.translator.block.exception.SocketNullException;

public class D10 extends TranslatorBlock
{

public D10(Long blockId, Translator translator, String codePrefix, String codeSuffix, String label) {
super(blockId, translator, codePrefix, codeSuffix, label);
}

@Override
public String toCode() throws SocketNullException {
return codePrefix + "10" + codeSuffix;
}

}
Loading

0 comments on commit b758410

Please sign in to comment.