Skip to main content

This is tea5767 driver for HaaS Python. HaaS Python is forked from micropython.

Project description

HaaS Python介绍

HaaS Python是阿里云IoT团队最新研发的一套低代码编程框架,兼容MicroPython编程规范,依托HaaS平台软硬件积木提供AI、支付、蓝牙配网、云连接、UI等物联网场景常用的能力,从而解决了物联网应用开发难的问题。有了Python轻应用框架,物联网编程不再局限于专业软件开发人员,一般的技术员也可以快速实现复杂的物联网需求。 更多HaaS Python介绍和开发资料见HaaS Python官网,创意案例, 硬件积木

HaaS Python is a set of low-code programming frameworks newly developed by Alibaba Cloud IoT team. It is compatible with MicroPython programming specifications. It relies on the hardware and software building blocks of the HaaS platform to provide capabilities commonly used in IoT scenarios such as AI, payment, Bluetooth network configuration, cloud connection, and UI. Solve the difficult problem of IoT application development. With the Python light application framework, IoT programming is no longer limited to professional software developers, and general technicians can quickly implement complex IoT requirements. For more HaaS Python introduction and development materials, see HaaS Python official website, Creative Case, Hardware Building Blocks

安装方法

Download the firmware corresponding to the development board at HaaS Python website and complete the firmware burning

  • 在开发板上运行以下命令完成安装和使用,如果您在使用过程中遇到问题,欢迎在github上向我们提交issue,我们的工程师会及时解答

Run the following commands on the development board to complete the installation and use. If you encounter problems during use, please submit an issue to us on github, Our engineers will answer in time

import upip
upip.install("haas-python-tea5767")
import haas-python-tea5767

FM收音机模块 - TEA5767

一、产品简介

TEA5767 FM收音机模块是工作频率在76MHz~108MHz的自动数字调谐收音机。其特点高灵敏度、高稳定、低噪声,内部集成了中频选频和解调网络。

引脚定义

  • GND:接地
  • SCL:I2C时钟
  • SDA:I2C数字
  • VCC:5V

二、技术参数

  • 供电电压:5V DC
  • 接口:I2C接口
  • 频率:76MHz-108MHz
  • 电路:AGC(高放自动增益控制)
  • 特性:支持SNC(立体声消噪)、锁相环调谐系统
  • 模块尺寸:30mm * 30mm

三、软件接口

TEA5767 FM收音机模块HaaS Python驱动:下载地址

TEA5767(i2cObj) - 创建TEA5767驱动对象

  • 函数原型:

tea5767Obj = TEA5767(i2cObj)

  • 参数说明:

|参数|类型|必选参数?|说明| |-----|----|:---:|----| |i2cObj|I2C|是|调用此函数前需确保i2cObj对象已经处于open状态|
  • 返回值:

TEA5767对象创建成功,返回TEA5767对象;TEA5767对象创建失败,抛出Exception
  • 示例代码:
from driver import I2C
import tea5767

i2cObj = I2C()
i2cObj.open("tea5767")
robot=tea5767.TEA5767(i2cObj)
print('tea5767 inited')
  • 输出:
tea5767 inited!

setFrequency(freq) - 设置FM工作频率

  • 函数功能:

设置FM收音机工作频率
  • 函数原型:

TEA5767.setFrequency(freq)

  • 参数说明:
返回值 类型 说明
freq float 76.0~108.0,单位(MHz)
  • 返回值: 无

  • 示例:

from driver import I2C
import tea5767

i2cObj = I2C()
i2cObj.open("tea5767")
robot=tea5767.TEA5767(i2cObj)
print('tea5767 inited')
robot.setFrequency(91.8)
print('set freq = 91.8Mhz')
  • 输出:
tea5767 inited
set freq = 91.8Mhz

四、接口案例


此使用实例在board.json中定义了名为tea5767的I2C类型的对象。在Python脚本中设置FM频率为91.8Mhz的频道并打印在日志中。
  • 代码: board.json配置
{
    "name": "board-name",
    "version": "1.0.0",
    "io": {
      "tea5767": {
        "type": "I2C",
        "port": 0,
        "addrWidth": 7,
        "freq": 400000,
        "mode": "master",
        "devAddr": 96
      }
    },
    "debugLevel": "ERROR",
    "repl": "disable"
}
  • 示例:
from driver import I2C
import tea5767

i2cObj = I2C()
i2cObj.open("tea5767")
robot=tea5767.TEA5767(i2cObj)
print('tea5767 inited')
robot.setFrequency(91.8)
print('set freq = 91.8Mhz')
  • 输出:
tea5767 inited
set freq = 91.8Mhz

参考文献及购买链接

[1] TEA5767收音机模块介绍说明
[2] TEA5767收音机模块购买

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haas-python-tea5767-0.0.6.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file haas-python-tea5767-0.0.6.tar.gz.

File metadata

  • Download URL: haas-python-tea5767-0.0.6.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.5

File hashes

Hashes for haas-python-tea5767-0.0.6.tar.gz
Algorithm Hash digest
SHA256 16d4a8eb8d57957949a8885a548b1298cef36b62105fb1898725052d91c7d8b4
MD5 c403ab2fa685dc6779d5ea7803d0914b
BLAKE2b-256 39427112ae43e20ad4cff92eeb62cafe688ec9464a79bac1c083723d3bd89c61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page