commit(auto)
This commit is contained in:
parent
8350c46a8d
commit
3f3f989459
2 changed files with 38 additions and 0 deletions
35
content/20240201182238 ATMega系のArduinoでprintfする方法.md
Executable file
35
content/20240201182238 ATMega系のArduinoでprintfする方法.md
Executable file
|
@ -0,0 +1,35 @@
|
|||
# 20240201182238 ATMega系のArduinoでprintfする方法
|
||||
#tech #arduino #printf
|
||||
|
||||
いつも忘れるのでメモ。
|
||||
この、`fdevopen`を使う方法は、この関数がAVR用のavr-libcでしか定義されていないため、
|
||||
ESP32やARMなど他のMCUがベースになっている場合には使えないので注意。
|
||||
|
||||
Aruino UNO3、 Arduino Nano、Pro Microなどでは使える。
|
||||
|
||||
```cpp
|
||||
// 名前はなんでもよい
|
||||
int my_putc( char c, FILE *t) {
|
||||
return Serial.write( c );
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
fdevopen( &my_putc, 0);
|
||||
// 以降printfが使える。例↓
|
||||
print("Hello world! A0 = %d\n", analogRead(0));
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
cf.
|
||||
|
||||
- <https://forum.arduino.cc/t/how-to-make-printf-work/6456>
|
||||
- <https://cega.jp/avr/avr-libc_list/>
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# 20240204180223 Carver Mead's OTA-C Lowpass Filter The Second-Order Section (Operational Transconductance Amps)
|
||||
#electronics #OTA #op_amp #analog #filter #read_later
|
||||
[Carver Mead's OTA-C Lowpass Filter: The "Second-Order Section" (Operational Transconductance Amps) - YouTube](https://www.youtube.com/watch?v=AVFN6qCKiyg)
|
Loading…
Reference in a new issue