#107 LimitSwitch Brick
Overview
リミットスイッチを使ったBrickです。
I/OピンよりスイッチのON/OFFの状態を取得することができます。
機械の自動停止や位置検出の際に使用します。
Connecting
Arduino
Support
Schematic
User Include Directories
Solution Option -> Preprocessor -> User Include Directoriesに以下を追加する。(../nRF5_SDKの部分は適宜変えてください。)
Path |
---|
../nRF5_SDK/modules/nrfx/drivers/src/prs |
../nRF5_SDK/modules/nrfx/drivers/src |
../nRF5_SDK/components/libraries/atomic |
../nRF5_SDK/components/libraries/ringbuf |
../nRF5_SDK/modules/nrfx/drivers/include |
../nRF5_SDK/integration/nrfx/legacy |
../nRF5_SDK/external/fprintf |
../nRF5_SDK/components/libraries/balloc |
../nRF5_SDK/components/libraries/memobj |
../nRF5_SDK/components/libraries/log/src |
../nRF5_SDK/components/libraries/strerror |
../nRF5_SDK/components/libraries/experimental_section_vars |
../nRF5_SDK/components/libraries/log |
../nRF5_SDK/components/libraries/delay |
../nRF5_SDK/components/libraries/button |
../nRF5_SDK/components/drivers_nrf/nrf_soc_nosd |
../nRF5_SDK/components/libraries/util |
../nRF5_SDK/integration/nrfx |
../nRF5_SDK/modules/nrfx |
../nRF5_SDK/modules/nrfx/hal |
../nRF5_SDK/components/boards |
../nRF5_SDK/components/libraries/bsp |
../nRF5_SDK/components/toolchain/cmsis/include |
../nRF5_SDK/modules/nrfx/mdk |
. |
Preprocessor Definitions
Solution Option -> Preprocessor -> Preprocessor Definitionsに以下を追加する。
COPT |
---|
NRF52832_XXAB |
BOARD_CUSTOM |
SDK File
Projectに以下のファイルを追加する。(../nRF5_SDKの部分は適宜変えてください。)
File | Path |
---|---|
app_error.c | ../nRF5_SDK/components/libraries/util |
app_error_handler_gcc.c | ../nRF5_SDK/components/libraries/util |
app_error_weak.c | ../nRF5_SDK/components/libraries/util |
app_util_platform.c | ../nRF5_SDK/components/libraries/util |
nrf_atomic.c | ../nRF5_SDK/components/libraries/atomic |
nrf_balloc.c | ../nRF5_SDK/components/libraries/balloc |
nrf_drv_uart.c | ../nRF5_SDK/integration/nrfx/legacy |
nrf_fprintf.c | ../nRF5_SDK/external/fprintf |
nrf_fprintf_format.c | ../nRF5_SDK/external/fprintf |
nrf_log_backend_serial.c | ../nRF5_SDK/components/libraries/log/src |
nrf_log_backend_uart.c | ../nRF5_SDK/components/libraries/log/src |
nrf_log_default_backends.c | ../nRF5_SDK/components/libraries/log/src |
nrf_log_frontend.c | ../nRF5_SDK/components/libraries/log/src |
nrf_log_str_formatter.c | ../nRF5_SDK/components/libraries/log/src |
nrf_memobj.c | ../nRF5_SDK/components/libraries/memobj |
nrf_ringbuf.c | ../nRF5_SDK/components/libraries/ringbuf |
nrf_strerror.c | ../nRF5_SDK/components/libraries/strerror |
nrfx_prs.c | ../nRF5_SDK/modules/nrfx/drivers/src/prs |
nrfx_uart.c | ../nRF5_SDK/modules/nrfx/drivers/src |
nrfx_uarte.c | ../nRF5_SDK/modules/nrfx/drivers/src |
Section
SEGGER_Flash.icfファイルを編集する。(SEGGER_Flash.icfはProject配下に自動生成されている。以下抜粋)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
IRQHandler
Cortex_M_Startup.sファイルを編集する。(長いので抜粋)
1 2 3 4 5 6 7 8 9 10 11 |
|
Sample Code
A1コネクタにLimitSwitch Brickを接続し、A0コネクタに接続したLED Brickの点灯/消灯を制御しています。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
構成Parts
- リミットスイッチ