Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Matze-Jung committed Sep 17, 2019
1 parent 2e6ce95 commit b8b09ba
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
55 changes: 39 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@ Example screens on X7 display with single/multiple graphs ...

> \**part of the [opentx-lua-widgets](https://github.com/Matze-Jung/opentx-lua-widgets) package*
## Test environment
* OpenTX v2.2.4 on Taranis Q X7, Betaflight 4.0.5 on OmnibusF4 w/ R-XSR
* Companion Sim v2.2.4 (*FrSky platforms only*)

## Download
Please go to the [releases page](https://github.com/Matze-Jung/opentx-lua-running-graphs/releases) to download the latest files.

## Test environment
* [OpenTX v2.2.4](https://github.com/opentx/opentx) on Taranis Q X7, [Betaflight 4.0.5](https://github.com/betaflight/betaflight) on OmnibusF4 w/ R-XSR
* [Companion Sim v2.2.4](https://www.open-tx.org/) (*FrSky platforms only*)

## File structure
`GRAPHS/`
- `graphs.lua` main script
- `trigger.lua` user inputs
- `GRAPHS/`
* `graphs.lua` main script
* `trigger.lua` user inputs


`MIXES/`
- `graphs.lua` model script
- `MIXES/`
* `graphs.lua` model script

`TELEMETRY/` telemetry screen examples

`WIDGETS/`
- `graph.lua` widget for the [opentx-lua-widgets](https://github.com/Matze-Jung/opentx-lua-widgets) grid system
- `TELEMETRY/` telemetry screen examples


- `WIDGETS/`
* `graph.lua` widget for the [opentx-lua-widgets](https://github.com/Matze-Jung/opentx-lua-widgets) grid system

## API
#### Functions
Expand All @@ -49,15 +52,30 @@ Init and display the graph.
| opts.**style** | number *(optional, default `SOLID` - `DOTTED` at 'min' and 'max' values)* | `SOLID` for a full solid line, `DOTTED` for a dotted line |
| opts.**crit** | number *(optional)* | If set, the line style is `DOTTED` below and `SOLID` above this value. The Y-axis gets a mark at the values position |

---
##

`getGraphRange(id)`

Get minimum and maximum stored values of a graph, specified by `id`.

| Option | Type | Description |
| - | - | - |
| **id** | number | ID of the graph |

Returns table `{ min:number, max:number }`

##

`getGraphAverage(id)`

Returns average value of graph, specified by `id`.
Get average value of a graph, specified by `id`.

| Option | Type | Description |
| - | - | - |
| **id** | number | ID of the graph |

Returns number

#### Trigger
Set input condition for the pause toggle. Relates to all graphs global.

Expand All @@ -72,12 +90,12 @@ return {
},
}
```
Switch [SA] value greater than 100 toggles pause event. To disable trigger, return `false`.
Switch [SA] value greater than 100 toggles pause event. To disable trigger, return `false` (default).

## Installing
Unzip the files from the release package and drag the contents to your radio. If you do this correctly, the `SCRIPTS` directory will merge with your existing directories, placing the scripts in their appropriate paths.

The `src` directory is not required for use and is only available for maintenance of the code. While it may work to use this directory, you may encounter memory issues on your transmitter.
The `src` directory is not required for use and is only available for maintenance of the code. While it may work to use this directory, you may encounter some issues.

How to copy to the Transmitter:

Expand Down Expand Up @@ -127,3 +145,8 @@ If you just copied the files, launched the script and a `not enough memory` warn
- Run `npm install` from the root folder to install node modules
- Run `npm start`, `make` or `./bin/build.sh min` from the root folder with appropriate privileges (omit the `min` switch to build without minifying)
- Compiled/minified files will be created at the `obj` folder. Copy the files to your transmitter.

## Resources
* [Manual for OpenTX 2.2](https://opentx.gitbooks.io/manual-for-opentx-2-2)
* [OpenTX 2.2 Lua Reference Guide](https://opentx.gitbooks.io/opentx-2-2-lua-reference-guide/)
* [OpenTX Taranis Manual](https://opentx.gitbooks.io/opentx-taranis-manual)
Binary file removed img/wdgts2.lua.gif
Binary file not shown.
2 changes: 1 addition & 1 deletion src/SCRIPTS/TELEMETRY/graphs.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- DEPRECATED, use widgets instead
-- To layout telemetry screens try opentx-lua-widgets [https://github.com/Matze-Jung/opentx-lua-widgets]local function run(event)

local function run(event)
lcd.clear()
Expand Down

0 comments on commit b8b09ba

Please sign in to comment.