EEVblog Electronics Community Forum

Products => Computers => Programming => Topic started by: eti on October 10, 2022, 07:21:31 am

Title: ESP32 (Arduino on PlatformIO; Serial.println error)
Post by: eti on October 10, 2022, 07:21:31 am
Hi all.

Using Arduino code for an ESP32, PlatformIO on VS  Code, I'm testing this basic code, and I get junk on the serial monitor. Yes, the "monitor_speed=9600" is set in the .ini file. Thanks. Any idea; do I need to add a short delay after the println() ?

Code: [Select]
#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(":) Hey");
}
Title: Re: ESP32 (Arduino on PlatformIO; Serial.println error)
Post by: timenutgoblin on October 10, 2022, 09:12:54 am
Maybe this will work... add a delay...

Code: [Select]
#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(":) Hey");
  delay(2000);
}

Source: https://techtutorialsx.com/2017/04/24/esp32-hello-world/

I should point out that I'm not experienced with Arduino, but I hope it works.
Title: Re: ESP32 (Arduino on PlatformIO; Serial.println error)
Post by: eti on October 10, 2022, 05:56:07 pm
Maybe this will work... add a delay...

Code: [Select]
#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(":) Hey");
  delay(2000);
}

Source: https://techtutorialsx.com/2017/04/24/esp32-hello-world/

I should point out that I'm not experienced with Arduino, but I hope it works.

Thanks very much indeed :) - I appreciate it, and I appreciate it that you didn't talk down to me.