blockly
blockly copied to clipboard
Redundant Arduino code when using buzzer blocks
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.
Maybe creating a block to declare the pinMode and taking this line out of the blocks could be useful for this.