From 54255a82897e5c8abed868c3b064c7e6ee3a3c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A3=9E=E9=B9=A4?= Date: Sun, 4 Apr 2021 00:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=8C=20=E5=B9=B6=E5=A2=9E=E5=8A=A0cs=20?= =?UTF-8?q?=E6=8E=A5=E7=BA=BF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/air302/demo/spi/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bsp/air302/demo/spi/main.lua b/bsp/air302/demo/spi/main.lua index e2adfaf53..89d0cd6a1 100644 --- a/bsp/air302/demo/spi/main.lua +++ b/bsp/air302/demo/spi/main.lua @@ -1,12 +1,13 @@ -- LuaTools需要PROJECT和VERSION这两个信息 PROJECT = "air302_spi_demo" -VERSION = "1.0.0" +VERSION = "1.0.1" local sys = require "sys" local spiId = 0 local cs = 16 +-- 这里注意了!! 设备CS连接到 GPIO17, 不要接 cs脚。 local cspin = gpio.setup(17, 1) --收发数据 @@ -45,8 +46,8 @@ sys.taskInit(function() log.info("spi", "chip id read ok 0xef,0x40,0x16") else log.info("spi", "chip id read error") - for i=1,#recv do - print(recv:byte(i)) + for i=1,#chip do + print(chip:byte(i)) end return end -- Gitee