2025年4月8日火曜日

Kaluma(2nd) speaker,tm1367,hcsr04,max7219,mcp3008,neopixel

以下のようにしてできたpicowとちがった

const LED = 15;
pinMode(LED,OUTPUT);
setInterval(()=>{ digitalToggle(LED);}, 2000);
---------------------AT command----------------------------
https://www.instructables.com/How-to-Send-AT-Command-to-WizFi360-EVB-Pico-Using-/ uart1をつかっている注意必要

ーーpassive buzzerーーーーーーーーーーーーーーーーーーーーー
passive-buzzer OK (active buzzer not ok....) あっさり成功
(+)と(ー)をまちがえんこと
-------------tm1367--------7segment LED display-----------

手持ちのそれでclkをgpio0,dioをgpio1につなぐ 3.3v駆動
 
const {TM1637} = require('tm1637');
const tm1637 = new TM1637(0, 1); // CLK=0, DIO=1 for gpio
var i=0;
// Show "03:15"
tm1637.setDigit(0, TM1637.DIGIT[0]); // 0
tm1637.setDigit(1, TM1637.DIGIT[3] | TM1637.SEG_X); // 3:
tm1637.setDigit(2, TM1637.DIGIT[1]); // 1
tm1637.setDigit(3, TM1637.DIGIT[5]); // 5
delay(1000);

// Change brightness (0 ~ 7)
for (i = 0; i <= 7; i++) {
  tm1637.setBrightness(i);
  delay(500);
}
delay(1000);

// Display on and off (blinking)
for (i = 0; i < 10; i++) {
  tm1637.off();
  delay(100);
  tm1637.on();
  delay(100);
}
delay(1000);

// Show number from 0 to 500
for (i = 0; i <= 500; i++) {
  tm1637.display(i);
}
delay(1000);

// Show "done"
tm1637.setDigit(0, TM1637.SEG_B | TM1637.SEG_C | TM1637.SEG_D | TM1637.SEG_E | TM1637.SEG_G); // d
tm1637.setDigit(1, TM1637.SEG_C | TM1637.SEG_D | TM1637.SEG_E | TM1637.SEG_G); // o
tm1637.setDigit(2, TM1637.SEG_C | TM1637.SEG_E | TM1637.SEG_G); // n
tm1637.setDigit(3, TM1637.SEG_A | TM1637.SEG_B | TM1637.SEG_D | TM1637.SEG_E | TM1637.SEG_F | TM1637.SEG_G); // e

0 件のコメント:

コメントを投稿