Skip to content

Commit 95cedf4

Browse files
committed
docs updated
1 parent 3371441 commit 95cedf4

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ This is a little similar implementation of `genpy` for uPy. In order to use ross
99
- [ ] Services
1010

1111
## Installation
12+
13+
### Copying source files
1214
In order to use this package the folder `ugenpy` from `src` must be copied to the flash memory. I strongly recommend using [rshell](https://github.com/dhylands/rshell) for this task.
1315

1416
There is also a folder called `std_msgs` which has all default `*.msg` files, this folder can also be copied or any other folder with the wanted message types. For memory purposes not all the `msg` files in that folder must be copied, only the ones that are going to be used.
1517

16-
You can also install `ugenpy` with but have in mind the `.msg` files must be copied, located in the corresponding dir:
18+
### Using upip
19+
You can also install `ugenpy` with upip but have in mind the `.msg` files must be copied, located in the corresponding dir:
1720
``` python
1821
import upip
22+
import network
23+
from time import sleep
24+
wlan=network.WLAN(network.STA_IF)
25+
wlan.active(True)
26+
wlan.connect('<ssid>', '<password>')
27+
sleep(5)
1928
upip.install('micropython-genpy')
2029
```
2130
>Note: To use upip you must be connected to WiFi and the files with std_msgs dir must be included manually.
@@ -36,3 +45,14 @@ import os
3645
os.listdir('std_msgs')
3746
```
3847

48+
## Classes
49+
### `ugenpy.message.MessageGenerator`
50+
#### Constructor
51+
##### `ugenpy.message.MessageGenerator(addr)`
52+
Class responsible of writing the `*.py` script and message class from `*.msg`.
53+
* `addr`: address where the `.msg` file is located inside the microcontroller.
54+
55+
#### Methods
56+
##### `ugenpy.message.MessageGenerator.create_message()`
57+
Creates the message from the address already defined in constructor.
58+

0 commit comments

Comments
 (0)