Package com.ardublock.translator.block

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


      String Blue;
      String Green;
      TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
      Pin = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(1);
      Pixel_Nb = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(2);
      Red = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(3);
      Green = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(4);
View Full Code Here


      TranslatorBlock translatorBlock = this.getRequiredTranslatorBlockAtSocket(0);
      Pin = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(1);
      Pixel_Nb = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(2);
      Red = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(3);
      Green = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(4);
      Blue = translatorBlock.toCode();
     
View Full Code Here

      translatorBlock = this.getRequiredTranslatorBlockAtSocket(1);
      Pixel_Nb = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(2);
      Red = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(3);
      Green = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(4);
      Blue = translatorBlock.toCode();
     
     
      String ret = "strip_pin"+Pin+".setPixelColor("+Pixel_Nb+","+Red+" ,"+Green+" ,"+Blue+" );\n";
View Full Code Here

      translatorBlock = this.getRequiredTranslatorBlockAtSocket(2);
      Red = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(3);
      Green = translatorBlock.toCode();
      translatorBlock = this.getRequiredTranslatorBlockAtSocket(4);
      Blue = translatorBlock.toCode();
     
     
      String ret = "strip_pin"+Pin+".setPixelColor("+Pixel_Nb+","+Red+" ,"+Green+" ,"+Blue+" );\n";
     
      return codePrefix + ret + codeSuffix;
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException {
    translator.addHeaderFile("Makeblock.h");
    translator.addHeaderFile("SoftwareSerial.h");
    translator.addHeaderFile("Wire.h");
    TranslatorBlock block = this.getRequiredTranslatorBlockAtSocket(0);
    String ret = "MeBluetooth bluetooth"+block.toCode()+"(PORT_"+block.toCode()+");";
    translator.addDefinitionCommand(ret);
    translator.addSetupCommand("bluetooth"+block.toCode()+".begin(9600);");
    TranslatorBlock dataBlock = this.getRequiredTranslatorBlockAtSocket(1);
    return "bluetooth"+block.toCode()+".write("+dataBlock.toCode()+");\n";
  }
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException {
    translator.addHeaderFile("Makeblock.h");
    translator.addHeaderFile("SoftwareSerial.h");
    translator.addHeaderFile("Wire.h");
    TranslatorBlock block = this.getRequiredTranslatorBlockAtSocket(0);
    String ret = "MeBluetooth bluetooth"+block.toCode()+"(PORT_"+block.toCode()+");";
    translator.addDefinitionCommand(ret);
    translator.addSetupCommand("bluetooth"+block.toCode()+".begin(9600);");
    TranslatorBlock dataBlock = this.getRequiredTranslatorBlockAtSocket(1);
    return "bluetooth"+block.toCode()+".write("+dataBlock.toCode()+");\n";
  }
View Full Code Here

    translator.addHeaderFile("SoftwareSerial.h");
    translator.addHeaderFile("Wire.h");
    TranslatorBlock block = this.getRequiredTranslatorBlockAtSocket(0);
    String ret = "MeBluetooth bluetooth"+block.toCode()+"(PORT_"+block.toCode()+");";
    translator.addDefinitionCommand(ret);
    translator.addSetupCommand("bluetooth"+block.toCode()+".begin(9600);");
    TranslatorBlock dataBlock = this.getRequiredTranslatorBlockAtSocket(1);
    return "bluetooth"+block.toCode()+".write("+dataBlock.toCode()+");\n";
  }

}
View Full Code Here

    TranslatorBlock block = this.getRequiredTranslatorBlockAtSocket(0);
    String ret = "MeBluetooth bluetooth"+block.toCode()+"(PORT_"+block.toCode()+");";
    translator.addDefinitionCommand(ret);
    translator.addSetupCommand("bluetooth"+block.toCode()+".begin(9600);");
    TranslatorBlock dataBlock = this.getRequiredTranslatorBlockAtSocket(1);
    return "bluetooth"+block.toCode()+".write("+dataBlock.toCode()+");\n";
  }

}
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException {
    translator.addHeaderFile("Makeblock.h");
    translator.addHeaderFile("SoftwareSerial.h");
    translator.addHeaderFile("Wire.h");
    TranslatorBlock block = this.getRequiredTranslatorBlockAtSocket(0);
    String servo = "servoDriver"+block.toCode();
   
    block = this.getRequiredTranslatorBlockAtSocket(1);
    String device = block.toCode();
    if(block instanceof NumberBlock){
      int deviceId = Integer.parseInt(block.toCode());
View Full Code Here

    translator.addHeaderFile("Wire.h");
    TranslatorBlock block = this.getRequiredTranslatorBlockAtSocket(0);
    String servo = "servoDriver"+block.toCode();
   
    block = this.getRequiredTranslatorBlockAtSocket(1);
    String device = block.toCode();
    if(block instanceof NumberBlock){
      int deviceId = Integer.parseInt(block.toCode());
      if(deviceId>2||deviceId<1){
        throw new BlockException(this.blockId, "the Device Id of Servo must be in Range(1,2)");
      }
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.