String ret = "MeServo "+servo+"(PORT_"+block.toCode()+","+device+");";
translator.addDefinitionCommand(ret);
String output = "";
block = this.getRequiredTranslatorBlockAtSocket(2);
if(block instanceof NumberBlock){
int angle = Integer.parseInt(block.toCode());
if(angle>180||angle<0){
throw new BlockException(this.blockId, "the angle of Servo must be in Range(0,180)");
}
angle = angle>180?180:(angle<0?0:angle);
output+= servo+".write("+angle+");\n";