executing scripts

Hello.

I have this error, running the code bellow:

butterfly_recv() programmer is not responding

void setup() {
  // loop for
  // contagem crescente
  for (int i = 0; i < 10; i++ ) {
    Serial.println(i);
  }

    for (int i = 0; i >= 10; i-- ) {
    Serial.println(i);
  }
}

void loop() {

}

if i unplug it, i can see only the port /dev/ttyS4. Connecting again, i have also /dev/ttyACM0 (Arduino Uno), which i am using.

maybe isn’t important, but i got this version from the store: https://www.electrofun.pt/placas-arduino/arduino-uno-r3-atmega328p-ch340-compativel-com-cabo-usb

the board info is:
BN: Arduino Uno
VID: 0x2341
PID: 0x0043
SN: 957353539313516111D1

and the IDE is 1.8.12

Also, i use Linux Mint, and dont have visible software issues.

thanks

Do you think that it might be a good idea to do a Serial.begin() to set the baud rate before using the Serial interface ?

UKHeliBob:
Do you think that it might be a good idea to do a Serial.begin() to set the baud rate before using the Serial interface ?

i got this in a udemy tutorial.

Serial.begin? Isn't Serial.println() to show stuff in logs, Like in Java System.out.println() ?

baud rate? Sorry, whats that? am i using it?

lsag637:
I have this error, running the code bellow:

butterfly_recv() programmer is not responding

Looks like you have not selected the correct board in Board Manager. Before you can upload a sketch you need to go to Tools -> Board: and select "Arduino Uno". The "butterfly" programmer is used for 32u4 boards like the Leonardo and Micro.

Regarding Serial.begin() see the documentation and example here:

https://www.arduino.cc/reference/en/language/functions/communication/serial/begin?from=Reference.BeginSerial

General upload troubleshooting advice can be found here:

https://www.arduino.cc/en/Guide/Troubleshooting#upload

lsag637:
Serial.begin? Isn't Serial.println() to show stuff in logs, Like in Java System.out.println() ?

A serial port (actually the UART) needs to be configured; that applies to the Arduino but also to e.g. a PC. That is what Serial.begin() does on the Arduino.

lsag637:
baud rate? Sorry, whats that? am i using it?

See https://en.wikipedia.org/wiki/Serial_port#Settings for settings. You can ignore the table; read the part about speed, databits, parity, stopbits and conventional notation which are applicable to Serial.begin().

so i had 3 issues:
1 - The board was set to Yun, matching the VID: 0x2341 code. Set it to Arduino Uno, got no errors
2 - but still no logs. With that

Serial.begin(9600);
Serial.println("info");

you mentioned, should be working, but...

3 - and here was the noobest of them all: i thought the logs would be in that black window, bellow the code. Turns out it's in Tools > serial Monitor

Thanks for the help!