0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ESP32: Hello World

Last updated at Posted at 2022-11-16

Ubuntu 24.10 上の Arduino IDE 2.3.4 を使います。

./arduino-ide_2.3.4_Linux_64bit.AppImage --no-sandbox

ボードは、
ESP32 Dev Module
です。

hello_world.ino
// ---------------------------------------------------------------------
/*
	hello_world.ino

						Jan/28/2025
*/
// ---------------------------------------------------------------------
#define	PROGRAM	"hellow_world.ino"
#define	VERSION	"2025-01-28 PM 16:47"

int count = 0;
// ---------------------------------------------------------------------
void setup()
{
	Serial.begin(115200);
	
	delay(1000);
	Serial.println("*** start ***");
	delay(1000);
	Serial.println(PROGRAM);
	Serial.println(VERSION);
	Serial.println("*** setup end ***");
}

// ---------------------------------------------------------------------
void loop() 
{
	Serial.println(PROGRAM);
	Serial.println(VERSION);
	Serial.println("Hello World! " + String(count));
	delay(1000);
	Serial.println("Good Morning! " + String(count));
	delay(1000);
	Serial.println("こんにちは " + String(count));
	Serial.println();
	delay(3000);
	count++;
}

// ---------------------------------------------------------------------

コンパイルとアップロード
image.png

シリアルポート
image.png

ターミナルで接続した結果

$ cu -l /dev/ttyUSB0 -s 115200
Connected.
Good Morning! 63
こんにちは 63

hellow_world.ino
2025-01-28 PM 16:47
Hello World! 64
Good Morning! 64
こんにちは 64

hellow_world.ino
2025-01-28 PM 16:47
Hello World! 65
Good Morning! 65
こんにちは 65

M5Core2

このプログラムはそのまま M5Core2 で使えます。
image.png

実行結果

$ cu -l /dev/ttyUSB0 -s 115200
Connected.
hellow_world.ino
2025-01-28 PM 16:47
Hello World! 11
Good Morning! 11
こんにちは 11

hellow_world.ino
2025-01-28 PM 16:47
Hello World! 12
Good Morning! 12
こんにちは 12

hellow_world.ino
2025-01-28 PM 16:47
Hello World! 13
Good Morning! 13
こんにちは 13
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?