-
Notifications
You must be signed in to change notification settings - Fork 73
Programming with Lua
yichone edited this page Dec 1, 2016
·
1 revision
node.restart()
file.open("yourFile.lua","w+") -- if the file is not exist, create one
file.write("Input your content here")
--file.writeline("Your content here") -- write a line
file.close()
file.open("yourFile.lua","r")
file.read() -- Use file.read(n) to read the first n characters of the file
--file.readline() -- read a line
file.close()
file.open("yourFile.lua","a")
file.write("Your content here")
file.close()
file.remove("yourFile.lua")
encodeString = cjson.encode({key1=value1, key2=value2})
print(encodeString) -- {'key1':'value1', 'key2':'value2'}
decodeResult = cjson.decode(encodeString)
The utils module contains some useful tools, such as base64, date tool, etc. More useful tools will be added to this module, then user can invoke them from this module.
str = "hello world";
encrypt = utils.base64_encode(str);
decrypt = utils.base64_decode(encrypt);
Test
The template module is a sample to show users how to create their own module. Invoke the start and stop method to test.
template.start()
template.stop()
Shenzhen Doctors of Intelligence & Technology Co. Ltd: wwww.doit.am, SZDOIT official online Shops: www.vvdoit.com, and www.smartarduino.com
- Preface
- Start to Play ESP8266
- ESP-F
- ESP-F1
- ESP-F2
- ESP-E
- ESP-01
- ESP-01s
- ESP-07
- ESP-12E
- ESP-12F
- ESP-S
- DT-W5G1
- DMP-L1
- DMP-P1
- ESP-M1
- ESP-M2
- ESP-M3
- ESP-M4
- ESP-1
- ESP32
- ESP32U
- ESP32-C2
- NRF24l01
- Preface
- NodeMCU
- miniNodeMCU
- WiFi Shield
- ESPduino
- 2-way&16-way motor&servo shield
- ESP32
- DT-06(TTLtoWiFi)
- ESPDuino-32
- 2/4ch DC motor & 16ch servo shield---motor and servo shield
- Preface
- Video
- Softwares
- Motors & Servos
- Assembling Chassis
- Wireless WiFi Tank Car
- Wireless WiFi Video Tank Car
- RC Robot
- Preface
- Humanoid
- Gripper/Claw
- Robot Arm
- 3dof Robot Arm
- Visual Programming blocks