1
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?

📚 LED点消灯を10分で制御させる(動画) LM1_1_GIF

Last updated at Posted at 2025-06-10
QQQ :bow_tone1:3Q!
📚 LED点消灯を10分で制御させる LM1_1_SIM :arrow_heading_up:

🎯 レッスン目的

 レッスン手順の実況感を感じる。

マイコンリソースの利用

(下側の青色ピン:Pin76、Pin75)
mcu_pin_map.png

プロジェクト生成

  • 新規プロジェクト → RL78 → R5F104PL を選択
  • LLVM ツールチェインを選び、Smart Configurator を有効化
    P7.5 → Output → 初期値:Low(LED1 Off)
    P7.6 → Output → 初期値:Low(LED2 Off)
    P13.7 → Input (KEY)

prjCreate_network_Smp18_color8.gif

デバッグ構成の作成

sim_debug.gif

シミュレーターのデザイン

sim_design.gif

ソース実装 & 動作確認

coding_chk_tiny.gif

ソースコード

/***********************************************************************************************************************
 * Function Name: main
 * Description  : This function implements main function.
 * Arguments    : None
 * Return Value : None
 ***********************************************************************************************************************/
int main(void)
{
	R_MAIN_UserInit();
	/* Start user code. Do not edit comment generated here */
	while (1U)
	{
		// キーOnの場合
		if (P13_bit.no7)
		{
			// LED1点灯
			P7_bit.no5 = 1;

			// LED2消灯
			P7_bit.no6 = 0;

		}
		// キーOffの場合
		else
		{
			// LED1点灯
			P7_bit.no5 = 0;

			// LED2消灯
			P7_bit.no6 = 1;
		}

	}
	return 0U;
	/* End user code. Do not edit comment generated here */
}

📚 LED点消灯を10分で制御させる LM1_1_SIM :arrow_heading_up:
QQQ :bow_tone1:3Q!
1
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
1
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?