Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
3886d2c7
Commit
3886d2c7
authored
Sep 02, 2018
by
Natalia
Committed by
Marcel Stör
Sep 02, 2018
Browse files
RC module documentation (#2473)
parent
94abbe70
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/rc.md
View file @
3886d2c7
...
@@ -2,3 +2,45 @@
...
@@ -2,3 +2,45 @@
| Since | Origin / Contributor | Maintainer | Source |
| Since | Origin / Contributor | Maintainer | Source |
| :----- | :-------------------- | :---------- | :------ |
| :----- | :-------------------- | :---------- | :------ |
| 2015-06-12 |
[
Mike Wen
](
https://github.com/mikewen
)
| - |
[
rc.c
](
../../../app/modules/rc.c
)
|
| 2015-06-12 |
[
Mike Wen
](
https://github.com/mikewen
)
| - |
[
rc.c
](
../../../app/modules/rc.c
)
|
Module to generate series of impulses for remote control via 433/315Mhz radio transmitter.
Superseded by
**[rfswitch](./rfswitch.md)**
module which have same functionality, and supports more transmission protocols.
For more detailed description see
[
rfswitch module documentation
](
./rfswitch.md
)
.
## rc.send()
Sends series of impulses
#### Syntax
`rc.send(pin, value, length, pulse_length, protocol_id, repeat)`
which is similar to:
`rfswitch.send(protocol_id, pulse_length, repeat, pin, value, length)`
#### Parameters
-
`pin`
0~12, I/O index of pin, example 6 is for GPIO12, see
[
details
](
../modules/gpio/
)
-
`value`
positive integer value, this is the primary data which will be sent
-
`length`
bit length of value, if value length is 3 bytes, then length is 24
-
`pulse_length`
length of one pulse in microseconds, usually from 100 to 650
-
`protocol_id`
positive integer value, from 1-3
-
`repeat`
repeat value, usually from 1 to 5. This is a synchronous task. Setting the repeat count to a large value will cause problems.
The recommended limit is about 1-4.
#### Returns
`1`
always 1
#### Example
```
lua
-- Lua transmit radio code using protocol #1
-- pulse_length 300 microseconds
-- repeat 5 times
-- use pin #7 (GPIO13)
-- value to send is 560777
-- value length is 24 bits (3 bytes)
rc
.
send
(
7
,
560777
,
24
,
300
,
1
,
5
)
```
which is similar to:
```
lua
rfswitch
.
send
(
1
,
300
,
5
,
7
,
560777
,
24
)
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment