Skip to content

Commit

Permalink
add basic setup instructions to docs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
brainelectronics committed Jun 12, 2023
1 parent c3dd870 commit 61890bf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pip install -r requirements.txt

## Setup

### Install package with upip
### Install package

Connect the MicroPython device to a network (if possible)

Expand Down
20 changes: 20 additions & 0 deletions docs/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ Usage examples of this `micropython-nextion` library
An example of all implemented functionalities can be found at the
[MicroPython Nextion examples folder][ref-micropython-nextion-examples]

## Setup Nextion

```python
from nextion import NexHardware

# define communication pins for Nextion display
tx_pin = 21
rx_pin = 22

# create Nextion hardware interface
nh = NexHardware(rx_pin=rx_pin, tx_pin=tx_pin)

# init nextion communication interface
nh.nexInit()

# modify text field "t0" showing "newtxt" by default
cmd = 't0.txt="asdf"'
nh.sendCommand(cmd)
```

## Special hints

### Access object on a non active page
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# -*- coding: UTF-8 -*-

from setuptools import setup
import pathlib
from pathlib import Path
import sdist_upip

here = pathlib.Path(__file__).parent.resolve()
here = Path(__file__).parent.resolve()

# Get the long description from the README file
long_description = (here / 'README.md').read_text(encoding='utf-8')
Expand Down

0 comments on commit 61890bf

Please sign in to comment.