Skip to content

Commit 4c5bfc5

Browse files
committed
2 parents 397e9ba + 8a620a7 commit 4c5bfc5

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

README.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,26 @@
22
This library will help you control you nextion-display over UART.
33
## How to use
44
First, define an object with the class `nextion(tx_pin, rx_pin, baudrate)`
5-
This could look like this now:
6-
`from nextion import nextion
7-
display = nextion(13, 12, 9600)`
5+
This could look like this now:<br>
6+
`from nextion import nextion<br>
7+
display = nextion(13, 12, 9600)`<br>
88
Now you can control the device with different commands.
9+
## Constants
10+
- `nextion.WRITE_ONLY`
11+
- `nextion.READ_AND_WRITE`
912
## Functions
1013
### cmd
11-
The code to send a
14+
You can send a command over serial to the device using `display.cmd(command`[ , flags=nextion.READ_AND_WRITE])`<br>
15+
- `command`: the command to send to the device
16+
- `flags`: You can insert `nextion.WRITE_ONLY`, when you don't want to read the reply from UART. By default, the function is waiting 100 ms and then, the function returns the reply.
17+
### sleep
18+
To enter or exit sleep mode of the nextion device, use the command `display.sleep(state)`<br>
19+
- `state`: Set the parameter to 1 for enter sleep mode. Set the parameter to 0 for exit sleep mode.
20+
### page
21+
To load a page on the nextion device, use the command `display.page(pageid)`<br>
22+
- `pageid`: ID of the page or name of the page.
23+
### reset
24+
You can reset the device using the command `display.reset()`
25+
### brightness
26+
To set the display brightness use the command `display.brightness(brightness)`<br>
27+
- `brightness`: Brightness to set in percent

0 commit comments

Comments
 (0)