Now light it up, say ha, it’s been a long time, I don’t know which version of the library everybody is using.
http://www.openluat.com/Product/gprs/Air202.html I went to download the latest one officially.
I’ll use what’s in it.
Personally, I’m used to using this.
Look at the official demo.
Now just modify test. Lua
Now let’s look at pins. Lua to see what to do next. Anyway, I predict that controlling GPIO is to configure the direction first, and then set the high and low levels, because I am familiar with the MCU.
Almost all single-chip computers are in this mode.
Let’s go and look for it.
So I went to API.
Then set the output level.
Here we go.
So the program is
module(...,package.seeall) --[[ Function name: printFunction: Print interface, all prints in this file will be prefixed with testParameter: NoneReturn value: None]]Local function print (...)_G.print ("test",...) end pio.pin.setdir(pio.OUTPUT,pio.P0_5) pio.pin.setval(1,pio.P0_5)
Now download it.
Close now, download after modification
Do you know how to load files?
main.luaIt is necessary to load main.lua internally by default.
Then put the files you need to load in main. lua. Loading is done with require “file name”
Then when you do some functions by yourself, you add the Lib support files for whatever functions you use.
Assuming that I need to acquire signal quality, then I need net.
Link: https://pan.baidu.com/s/1-SRfsKGQ7rZVvFmp1ObHWw password: p9qs
If the link of the source code of the basic course is invalid, please download it in the introduction of Taobao. Because the link is still invalid, please contact the seller. Thank you.