Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sasilva1998 committed Apr 7, 2020
1 parent 3371441 commit 95cedf4
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ This is a little similar implementation of `genpy` for uPy. In order to use ross
- [ ] Services

## Installation

### Copying source files
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.

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.

You can also install `ugenpy` with but have in mind the `.msg` files must be copied, located in the corresponding dir:
### Using upip
You can also install `ugenpy` with upip but have in mind the `.msg` files must be copied, located in the corresponding dir:
``` python
import upip
import network
from time import sleep
wlan=network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('<ssid>', '<password>')
sleep(5)
upip.install('micropython-genpy')
```
>Note: To use upip you must be connected to WiFi and the files with std_msgs dir must be included manually.
Expand All @@ -36,3 +45,14 @@ import os
os.listdir('std_msgs')
```

## Classes
### `ugenpy.message.MessageGenerator`
#### Constructor
##### `ugenpy.message.MessageGenerator(addr)`
Class responsible of writing the `*.py` script and message class from `*.msg`.
* `addr`: address where the `.msg` file is located inside the microcontroller.

#### Methods
##### `ugenpy.message.MessageGenerator.create_message()`
Creates the message from the address already defined in constructor.

0 comments on commit 95cedf4

Please sign in to comment.