流水源

  • 2025-01-21
  • 回复了主题帖: 【回顾2024,展望2025】新年抢楼活动来啦!

    ⑸立一个新年Flag  学会AI识别

  • 回复了主题帖: 【回顾2024,展望2025】新年抢楼活动来啦!

    ⑸立一个新年Flag  学会AI识别

  • 2025-01-14
  • 回复了主题帖: 【回顾2024,展望2025】新年抢楼活动来啦!

    ⑸立一个新年Flag  学会AI识别

  • 回复了主题帖: 【回顾2024,展望2025】新年抢楼活动来啦!

    ⑸立一个新年Flag  学会AI识别

  • 2025-01-13
  • 回复了主题帖: EEWORLD陪你过大年,新年积分兑换专场来啦~好物多多还有幸运盲盒!

    能换多种嘛??

  • 2025-01-07
  • 回复了主题帖: 【瓜分2500元红包】票选2024 DigiKey “感知万物,乐享生活”创意大赛人气作品TOP3!

    投票

  • 2025-01-03
  • 回复了主题帖: 【2024 DigiKey 创意大赛】+基于Teensy4.1环境温湿度和气压监测

    CoderX9527 发表于 2025-1-2 09:54 为大佬点赞 感谢支持

  • 回复了主题帖: 【2024 DigiKey 创意大赛】+基于Teensy4.1环境温湿度和气压监测

    L物恩纶 发表于 2025-1-1 16:27 底板有开源吗 很简单的板子,就没有

  • 2024-12-04
  • 回复了主题帖: STM32全球线上峰会,STM32N6重磅发布啦!

    已报名

  • 2024-12-03
  • 回复了主题帖: 免费下载 | 安森美电动汽车充电白皮书,看碳化硅如何缓解“里程焦虑”!

    报名成功

  • 2024-10-30
  • 回复了主题帖: ST NUCLEO-WB09KE无法烧录问题

    这个问题有解决吗?

  • 2024-10-29
  • 发表了主题帖: 【2024 DigiKey 创意大赛】+基于Teensy4.1环境温湿度和气压监测

    基于Teensy4.1环境温湿度和气压监测 作者:流水源   一  作品简介 本次作品主要主要实现环境的温湿度以及大气压的监测显示。主控MCU使用的是Teensy4.1开发板,环境参数检测使用的是BME680传感器。BME680传感器集成了测量气体,温湿度,大气压等参数。外加电子罗盘传感器ICM20948,ICM20948可以检测3轴加速度,3轴角速度和3轴磁感应,用于设备姿态检测。设备上外加了3.5寸显示屏用于显示数据。做这个设备可以很方便观察当前环境状态,可以用于户外探险环境温湿度及大气压,海拔高度监测及电子罗盘功能,也可以用于家庭室内环境监测。 特意为本次项目做了一个Teensy4.1的扩展底板,底板上安装了BME680和ICM20948传感器,以及LCD显示屏。整体如下:     二 系统框图 整个系统框图如下所示。整体设计比较简单,主要实现数据读取和显示。BME680和ICM20948这两个传感器都是用I2C接口驱动,但是设备地址不一样,所以两个传感器接在同一个I2C接口,而LCD屏使用SPI接口驱动。     三、软件功能说明 本次软件开发使用的是ArduinoIDE开发环境开发的,之前用过几次Arduino开发,觉得这个很方便,基本上驱动都写好了,只用写应用。而且Teensy4.1推荐的开发环境也是用Arduino。 用arduino开发我们首先要安装Teensy4.1开发板。 开发板安装网址: https://www.pjrc.com/teensy/package_teensy_index.json     安装之后就可以开发选择Teensy4.1开发板的例子了。   接着我们还要下载BME680和ICM20948的驱动库了。 BME680传感器我选择的是Adafruit BME680的库。   ICM20948可以用下面2个库。我使用的是第2个库。   LCD驱动库选择如下DFRobot GDL。这个LCD是DFRobot的一个显示屏模块。     开发过程中参考了例子代码,然后将例子代码整合。     下面是设备初始化过程:     然后是传感器数据监测显示界面:     显示界面可以根据陀螺仪的姿态自动切换横竖屏显示。     通过串口打印数据如下:     四、作品源码 五、作品功能演示视频 [localvideo]d6b20522b222f9493ce8015108d0a829[/localvideo]   六、项目总结 通过本次大赛有一些收获,也发现了自己的一些不足。利用本次大赛我更加熟悉使用ArduinoIDE的开发环境使用,也学习了对BME680和ICM20948传感器的驱动使用.,特别是关于ICM20948这个9轴陀螺仪的姿态的计算方式。本次大赛时间有限,项目做的有点简陋,后面有机会继续完善一下,继续加点新功能。            

  • 2024-10-27
  • 加入了学习《 【2024 DigiKey创意大赛】 《智能起居室环境控制台》任务报告汇总》,观看 【2024 DigiKey创意大赛】 《智能起居室环境控制台》任务报告汇总

  • 2024-10-09
  • 发表了主题帖: 【2024 DigiKey 创意大赛】使用Teensy4.1读取传感器测试

    本次特意做了一个Teensy4.1的扩展底板,加上了传感器座子和LCD屏接口。实现了BME680和ICM20948传感器的数据读取和显示。   扩展版如下: 底板扩展了LCD屏接口,网口,USB HOST,arduino接口,can,rs485,rs232。     开发使用的是arduino ide。直接下载teensy4.1开发板资料库和传感器BME680,ICM20948驱动。 https://www.pjrc.com/teensy/package_teensy_index.json  Teensy4.1开发板添加网址。       lcd显示数据效果。              

  • 2024-08-31
  • 回复了主题帖: >>征集 | 使用 MCU,哪些问题最令你头大?

    MCU选型主要问题: 首先是外设资源要方便查看对比,需要的外设资源是否足够。 再就是开发工具是否容易上手,开发库SDK和demo例子是否容易应用。 最后就是开发遇到问题,能有技术支持。

  • 2024-08-27
  • 发表了主题帖: 【Follow me第二季第1期】+任务提交汇总

    本帖最后由 流水源 于 2024-10-9 20:56 编辑 主要任务提交汇总: 入门开发环境使用的是arduino ide开发的。搭建环境很简单,就不多说了。具体搭建如下帖子。 【Follow me第二季第1期】arduino开发环境的搭建和点灯 https://bbs.eeworld.com.cn/thread-1289879-1-1.html   下面是基础任务一(必做):控制板载炫彩LED,跑马灯点亮和颜色变换。主要使用了Adafruit Circuit Playground Express开发板,通过USB供电。 在如下帖子,实现彩灯跑马变幻颜色。 【Follow me第二季第1期】arduino控制板载炫彩跑马灯 https://bbs.eeworld.com.cn/thread-1289916-1-1.html       上面就是红绿蓝3种不同颜色的灯循环跑马效果了。 代码: ///////////////////////////////////////////////////////////////////////////////////////// //11111111111111111111111111111111111111111111111111111111111111111111111111111111111111 #if TASK_NUM == 1 #include <Adafruit_CircuitPlayground.h> #include <Adafruit_Circuit_Playground.h> //基础任务一(必做):控制板载炫彩LED,跑马灯点亮和颜色变换 Adafruit_CircuitPlayground cplay = Adafruit_CircuitPlayground(); #define LED_PIN 13 // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_PIN, OUTPUT); Serial.begin(115200); cplay.begin(); cplay.setBrightness(50); } // the loop function runs over and over again forever void loop() { Serial.println(cplay.lightSensor()); Serial.println(cplay.temperature()); digitalWrite(LED_PIN, HIGH); // turn the LED on (HIGH is the voltage level) for (int i = 0; i < 10; i++) { cplay.setPixelColor(i, 25*i+25, 0, 0); // 设置LED为red色 delay(100); } cplay.clearPixels(); delay(100); // wait for a second digitalWrite(LED_PIN, LOW); // turn the LED off by making the voltage LOW for (int i = 0; i < 10; i++) { cplay.setPixelColor(i, 0, 0, 25*i+25); // 设置LED为blue色 delay(100); } cplay.clearPixels(); delay(100); // wait for a second for (int i = 0; i < 10; i++) { cplay.setPixelColor(i, 0, 25*i+25, 0); // 设置LED为green色 delay(100); } cplay.clearPixels(); delay(100); // wait for a second } #endif   接着基础任务二(必做):监测环境温度和光线,通过板载LED展示舒适程度。主要使用了Adafruit Circuit Playground Express开发板,通过USB供电。 具体查看如下帖子: 【Follow me第二季第1期】监测环境温度和光线,通过板载LED展示舒适程度 https://bbs.eeworld.com.cn/thread-1290437-1-1.html 主要是取温度和光照一个舒适的数据范围,在范围内,所有10个彩灯为绿色呼吸。 前5颗彩灯标识温度舒适范围,在舒适范围内5个灯绿色呼吸,高于舒适温度范围用红色灯标识,灯的数量越多表示温度越高。低于舒适温度范围用蓝色灯标识,灯的数量越多表示温度越低。 后5颗彩灯标识光照舒适范围,在舒适范围内5个灯绿色呼吸,高于舒适光照范围用红色灯标识,灯的数量越多表示光照越强。低于舒适光照范围用蓝色灯标识,灯的数量越多表示光照越弱。 下面全绿灯表示温度和光照都在设置的舒适数据范围。     下面是光照超出舒适范围,太亮了。有一边显示红灯。   下面是温度不在舒适范围,太冷了。使用蓝色灯标识。   代码如下: #if TASK_NUM == 2 //2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 #include <Adafruit_CircuitPlayground.h> #include <Adafruit_Circuit_Playground.h> //基础任务二(必做):监测环境温度和光线,通过板载LED展示舒适程度 Adafruit_CircuitPlayground cplay = Adafruit_CircuitPlayground(); #define LED_PIN 13 uint32_t lightbress; uint8_t l_dir; int light_val; int temp_val; int g_state; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_PIN, OUTPUT); Serial.begin(115200); cplay.begin(); cplay.setBrightness(50); lightbress = 0; l_dir = 0; g_state = 0; } // the loop function runs over and over again forever void loop() { light_val = cplay.lightSensor(); temp_val = cplay.temperature() * 100; Serial.println(light_val); Serial.println(temp_val); switch(g_state) { case 0: for (int i = 0; i < 10; i++) { cplay.strip.setPixelColor(i, 0, lightbress * 10, 0); // 设置LED为green色 } cplay.strip.show(); if(l_dir == 0) { lightbress++; if(lightbress == 15) l_dir = 1; }else { if(lightbress) lightbress--; else l_dir = 0; } if((light_val > 510) || (light_val < 190) || (temp_val > 3250)||(temp_val < 2950)) { lightbress = 0; g_state = 1; } break; case 1: //温度 int level; uint8_t r_color,g_color,b_color; if(temp_val > 3200) { level = (temp_val - 3200)/100; r_color = lightbress * 10; b_color = 0; g_color = 0; }else if(temp_val < 3000) { level = (3000 - temp_val)/100; b_color = lightbress * 10; r_color = 0; g_color = 0; }else { g_color = lightbress * 10; r_color = 0; b_color = 0; } if(level >= 5) level = 5; for (int i = 0; i < 5; i++) { if(i<level) cplay.strip.setPixelColor(i, r_color, g_color, b_color); // 设置LED为blue red色 else cplay.strip.setPixelColor(i, 0, g_color, 0); // 设置LED为blue red色 } //光照 if(light_val > 500) { level = (light_val - 500)/80; r_color = lightbress * 10; b_color = 0; g_color = 0; }else if(light_val < 200) { level = (200 - light_val)/30; b_color = lightbress * 10; r_color = 0; g_color = 0; }else { g_color = lightbress * 10; r_color = 0; b_color = 0; } if(level >= 5) level = 5; for (int i = 5; i < 10; i++) { if(i>=(10-level)) cplay.strip.setPixelColor(i, r_color, g_color, b_color); // 设置LED为blue red色 else cplay.strip.setPixelColor(i, 0, g_color, 0); // 设置LED为blue red色 } cplay.strip.show(); lightbress++; if(lightbress == 15) lightbress = 0; if((light_val <= 500) && (light_val >= 200) && (temp_val <= 3250) && (temp_val >= 2950)) { lightbress = 0; g_state = 0; } break; } delay(100); } #endif   接着是基础任务三(必做):接近检测——设定安全距离并通过板载LED展示,检测到入侵时,发起声音报警。 使用的是光照传感器来检测距离远近的。用手从远往近挡住光线传感器可以看到亮灯数变化。   具体帖子如下: 【Follow me第二季第1期】接近检测设定安全距离并通过板载LED展示 https://bbs.eeworld.com.cn/thread-1290460-1-1.html 使用光照来检测距离,环境光有很大影响。后面我尝试使用了红外发射和接收管来做了一下。但是使用红外时检测距离不是很大。 代码如下: #if TASK_NUM == 3 //333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 //基础任务三(必做):接近检测——设定安全距离并通过板载LED展示,检测到入侵时,发起声音报警 #include <Adafruit_CircuitPlayground.h> #include <Adafruit_Circuit_Playground.h> Adafruit_CircuitPlayground cplay = Adafruit_CircuitPlayground(); #define LED_PIN 13 int light_val; int level; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_PIN, OUTPUT); Serial.begin(115200); cplay.begin(); cplay.setBrightness(50); pinMode(CPLAY_IR_EMITTER, OUTPUT); digitalWrite(CPLAY_IR_EMITTER, LOW); // When not sending PWM, we want it low pinMode(A10, INPUT); } void loop() { uint8_t r_color,g_color,b_color; // light_val = cplay.lightSensor(); // Serial.println(light_val); // if(light_val < 350) // { // level = (350-light_val)/30; // if (CircuitPlayground.slideSwitch()) { // CircuitPlayground.speaker.enable(true); // Serial.println("Slide to the left"); // } // }else // { // level = 0; // CircuitPlayground.speaker.enable(false); // } // if(level > 7) // { // r_color = 0x50; // g_color = 0; // b_color = 0; // CircuitPlayground.playTone(500 + level * 500, 100); // }else if(level >4) // { // r_color = 0; // g_color = 0x50; // b_color = 0; // CircuitPlayground.playTone(500 + level * 500, 100); // }else // { // r_color = 0; // g_color = 0; // b_color = 0x50; // CircuitPlayground.playTone(500 + level * 500, 100); // } // for (int i = 0; i < 10; i++) // { // if(i<level) cplay.strip.setPixelColor(i, r_color, g_color, b_color); // // else cplay.strip.setPixelColor(i, 0, 0, 0); // // } // cplay.strip.show(); // Measure the proximity level and use it to light up its LEDs. digitalWrite(CPLAY_IR_EMITTER, HIGH); delay(10); digitalWrite(CPLAY_IR_EMITTER, LOW); int prox = analogRead(A10); if(prox > 650) level = 11; else if(prox < 300) level = 0; else level = (prox - 300)/34; Serial.print("IR_Vol:");Serial.println(prox); Serial.print("Level: ");Serial.println(level); for (int i = 0; i < 10; i++) { if(i<level) cplay.strip.setPixelColor(i, 250, 0, 0); // else cplay.strip.setPixelColor(i, 0, 0, 0); // } CircuitPlayground.strip.show(); if (level > 4) { CircuitPlayground.playTone(330, 100); } delay(100); } #endif   再接着是进阶任务(必做):制作不倒翁——展示不倒翁运动过程中的不同灯光效果。 这个是通过读取加速度传感器来实现不同姿态显示灯光。通过Z轴加速度来确定倾斜的角度大小,角度越小就显示红色灯,角度越大实现蓝色灯垂下的效果。 通过X,Y轴加速度的数值来确定方位,通过正负值分为4个象限来显示周围的灯。 下面是倾斜不同角度的灯光效果。       当水平放置时,所有灯为红色,并且有个绿灯跑马灯效果。   代码: #if TASK_NUM == 4 //444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 //进阶任务(必做):制作不倒翁——展示不倒翁运动过程中的不同灯光效果 #include <Adafruit_CircuitPlayground.h> #define LED_PIN 13 int x,y,z; uint8_t r,g,b; uint8_t led_color[16][4]; uint8_t led_num,led_index; // the setup function runs once when you press reset or power the board void setup() { pinMode(LED_PIN, OUTPUT); Serial.begin(115200); Serial.println("Circuit Playground test!"); CircuitPlayground.begin(); CircuitPlayground.strip.setBrightness(255); led_num = 6; led_index = 0; } void loop() { x = CircuitPlayground.motionX() * 100; y = CircuitPlayground.motionY() * 100; z = CircuitPlayground.motionZ() * 100; if((z > 900) || (z < -900)) led_num = 6; else if((z > 830) || (z < -830)) led_num = 5; else if((z > 750) || (z < -750)) led_num = 4; else if((z > 600) || (z < -600)) led_num = 3; else if((z > 300) || (z < -300)) led_num = 2; else led_num = 1; if(led_num < 6) { if((x>0) && (y>0)) //1 { int ttan = 100*y / x; if(ttan < 26) led_index = 9; else if(ttan < 100) led_index = 10; else if(ttan < 373) led_index = 11; else led_index = 0; }else if((x<0) && (y>0)) //2 { int ttan = 0 - (100*y / x); if(ttan < 26) led_index = 3; else if(ttan < 100) led_index = 2; else if(ttan < 373) led_index = 1; else led_index = 0; }else if((x<0) && (y<0)) //3 { int ttan = (100*y / x); if(ttan < 26) led_index = 3; else if(ttan < 100) led_index = 4; else if(ttan < 373) led_index = 5; else led_index = 6; }else if((x>0) && (y<0)) //4 { int ttan = 0 - (100*y / x); if(ttan < 26) led_index = 9; else if(ttan < 100) led_index = 8; else if(ttan < 373) led_index = 7; else led_index = 6; } }else { led_index ++; led_index %= 12; } for (int i = 1; i <= 6; i++) { if(i<=led_num) { led_color[(led_index + i) % 12 ][0] = 0x80; led_color[(led_index + i) % 12 ][1] = 0; led_color[(led_index + i) % 12 ][2] = 0; led_color[(12 + led_index - i) % 12 ][0] = 0x80; led_color[(12 + led_index - i) % 12 ][1] = 0; led_color[(12 + led_index - i) % 12 ][2] = 0; }else { led_color[(led_index + i) % 12 ][0] = 0; led_color[(led_index + i) % 12 ][1] = 0; led_color[(led_index + i) % 12 ][2] = 0x30; led_color[(12 + led_index - i) % 12 ][0] = 0; led_color[(12 + led_index - i) % 12 ][1] = 0; led_color[(12 + led_index - i) % 12 ][2] = 0x30; } } led_color[(led_index )][0] = 0; led_color[(led_index )][1] = 0xF0; led_color[(led_index )][2] = 0; for (int i = 1; i < 12; i++) { if(i<6) { CircuitPlayground.strip.setPixelColor(i-1,led_color[i][0], led_color[i][1], led_color[i][2]); // } else if(i>6) { CircuitPlayground.strip.setPixelColor(i-2,led_color[i][0], led_color[i][1], led_color[i][2]); // } } CircuitPlayground.strip.show(); /************* TEST ACCEL */ // Display the results (acceleration is measured in m/s*s) Serial.print("X: "); Serial.print(x); Serial.print(" \tY: "); Serial.print(y); Serial.print(" \tZ: "); Serial.print(z); Serial.println(" m/s^2"); delay(50); digitalWrite(LED_PIN, HIGH); delay(50); digitalWrite(LED_PIN, LOW); } #endif   最后是创意任务:钢琴弹奏,通过触摸引脚弹奏音乐,并配合灯光效果。 板上有7个触摸端口,正好可以对应do、re、mi、fa、sol、la、si 7个音节。这里还实现了通过左右按键来改变低,中,高音。   主要代码如下: #if TASK_NUM == 5 //5555555555555555555555555555555555555555555555555555555555555555555555555555555 //创意任务三:水果钢琴——通过触摸水果弹奏音乐,并配合灯光效果 #include <Adafruit_CircuitPlayground.h> #define LED_PIN 13 #define TONE_DURATION_MS 80 // Duration in milliseconds to play a tone when touched. uint16_t CAP_THRESHOLD = 200; // Threshold for a capacitive touch (higher = less sensitive). uint8_t playSound; uint16_t cap_val; uint8_t music_lmh = 1; //0-低音,1-中音,2-高音 uint16_t music_hz_tbl[3][8]= //音频对照表 { {262, 294, 330, 349, 392, 440, 494, 0}, {523, 587, 659, 698, 784, 880, 988, 0}, {1046, 1175, 1318, 1397, 1568, 1760, 1976, 0}, }; void setup() { pinMode(LED_PIN, OUTPUT); Serial.begin(115200); Serial.println("Circuit Playground test!"); CircuitPlayground.begin(); CAP_THRESHOLD = 600; } void loop() { if (CircuitPlayground.slideSwitch()) { if(playSound) Serial.println("Slide to the left"); playSound = 0; } else { if(!playSound) Serial.println("Slide to the right"); playSound = 1; } /************* TEST BOTH BUTTONS */ if (CircuitPlayground.leftButton()) { Serial.println("Left level ++"); music_lmh++; if(music_lmh>2) music_lmh=2; while(CircuitPlayground.leftButton()) delay(10); } if (CircuitPlayground.rightButton()) { Serial.println("Right level --"); if(music_lmh) music_lmh--; while(CircuitPlayground.rightButton()) delay(10); } //清除灯 for (int i=0; i<10; ++i) { CircuitPlayground.strip.setPixelColor(i, 0); } CircuitPlayground.strip.show(); //11111111111111111111111111111111 cap_val = CircuitPlayground.readCap(3); if (cap_val >= CAP_THRESHOLD) { Serial.print("#1:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(0)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][0], TONE_DURATION_MS); // 262hz = C4 } } //2222222222222222222222222222222 cap_val = CircuitPlayground.readCap(2); if (cap_val >= CAP_THRESHOLD) { Serial.print("\t#2:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(256/10)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][1], TONE_DURATION_MS); // 294hz = D4 } } //333333333333333333333333333333333 cap_val = CircuitPlayground.readCap(0); if (cap_val >= CAP_THRESHOLD) { Serial.print("\t\t#3:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(256/10*3)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][2], TONE_DURATION_MS); // 330hz = E4 } } //4444444444444444444444444444444444 cap_val = CircuitPlayground.readCap(1); if (cap_val >= CAP_THRESHOLD) { Serial.print("\t\t\t#4:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(256/10*4)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][3], TONE_DURATION_MS); // 349hz = F4 } } //555555555555555555555555555555555 cap_val = CircuitPlayground.readCap(6); if (cap_val >= CAP_THRESHOLD) { Serial.print("\t\t\t\t#5:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(256/10*5)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][4], TONE_DURATION_MS); // 392hz = G4 } } //66666666666666666666666666666666666 cap_val = CircuitPlayground.readCap(9); if (cap_val >= CAP_THRESHOLD) { Serial.print("\t\t\t\t\t#6:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(256/10*6)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][5], TONE_DURATION_MS); // 440hz = A4 delay(5); } } //7777777777777777777777777777777777777 cap_val = CircuitPlayground.readCap(10); if (cap_val >= CAP_THRESHOLD) { Serial.print("\t\t\t\t\t\t#7:"); Serial.println(cap_val); if (playSound) { for (int i=0; i<10; ++i) CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.colorWheel(256/10*8)); CircuitPlayground.strip.show(); CircuitPlayground.playTone(music_hz_tbl[music_lmh][6], TONE_DURATION_MS); // 494hz = B4 } } delay(30); } #endif   代码文件:   最后总结:     第一次参加这个活动,比较顺利完成了上述任务。这次参加活动主要使用了arduino ide来开发,也是初次使用这个arduino。以前也听说了很多arduino的优势,但是没怎么用过。当初参加活动也是为了学习一下arduino的开发方式。所以开始的时候花了不少时间熟悉这个arduino开发环境,总的来说用过之后感觉用这个arduino开发太方便了,外设所有驱动都写好了,直接写应用就可以了。再就是这个Adafruit Circuit Playground Express开发板上面板载外设多,功能强大,不需要外接设备就可以做很多创意了,这也是吸引我的地方。   下面就是整个任务的视频效果。 视频: [localvideo]49fb950afe097f7e6b1cd3624da1432c[/localvideo]    

  • 2024-08-25
  • 加入了学习《【Follow me第二季第1期】汇总任务报告》,观看 【Follow me第二季第1期】汇总任务报告

  • 2024-08-14
  • 回复了主题帖: 【Follow me第二季第1期】接近检测设定安全距离并通过板载LED展示

    秦天qintian0303 发表于 2024-8-13 21:03 有一个人用这种方法后就大家都用这种方法了,只能说也算是一种方法,不过明显是希望用红外反射的方法进行 ... 就是红外应该只是个开关信号,就做不了渐变

  • 回复了主题帖: 【Follow me第二季第1期】接近检测设定安全距离并通过板载LED展示

    wangerxian 发表于 2024-8-13 19:13 光线传感器测量接近距离?那环境光影响不是很大咯? 环境光如果在变化肯定是有影响的。利用红外的进行接近检测还没研究出来,晚点尝试一下红外的

  • 回复了主题帖: 【2024 DigiKey 创意大赛】开箱贴

    wangerxian 发表于 2024-8-13 19:20 哪个板子上有这么多传感器?没看到呀。 那2个小板子上都是传感器

最近访客

< 1/2 >

统计信息

已有23人来访过

  • 芯积分:1364
  • 好友:--
  • 主题:13
  • 回复:26

留言

你需要登录后才可以留言 登录 | 注册


现在还没有留言