当前位置: 首页 > news >正文

长沙一键建站系统南城网站建设公司如何

长沙一键建站系统,南城网站建设公司如何,简约网站设计欣赏,网页模板怎么下载知识点:什么是掌控板? 掌控板是一块普及STEAM创客教育、人工智能教育、机器人编程教育的开源智能硬件。它集成ESP-32高性能双核芯片,支持WiFi和蓝牙双模通信,可作为物联网节点,实现物联网应用。同时掌控板上集成了OLED…

知识点:什么是掌控板?
掌控板是一块普及STEAM创客教育、人工智能教育、机器人编程教育的开源智能硬件。它集成ESP-32高性能双核芯片,支持WiFi和蓝牙双模通信,可作为物联网节点,实现物联网应用。同时掌控板上集成了OLED显示屏、RGB灯、加速度计、麦克风、光线传感器、蜂鸣器、按键开关、触摸开关、金手指外部拓展接口,支持图形化及MicroPython代码编程,可实现智能机器人、创客智造作品等智能控制类应用。

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

掌控板硬件特性:
ESP-32主控
处理器:Tensilica LX6双核处理器(一核处理高速连接;一核独立应用开发)
主频:高达240MHz的时钟频率
SRAM:520KB
Flash:8MB
Wi-Fi标准:FCC/CE/TELEC/KCC
Wi-Fi协议:802.11 b/g/n/d/e/i/k/r (802.11n,速度高达150 Mbps),A-MPDU和A-MSDU聚合,支持0.4us防护间隔
频率范围:2.4~2.5 GHz
蓝牙协议:符合蓝牙v4.2 BR/EDR和BLE标准
蓝牙音频:CVSD和SBC音频低功耗:10uA
供电方式:Micro USB供电
工作电压:3.3V
最大工作电流:200mA
最大负载电流:1000mA
掌控板载
三轴加速度计MSA300,测量范围:±2/4/8/16G
地磁传感器MMC5983MA,测量范围:±8 Gauss;精度0.4mGz,电子罗盘误差±0.5°
光线传感器
麦克风
3 颗全彩ws2812灯珠
1.3英寸OLED显示屏,支持16*16字符显示,分辨率128x64
无源蜂鸣器
支持2个物理按键(A/B)、6个触摸按键
支持1路鳄鱼夹接口,可方便接入各种阻性传感器
拓展接口
20通道数字I/O, (其中支持12路PWM,6路触摸输入)
5通道12bit模拟输入ADC,P0~P4
1路的外部输入鳄鱼夹接口:EXT/GND
支持I2C、UART、SPI通讯协议

在这里插入图片描述
在这里插入图片描述
15、倾斜和摇晃的一双眼睛

#MicroPython动手做(20)——掌控板之三轴加速度
#倾斜和摇晃的一双眼睛(应用字典函数)

#MicroPython动手做(20)——掌控板之三轴加速度
#倾斜和摇晃的一双眼睛(应用字典函数)from mpython import *
from machine import Timer
import time_is_shaked = _is_thrown = False
_last_x = _last_y = _last_z = _count_shaked = _count_thrown = 0
def on_shaked():pass
def on_thrown():passtim11 = Timer(11)def timer11_tick(_):global _is_shaked, _is_thrown, _last_x, _last_y, _last_z, _count_shaked, _count_thrownif _is_shaked:_count_shaked += 1if _count_shaked == 5: _count_shaked = 0if _is_thrown:_count_thrown += 1if _count_thrown == 10: _count_thrown = 0if _count_thrown > 0: returnx=accelerometer.get_x(); y=accelerometer.get_y(); z=accelerometer.get_z()_is_thrown = (x * x + y * y + z * z < 0.25)if _is_thrown: on_thrown();returnif _last_x == 0 and _last_y == 0 and _last_z == 0:_last_x = x; _last_y = y; _last_z = z; returndiff_x = x - _last_x; diff_y = y - _last_y; diff_z = z - _last_z_last_x = x; _last_y = y; _last_z = zif _count_shaked > 0: return_is_shaked = (diff_x * diff_x + diff_y * diff_y + diff_z * diff_z > 1)if _is_shaked: on_shaked()tim11.init(period=100, mode=Timer.PERIODIC, callback=timer11_tick)_dir = ''
def on_tilt_forward():pass
def on_tilt_back():pass
def on_tilt_right():pass
def on_tilt_left():pass
def on_tilt_none():passtim14 = Timer(14)def timer14_tick(_):global _dirif accelerometer.get_x() < -0.3:if 'F' != _dir:_dir = 'F';on_tilt_forward()elif accelerometer.get_x() > 0.3:if 'B' != _dir:_dir = 'B';on_tilt_back()elif accelerometer.get_y() < -0.3:if 'R' != _dir:_dir = 'R';on_tilt_right()elif accelerometer.get_y() > 0.3:if 'L' != _dir:_dir = 'L';on_tilt_left()else:if '' != _dir:_dir = '';on_tilt_none()tim14.init(period=200, mode=Timer.PERIODIC, callback=timer14_tick)def on_tilt_forward():global face, dt_facesface = dt_faces.get("Up")def on_tilt_back():global face, dt_facesface = dt_faces.get("Down")def on_tilt_left():global face, dt_facesface = dt_faces.get("Left")def on_tilt_right():global face, dt_facesface = dt_faces.get("Right")def on_tilt_none():global face, dt_facesface = dt_faces.get("Neutral")image_picture = Image()dt_faces = {"Neutral":image_picture.load('face/Eyes/Neutral.pbm', 0), "Up":image_picture.load('face/Eyes/Up.pbm', 0), "Down":image_picture.load('face/Eyes/Down.pbm', 0), "Left":image_picture.load('face/Eyes/Middle left.pbm', 0), "Right":image_picture.load('face/Eyes/Middle right.pbm', 0), "Dizzy":image_picture.load('face/Eyes/Dizzy.pbm', 0)}
face = dt_faces.get("Neutral")
while True:oled.fill(0)if _is_shaked:oled.blit(dt_faces.get("Dizzy"), 20, 0)oled.show()time.sleep_ms(2000)else:oled.blit(face, 20, 0)oled.show()

字典
字典是一种可变容器模型,且可存储任意类型对象,格式如 d = {key1 : value1, key2 : value2},键必须是唯一的,但值则不必。

mPython X 图形编程
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

16、水平仪和测量角度

#MicroPython动手做(20)——掌控板之三轴加速度
#水平仪和测量角度

#MicroPython动手做(20)——掌控板之三轴加速度
#水平仪和测量角度from mpython import *
import math
import framebuf
import font.dvsm_12
import timedef get_tilt_angle(_axis):_Ax = accelerometer.get_x()_Ay = accelerometer.get_y()_Az = accelerometer.get_z()if 'X' == _axis:_T = math.sqrt(_Ay ** 2 + _Az ** 2)if _Az < 0: return math.degrees(math.atan2(_Ax , _T))else: return 180 - math.degrees(math.atan2(_Ax , _T))elif 'Y' == _axis:_T = math.sqrt(_Ax ** 2 + _Az ** 2)if _Az < 0: return math.degrees(math.atan2(_Ay , _T))else: return 180 - math.degrees(math.atan2(_Ay , _T))elif 'Z' == _axis:_T = math.sqrt(_Ax ** 2 + _Ay ** 2)if (_Ax + _Ay) < 0: return 180 - math.degrees(math.atan2(_T , _Az))else: return math.degrees(math.atan2(_T , _Az)) - 180return 0def display_font(_font, _str, _x, _y, _wrap, _z=0):_start = _xfor _c in _str:_d = _font.get_ch(_c)if _wrap and _x > 128 - _d[2]: _x = _start; _y += _d[1]if _c == '1' and _z > 0: oled.fill_rect(_x, _y, _d[2], _d[1], 0)oled.blit(framebuf.FrameBuffer(bytearray(_d[0]), _d[2], _d[1],framebuf.MONO_HLSB), (_x+int(_d[2]/_z)) if _c=='1' and _z>0 else _x, _y)_x += _d[2]while True:Tx = get_tilt_angle('X')oled.fill(0)display_font(font.dvsm_12, (str(" Angle :") + str(Tx)), 0, 0, False)oled.circle(64, 60, 46, 1)oled.fill_circle(64, 60, 5, 1)Dx = int((64 + math.cos(math.radians(Tx)) * 46))Dy = int((60 - math.fabs(math.sin(math.radians(Tx)) * 46)))oled.hline(0, 60, 128, 1)oled.line(64, 60, Dx, Dy, 1)oled.fill_rect(0, 61, 128, 3, 0)oled.vline(64, 61, 2, 1)Lx = int(numberMap(accelerometer.get_y(),(-1),1,128,0))oled.vline(Lx, 61, 3, 1)if Lx == 64:rgb.fill((int(0), int(51), int(0)))rgb.write()time.sleep_ms(1)oled.fill_circle(13, 20, 3, 1)oled.hline(7, 20, 13, 1)else:oled.fill_rect(7, 16, 13, 6, 0)rgb.fill( (0, 0, 0) )rgb.write()time.sleep_ms(1)oled.show()

mPython X 图形编程
在这里插入图片描述
在这里插入图片描述

17、掌控闪灯大量程计步器(十万步)

#MicroPython动手做(20)——掌控板之三轴加速度
#掌控闪灯大量程计步器(十万步)

#MicroPython动手做(20)——掌控板之三轴加速度
#掌控闪灯大量程计步器(十万步)from mpython import *from machine import Timer_is_shaked = _is_thrown = False
_last_x = _last_y = _last_z = _count_shaked = _count_thrown = 0
def on_shaked():pass
def on_thrown():passtim11 = Timer(11)def timer11_tick(_):global _is_shaked, _is_thrown, _last_x, _last_y, _last_z, _count_shaked, _count_thrownif _is_shaked:_count_shaked += 1if _count_shaked == 5: _count_shaked = 0if _is_thrown:_count_thrown += 1if _count_thrown == 10: _count_thrown = 0if _count_thrown > 0: returnx=accelerometer.get_x(); y=accelerometer.get_y(); z=accelerometer.get_z()_is_thrown = (x * x + y * y + z * z < 0.25)if _is_thrown: on_thrown();returnif _last_x == 0 and _last_y == 0 and _last_z == 0:_last_x = x; _last_y = y; _last_z = z; returndiff_x = x - _last_x; diff_y = y - _last_y; diff_z = z - _last_z_last_x = x; _last_y = y; _last_z = zif _count_shaked > 0: return_is_shaked = (diff_x * diff_x + diff_y * diff_y + diff_z * diff_z > 1)if _is_shaked: on_shaked()tim11.init(period=100, mode=Timer.PERIODIC, callback=timer11_tick)import timeimport framebufimport font.digiface_30def display_font(_font, _str, _x, _y, _wrap, _z=0):_start = _xfor _c in _str:_d = _font.get_ch(_c)if _wrap and _x > 128 - _d[2]: _x = _start; _y += _d[1]if _c == '1' and _z > 0: oled.fill_rect(_x, _y, _d[2], _d[1], 0)oled.blit(framebuf.FrameBuffer(bytearray(_d[0]), _d[2], _d[1],framebuf.MONO_HLSB), (_x+int(_d[2]/_z)) if _c=='1' and _z>0 else _x, _y)_x += _d[2]
bbb = 0
while True:oled.fill(0)oled.DispChar('掌控计步器', 35, 2, 1)oled.DispChar('步', 115, 40, 1)if _is_shaked:rgb.fill((int(0), int(102), int(0)))rgb.write()time.sleep_ms(1)time.sleep_ms(60)rgb.fill((int(0), int(0), int(0)))rgb.write()time.sleep_ms(1)bbb = bbb + 1else:rgb.fill((int(153), int(0), int(0)))rgb.write()time.sleep_ms(1)if bbb >= 0 and bbb <= 9:display_font(font.digiface_30, (str(bbb)), 55, 24, False, 2)elif bbb >= 9 and bbb <= 99:display_font(font.digiface_30, (str(bbb)), 45, 24, False, 2)elif bbb >= 99 and bbb <= 999:display_font(font.digiface_30, (str(bbb)), 35, 24, False, 2)elif bbb >= 999 and bbb <= 9999:display_font(font.digiface_30, (str(bbb)), 20, 24, False, 2)elif bbb >= 9999 and bbb <= 99999:display_font(font.digiface_30, (str(bbb)), 10, 24, False, 2)oled.show()

注解
使用摇晃模块,优点是算法简单,不足之处是触发计步的阙值是固定的,不能调整

mPython 图形编程
在这里插入图片描述
在这里插入图片描述

http://www.yayakq.cn/news/105155/

相关文章:

  • 江门建站软件长春网站建设公司怎么样
  • dw做asp购物网站微信 小程序 wordpress
  • 外贸类网站建设wordpress个人网站主题
  • 珠海市官网网站建设平台壁画网站建设
  • 大数据营销方法全网seo
  • 嘉定网站设计怎么在网上做公司的网站
  • xcode 网站开发网站更换目录名如何做301跳转
  • 全屋定制怎么营销wordpress 国内优化
  • 深圳网站建设总部网站换服务器有影响吗
  • 模板建站服务器黑龙江省建设会计协会网站首页
  • 网站建设属于IT网站建设刂搜金手指下拉二五
  • 制作网站 服务器配置自助小站
  • 做商城网站的公司成都市做网站
  • 租用网站的服务器南京网站设计制作公司排名榜
  • 流行的网站开发语言wordpress插件的语言设定
  • 深圳宝安固戍小学网站建设医院手机网站模板
  • 网站建设带购物车太仓网站开发
  • 美食网站建设策划书互联网站备案信息查询
  • 云南城市建设职业学院spoc网站建筑公司logo设计
  • 专业网网站建设岳阳网站建设有哪些
  • 金融软件网站建设公司详细论述制作网站的步骤
  • 南宁个人做网站的技校十大吃香专业
  • 纪检监察工作 网站建设建立个公司网站
  • vps服务器怎么做网站广元市利州区建设局网站
  • 国外优秀设计网站大全wordpress 微软
  • 郑州网站高端设计51推广平台
  • 鹿泉网站制作公司文章目录wordpress
  • 建设个人网站可以卖产品吗论坛备案网站名称
  • 菏泽兼职网站建设怎么做百度快照让网站排前面
  • 网站优化年报告三合一建站网站