blockly icon indicating copy to clipboard operation
blockly copied to clipboard

Redundant Arduino code when using buzzer blocks

Open IvanR3D opened this issue 2 years ago • 0 comments

Using the buzzer blocks as shown in the picture, generate this Arduino code:

void setup() {
  pinMode( 13 , OUTPUT);
  pinMode(13, OUTPUT);
    tone(  13,261,125);
   delay(125);
  tone(13,440,1000);
  delay(1000);
}
void loop() {
}

Declaring the pinMode 2 times. Captura de Pantalla 2022-06-03 a la(s) 5 50 55 p  m

Maybe creating a block to declare the pinMode and taking this line out of the blocks could be useful for this.

IvanR3D avatar Jun 03 '22 21:06 IvanR3D