2507 views|20 replies

3386

Posts

0

Resources
The OP
 

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of Xingkong board (Part 2) [Copy link]

 
 
This post was last edited by eagler8 on 2022-6-18 19:35

The Xingkong board integrates light sensors, microphones, buzzers, Wifi, Bluetooth, accelerometers, and buttons. There is an LCD color screen on the front that can display a variety of Python running results in real time, including text, pictures, videos, game screens, and data charts.

[Hua Diao Experience] 01 Getting started with Xingkong Board
https://bbs.eeworld.com.cn/thread-1206624-1-1.html
[Hua Diao Experience] 02 Simple use of Xingkong Board
https://bbs.eeworld.com.cn/thread-1206649-1-1.html
[Hua Diao Experience] 03 Building the development environment of Xingkong Board Mind+
https://bbs.eeworld.com.cn/thread-1206665-1-1.html
[Hua Diao Experience] 04 Testing the common functions of Xingkong Board

https://bbs.eeworld.com.cn/thread-1206842-1-1.html
[Hua Diao Experience] 05 Building a development environment for Xingkong board: SSH connection and Jupyter programming

https://bbs.eeworld.com.cn/thread-1207265-1-1.html
[Hua Diao Experience] 06 Building a Xingkong board development environment for Thonny programming

https://bbs.eeworld.com.cn/thread-1207286-1-1.html
[Hua Diao Experience] 07 Building a Xingkong board development environment for VSCode programming

https://bbs.eeworld.com.cn/thread-1207329-1-1.html

[Hua Diao Experience] 08 Series of tests on the hardware control pinpong library of Xingkong board (Part 1)

https://bbs.eeworld.com.cn/thread-1207410-1-1.html

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of Xingkong board (Part 2)

https://bbs.eeworld.com.cn/thread-1207480-1-1.html

Latest reply

This board has everything.  Details Published on 2022-6-19 10:39
 
 

3386

Posts

0

Resources
2
 

5. A series of tests on the onboard resources of the Xingkong board
(4) Onboard sound sensor (silicon microphone)
[Popular Science Knowledge Point] Sound is widely present in life. We can use sound to make many interactive controls, such as voice-controlled lights in the corridor. Through the sound sensor, you can clap your hands or speak loudly in front of the detection head (Mic) to control the lights through sound. The sensor converts the vibration of the sound in the microphone head into an electrical signal output. The sound sensor has a built-in capacitive electret microphone or silicon microphone that is sensitive to sound. The sound wave causes the electret film in the microphone to vibrate, resulting in a change in capacitance and a corresponding small voltage. This voltage is then converted into a voltage of 0-5V and received by the data collector through A/D conversion. The sound sensor is equivalent to a microphone. It can sense sound and convert the perceived sound size into a corresponding analog signal output. It is widely used in scenarios such as mobile phones, recorders, voice-controlled lighting, medical equipment, deep-sea measurement, traffic artery noise monitoring, and industrial enterprise noise detection.

 
 
 

3386

Posts

0

Resources
3
 

The microphone on the Xingkong board is not an ordinary sound sensor, but a high-quality silicon microphone that can directly record for voice recognition. Therefore, it is connected to the CPU instead of the co-processor. Therefore, the pinpong library is not used to obtain the ambient sound intensity, but the Audio class in the unihiker library is used to obtain it.

Get the ambient volume sound_level
Note: The ambient volume range is 0%-100%, similar to the microphone volume on a computer.

语法:Audio对象.sound_level()
返回值: 音量大小
输入参数: 无

 
 
 

3386

Posts

0

Resources
4
 
This post was last edited by eagler8 on 2022-6-19 05:12

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of the Xingkong board (Part 2)
Testing of the onboard resources of the Xingkong board - Mind+ code programming
Test program eight: Onboard sound sensor (measuring the intensity of ambient sound)

#【花雕体验】09行空板硬件控制pinpong库的系列测试(之二)
# 行空板板载资源的测试——Mind+代码编程
# 测试程序八:板载声音传感器(测量环境声音强度)

#  -*- coding: UTF-8 -*-
import time
from unihiker import Audio

audio = Audio() #实例化音频
print("板载声音传感器(测量环境声音强度)")

while True:
    value = audio.sound_level() #获取环境音量
    print("环境音=%d"%(value)) #终端打印信息
    time.sleep(1) #等待1秒 保持状态

 
 
 

3386

Posts

0

Resources
5
 

Experimental serial port return status

 
 
 

3386

Posts

0

Resources
6
 

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of the Xingkong board (Part 2)
Testing of the onboard resources of the Xingkong board - Mind+ Graphical Programming
Test program nine: Onboard sound sensor (voice-controlled switch with threshold setting)

 
 
 

3386

Posts

0

Resources
7
 

Experimental serial port return status

 
 
 

3386

Posts

0

Resources
8
 

(5) Onboard buzzer
[Popular Science Knowledge Point] A buzzer is an electronic sounder with an integrated structure. It is powered by a DC voltage and is widely used as a sound-generating device in electronic products such as computers, printers, copiers, alarms, electronic toys, automotive electronic equipment, telephones, timers, etc. Buzzers are mainly divided into two types: piezoelectric buzzers and electromagnetic buzzers. Buzzers are represented by the letters "H" or "HA" in the circuit (the old standard uses "FM", "ZZG", "LB", "JD", etc.). Electromagnetic buzzers are composed of an oscillator, an electromagnetic coil, a magnet, a vibrating diaphragm, and a shell. After the power is turned on, the audio signal current generated by the oscillator passes through the electromagnetic coil, causing the electromagnetic coil to generate a magnetic field. Under the interaction between the electromagnetic coil and the magnet, the vibrating diaphragm vibrates periodically and makes a sound. According to the principle of its driving method, it can be divided into: active buzzers (containing a driving circuit, also called self-excited buzzers) and passive buzzers (externally driven, also called externally excited buzzers).

 
 
 

3386

Posts

0

Resources
9
 
This post was last edited by eagler8 on 2022-6-19 11:27

There is a buzzer (passive) on the back panel of the Xingkong board, which can emit a set tone.

 
 
 

4771

Posts

12

Resources
10
 
This board has everything.

Comments

Yes, it is a board suitable for programming teaching  Details Published on 2022-6-19 11:28
 
 
 

3386

Posts

0

Resources
11
 
Azuma Simeng posted on 2022-6-19 10:39 This board has everything

Yes, it is a board suitable for programming teaching

 
 
 

3386

Posts

0

Resources
12
 

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of the Xingkong board (Part 2)
Testing of the onboard resources of the Xingkong board - Mind+ code programming
Test program 10: Testing the onboard buzzer (simple song)

#【花雕体验】08行空板硬件控制pinpong库的系列测试(之二)
# 行空板板载资源的测试——Mind+代码编程
#测试程序十:测试板载蜂鸣器(简单曲子)

#  -*- coding: UTF-8 -*-
from pinpong.extension.unihiker import *
from pinpong.board import Board,Pin

Board().begin()
print("测试板载蜂鸣器(简单曲子)")

while True:
    buzzer.pitch(392,2)
    buzzer.pitch(392,2)
    buzzer.pitch(440,2)
    buzzer.pitch(440,2)
    buzzer.pitch(392,2)
    buzzer.pitch(494,2)

 
 
 

3386

Posts

0

Resources
13
 

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of the Xingkong board (Part 2)
Testing of the onboard resources of the Xingkong board - Mind+ Graphics Programming
Test Program 11: Play three built-in short songs continuously

 
 
 

3386

Posts

0

Resources
14
 

(6) Board-mounted acceleration sensor
[Popular Science Knowledge Point] An acceleration sensor is a sensor that can measure acceleration. It is usually composed of a mass block, a damper, an elastic element, a sensitive element, and an adaptive circuit. During the acceleration process, the sensor measures the inertial force exerted on the mass block and uses Newton's second law to obtain the acceleration value. Depending on the sensor's sensitive element, common acceleration sensors include capacitive, inductive, strain, piezoresistive, and piezoelectric. The picture shows an enlarged shot of a board-mounted acceleration sensor chip.

 
 
 

3386

Posts

0

Resources
15
 

After a rough search on the Internet, the model number is ICM-20689, which is a six-axis accelerometer sensor chip IC package QFN24 silk screen IC2689. The description found is:

The ICM-20689 is a 6-axis MotionTracking device that combines a 3-axis gyroscope, 3-axis accelerometer in a small 4x4x0.9mm (24-pin QFN) package.

Large 4K byte FIFO reduces traffic on the serial bus interface and reduces power consumption by allowing the system processor to burst read sensor data and then enter low power mode Gyroscope programmable FSR of ±250dps, ±500dps, ±1000dps and ±2000dps, accelerometer with programmable FSR of ±2g, ±4g, ±8g and ±16g, EIS FSYNC support ICM-20689 includes on-chip 16-bit ADC, programmable digital filter, embedded temperature sensor and programmable interrupt. The device operates at a voltage range as low as 1.71 V. Communication ports include IC and high-speed SPI at 8 MHz.

 
 
 

3386

Posts

0

Resources
16
 

The back panel of the Xingkong board is equipped with a 6-axis acceleration gyroscope sensor, which can read the x, y, and z values of the acceleration and gyroscope respectively.

语法:
加速度:accelerometer.get_x() accelerometer.get_y() accelerometer.get_z() accelerometer.get_x()
陀螺仪:gyroscope.get_x() gyroscope.get_y() gyroscope.get_z()
返回值:加速度陀螺仪的值
输入值:无

 
 
 

3386

Posts

0

Resources
17
 

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of the Xingkong board (Part 2)
Testing of the onboard resources of the Xingkong board - Mind+ code programming
Test program 12: Testing the onboard 6-axis accelerometer gyroscope sensor

#【花雕体验】09行空板硬件控制pinpong库的系列测试(之二)
#行空板板载资源的测试——Mind+代码编程
#测试程序十二:测试板载6轴加速度陀螺仪传感器

# -*- coding: utf-8 -*-
import time
from pinpong.board import *
from pinpong.extension.unihiker import *

Board().begin()  #初始化
print("测试板载6轴加速度陀螺仪传感器")

while True:
  print(accelerometer.get_x())                    #读取加速度X的值
  print(accelerometer.get_y())                    #读取加速度Y的值
  print(accelerometer.get_z())                    #读取加速度Z的值
  print(accelerometer.get_strength())             #读取加速度强度(x、y、z方向的合力)
  print(gyroscope.get_x())                        #读取陀螺仪X的值
  print(gyroscope.get_y())                        #读取陀螺仪Y的值
  print(gyroscope.get_z())                        #读取陀螺仪Z的值
  print("------------------")
  time.sleep(1)

 
 
 

3386

Posts

0

Resources
18
 

Experimental serial port return status

 
 
 

3386

Posts

0

Resources
19
 

[Hua Diao Experience] 09 Series of tests on the hardware control pinpong library of the Xingkong board (Part 2)
Testing of the onboard resources of the Xingkong board - Mind+ Graphical Programming
Test program 13: Testing the onboard 6-axis accelerometer gyroscope sensor

 
 
 

3386

Posts

0

Resources
20
 

Experimental serial port return status

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list