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?

STM32C0116-DK、十字キーで遊ぶ。

Last updated at Posted at 2025-08-04

いろいろ注意

  • 過去ログを見よ!!!
  • STM32C011の事。
  • Discovery kit with STM32C011F6 MCUの事。
  • 約15K Byte

目的

十字キーのtest

結果

なぜか15キロバイトぐらい。使っている。

Screenshot from 2025-08-05 06-09-55.png

Screenshot from 2025-08-05 05-49-55.png

イメージ

image_original(51).jpg

プログラム



//Serial_jyuuji_key_1_c0116_1


//インクルド
#include <Arduino.h>


//定義
//#define swdclk PA14 // 17pin
//#define swdio  PA13 // 16pin

// tx PA11[PA9] 14pin
// rx PA12[PA10] 15pin

// ADC PA8 13pin


//初期化
void setup() {
  // put your setup code here, to run once:

  //シリアルポートの初期化
  Serial.begin(9600);  // シリアル通信の速度を9600bpsにする。

  //ADCの初期化(3.3Vを4096に分解)
  analogReadResolution(12);  //センサーの分解度4096

}  //setup


//メインループ
void loop() {
  // put your main code here, to run repeatedly:

  //センサーから値を読み込む
  //センサーから電圧を入力する(3.3Vを4096に分解した値)
  int sensorValue = analogRead(A8);  //C011f6 12Bit ADC

  //センサーの値から電圧に変換
  int Voltage = (sensorValue * 3300) >> 12;  //4096step-adc : (x>>12)=(x/4096) [C011f6]

  //シリアル出力
  Serial.println(Voltage);

  delay(1000);  //1秒待つ

}  //loop


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?