Package com.ardublock.translator.block

Examples of com.ardublock.translator.block.TranslatorBlock.toCode()


      func += "}\n\n";
    translator.addDefinitionCommand(func);

    TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
    String ret = "ComputeSharpGP2Y0A21(analogRead(";
    ret = ret + translatorBlock.toCode();
    ret = ret + "))";
   
    return ret;
  }
View Full Code Here


  //@Override
  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
   
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(1);
    String lineNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(2);
    String charNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(3);
    String I2C_addr = tb.toCode();
   
View Full Code Here

  {
   
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(1);
    String lineNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(2);
    String charNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(3);
    String I2C_addr = tb.toCode();
   
    String ret = "";
    if ( !(charNo.equals("0") && lineNo.equals("0")) ){
View Full Code Here

    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(1);
    String lineNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(2);
    String charNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(3);
    String I2C_addr = tb.toCode();
   
    String ret = "";
    if ( !(charNo.equals("0") && lineNo.equals("0")) ){
      ret = "lcd_I2C_" + I2C_addr + ".setCursor( (" + charNo + ") - 1, (" + lineNo + ") - 1 );";
    }
View Full Code Here

    if ( !(charNo.equals("0") && lineNo.equals("0")) ){
      ret = "lcd_I2C_" + I2C_addr + ".setCursor( (" + charNo + ") - 1, (" + lineNo + ") - 1 );";
    }
   
    tb = this.getRequiredTranslatorBlockAtSocket(0, "lcd_I2C_"+ I2C_addr + ".print( ", " );\n");
    ret += tb.toCode();
    //Deal with line and character positioning
    translator.addHeaderFile("Wire.h");
    translator.addHeaderFile("LCD.h");
    translator.addHeaderFile("LiquidCrystal_I2C.h");
    translator.addDefinitionCommand(             "// For these LCD controls to work you MUST replace the standard LCD library with 'New LCD' from...");
View Full Code Here

  //@Override
  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
   
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(1);
    String lineNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(2);
    String charNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(3);
    String I2C_addr = tb.toCode();
   
View Full Code Here

  {
   
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(1);
    String lineNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(2);
    String charNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(3);
    String I2C_addr = tb.toCode();
   
    String ret = "";
    if ( !(charNo.equals("0") && lineNo.equals("0")) ){
View Full Code Here

    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(1);
    String lineNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(2);
    String charNo = tb.toCode();
    tb = this.getRequiredTranslatorBlockAtSocket(3);
    String I2C_addr = tb.toCode();
   
    String ret = "";
    if ( !(charNo.equals("0") && lineNo.equals("0")) ){
      ret = "lcd_I2C_" + I2C_addr + ".setCursor( (" + charNo + ") - 1, (" + lineNo + ") - 1 );";
    }
View Full Code Here

    if ( !(charNo.equals("0") && lineNo.equals("0")) ){
      ret = "lcd_I2C_" + I2C_addr + ".setCursor( (" + charNo + ") - 1, (" + lineNo + ") - 1 );";
    }
   
    tb = this.getRequiredTranslatorBlockAtSocket(0, "lcd_I2C_" + I2C_addr + ".print( ", " );\n");
    ret += tb.toCode();
    //Deal with line and character positioning
    translator.addHeaderFile("Wire.h");
    translator.addHeaderFile("LCD.h");
    translator.addHeaderFile("LiquidCrystal_I2C.h");
    translator.addDefinitionCommand(             "// For these LCD controls to work you MUST replace the standard LCD library with 'New LCD' from...");
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException {
    translator.addHeaderFile("Makeblock.h");
    translator.addHeaderFile("SoftwareSerial.h");
    translator.addHeaderFile("Wire.h");
    TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
    String ret = "MeLimitSwitch switch"+translatorBlock.toCode()+"(PORT_"+translatorBlock.toCode()+");";
    translator.addDefinitionCommand(ret);
    return "switch"+translatorBlock.toCode()+".touched()";
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.