Created Basics (markdown)

master
Jan Gromeš 2019-03-12 20:55:18 +01:00
rodzic fcdce99047
commit 4c5451676f
1 zmienionych plików z 16 dodań i 0 usunięć

16
Basics.md 100644

@ -0,0 +1,16 @@
The purpose if this page is to show the basic usage of the library API.
## Using [**RadioShield**](https://github.com/jgromes/RadioShield)
1. Plug the wireless module into either of the two slots and select the required communication channels/GPIO pins using jumper pins.
2. In Arduino code, select the slot the module is plugged into. For example, assuming SX1278 module plugged into slot A:
`SX1278 lora = RadioShield.ModuleA;`
3. After the object is created, the module has to be initialized using the `begin()` method. Typically, this is done in Arduino `setup()` function. If you want to change the module settings, this can be done by providing appropriate values to the `begin()` method.
4. At this point, your module is ready to send or receive any data you want!
## Standalone Module
1. Connect the wireless module to the Arduino. This includes connecting the appropriate communication channel (SPI bus or UART) and up to 2 GPIO pins. Any two digital pins can be used for UART and GPIO (unless the GPIO pins are used as external interrupts).
2. Provide the pin setup to the library. This is done using the `Module` constructor in the following format:
**SPI** modules: `Module(cs, int0, int1)`. For example: `SX1278 lora = new Module(10, 2, 3);`
**UART** modules: `Module(tx, rx)`. For example: `ESP8266 wifi = new Module(10, 9);`
3. After the object is created, the module has to be initialized using the `begin()` method. Typically, this is done in Arduino `setup()` function. If you want to change the module settings, this can be done by providing appropriate values to the `begin()` method.
4. At this point, your module is ready to send or receive any data you want!