Documentation Center
Figure 6: RAK13003 as Output to LEDs
1. First, you need to select the RAK4631 WisBlock Core.
Figure 7: Selecting RAK4631 as WisBlock Core
2. Next, copy the following sample code into your Arduino IDE.
Страница 1: ...o IDE To add the RAKwireless Core boards on your Arduino Boards Manager install the RAKwireless Arduino BSP Product Configuration Hardware Setup The RAK13003 is an IO expansion module that can be mounted to the IO slot of the WisBlock Baseboard It offers 16 bidirectional I O ports by using MCP23017 IC from Microchip The configuration of this module is via the I2C interface and it supports both sta...
Страница 2: ... Also always secure the connection of the WisBlock module by using the compatible screws Figure 2 RAK13003 mounting connection to WisBlock Base module Disassembling Procedure The procedure in disassembling any type of WisBlock modules is the same 1 First remove the screws Figure 3 Removing screws from the WisBlock module 2 Once the screws are removed check the silkscreen of the module to find the ...
Страница 3: ... tool for possible conflicts Software Configuration and Example In the following example you will be using the RAK13003 WisBlock IO Expansion Module to power LEDs These are the quick links that go directly to the software guide for the specific WisBlock Core module you use RAK13003 in RAK4631 WisBlock Core Guide RAK13003 in RAK11200 WisBlock Core Guide RAK13003 in RAK11300 WisBlock Core Guide RAK1...
Страница 4: ...ntation Center Figure 6 RAK13003 as Output to LEDs 1 First you need to select the RAK4631 WisBlock Core Figure 7 Selecting RAK4631 as WisBlock Core 2 Next copy the following sample code into your Arduino IDE ...
Страница 5: ... setup pinMode WB_IO2 OUTPUT digitalWrite WB_IO2 1 Reset device pinMode WB_IO4 OUTPUT digitalWrite WB_IO4 1 delay 10 digitalWrite WB_IO4 0 delay 10 digitalWrite WB_IO4 1 delay 10 Initialize Serial for debug output time_t timeout millis Serial begin 115200 while Serial if millis timeout 5000 delay 100 else break Serial println MCP23017 GPIO Input Output Test mcp begin use default address 0 ifdef PA...
Страница 6: ... i 0 i 8 i if mcp digitalRead i 1 Serial printf GPIO A d Read High r n i else Serial printf GPIO A d Read Low r n i endif ifdef PAOUT_PBIN for int i 0 i 8 i mcp pinMode i OUTPUT PA output for int j 8 j 16 j mcp pinMode j INPUT PB input mcp digitalWrite 0 LOW The output state of the PA port can be changed to high or low leve mcp digitalWrite 1 HIGH mcp digitalWrite 2 LOW mcp digitalWrite 3 HIGH mcp...
Страница 7: ... Center Figure 8 Installing the Library 4 Choose Version 1 3 0 of the library as shown in Figure 9 Figure 9 Selecting Version 1 3 0 5 Select the correct port and upload your code as shown in Figure 10 and Figure 11 ...
Страница 8: ...he correct Serial Port Figure 11 Uploading code 6 When you have successfully uploaded the example sketch you can see that the LEDs are powered ON You can also switch PB as INPUT and PA as OUTPUT by changing this line of code shown in Figure 12 ...
Страница 9: ...igitalRead pin_no to send or read states RAK13003 in RAK11200 WisBlock Core Guide Arduino Setup Shown in Figure 13 is the illustration on how to use the RAK13003 IO Expansion Module to power ON LEDs using digitalWrite function Figure 13 RAK13003 as Output to LEDs 1 First you need to select the RAK11200 WisBlock Core ...
Страница 10: ...Documentation Center Figure 14 Selecting RAK11200 as WisBlock Core 2 Next copy the following sample code into your Arduino IDE ...
Страница 11: ... setup pinMode WB_IO2 OUTPUT digitalWrite WB_IO2 1 Reset device pinMode WB_IO4 OUTPUT digitalWrite WB_IO4 1 delay 10 digitalWrite WB_IO4 0 delay 10 digitalWrite WB_IO4 1 delay 10 Initialize Serial for debug output time_t timeout millis Serial begin 115200 while Serial if millis timeout 5000 delay 100 else break Serial println MCP23017 GPIO Input Output Test mcp begin use default address 0 ifdef PA...
Страница 12: ...t i 0 i 8 i if mcp digitalRead i 1 Serial printf GPIO A d Read High r n i else Serial printf GPIO A d Read Low r n i endif ifdef PAOUT_PBIN for int i 0 i 8 i mcp pinMode i OUTPUT PA output for int j 8 j 16 j mcp pinMode j INPUT PB input mcp digitalWrite 0 LOW The output state of the PA port can be changed to high or low leve mcp digitalWrite 1 HIGH mcp digitalWrite 2 LOW mcp digitalWrite 3 HIGH mc...
Страница 13: ...Center Figure 15 Installing the Library 4 Choose Version 1 3 0 of the library as shown in Figure 16 Figure 16 Selecting Version 1 3 0 5 Select the correct port and upload your code as shown in Figure 17 and Figure 18 ...
Страница 14: ...roperly before uploading If not done properly uploading the source code to RAK11200 will fail Check the full details on the RAK11200 Quick Start Guide 6 When you have successfully uploaded the example sketch you can see that the LEDs are powered ON You can also switch PB as INPUT and PA as OUTPUT by changing this line of code shown in Figure 19 ...
Страница 15: ...n_no state and mcp digitalRead pin_no to send or read states RAK13003 in RAK11300 WisBlock Core Guide Arduino Setup 1 First you need to select the RAK11300 WisBlock Core as shown in Figure 20 Figure 20 Selecting RAK11300 as WisBlock Core 2 Next copy the following sample code into your Arduino IDE ...
Страница 16: ... setup pinMode WB_IO2 OUTPUT digitalWrite WB_IO2 1 Reset device pinMode WB_IO4 OUTPUT digitalWrite WB_IO4 1 delay 10 digitalWrite WB_IO4 0 delay 10 digitalWrite WB_IO4 1 delay 10 Initialize Serial for debug output time_t timeout millis Serial begin 115200 while Serial if millis timeout 5000 delay 100 else break Serial println MCP23017 GPIO Input Output Test mcp begin use default address 0 ifdef PA...
Страница 17: ...t i 0 i 8 i if mcp digitalRead i 1 Serial printf GPIO A d Read High r n i else Serial printf GPIO A d Read Low r n i endif ifdef PAOUT_PBIN for int i 0 i 8 i mcp pinMode i OUTPUT PA output for int j 8 j 16 j mcp pinMode j INPUT PB input mcp digitalWrite 0 LOW The output state of the PA port can be changed to high or low leve mcp digitalWrite 1 HIGH mcp digitalWrite 2 LOW mcp digitalWrite 3 HIGH mc...
Страница 18: ...Center Figure 21 Installing the Library 4 Choose Version 1 3 0 of the library as shown in Figure 22 Figure 22 Selecting Version 1 3 0 5 Select the correct port and upload your code as shown in Figure 23 and Figure 24 ...
Страница 19: ...he correct Serial Port Figure 24 Uploading code 6 When you have successfully uploaded the example sketch you can see that the LEDs are powered ON You can also switch PB as INPUT and PA as OUTPUT by changing this line of code shown in Figure 25 ...
Страница 20: ...Documentation Center Figure 25 Switching between PA and PB NOTE You can use mcp digitalWrite pin_no state and mcp digitalRead pin_no to send or read states Last Updated 11 4 2021 5 44 19 AM ...