#105 Vibrator Brick
Overview
振動モーターを使用したBrickです。
I/Oピンから振動モーターのON/OFFを制御することができます。
Connecting
Parts Specification
| Document |
|---|
| LA3R5-480AH1 |
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/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/button |
| ../nRF5_SDK/modules/nrfx/hal |
| ../nRF5_SDK/components/boards |
| ../nRF5_SDK/components/drivers_nrf/nrf_soc_nosd |
| ../nRF5_SDK/integration/nrfx |
| ../nRF5_SDK/modules/nrfx |
| ../nRF5_SDK/modules/nrfx/drivers/include |
| ../nRF5_SDK/components/toolchain/cmsis/include |
| ../nRF5_SDK/integration/nrfx/legacy |
| ../nRF5_SDK/modules/nrfx/mdk |
| ../nRF5_SDK/components/libraries/bsp |
| ../nRF5_SDK/components/libraries/util |
| . |
Preprocessor Definitions
Solution Option -> Preprocessor -> Preprocessor Definitionsに以下を追加する。
| COPT |
|---|
| NRFX_TIMER0_ENABLED |
| NRFX_TIMER_ENABLED |
| TIMER0_ENABLED |
| TIMER_ENABLED |
| NRF52832_XXAB |
| BOARD_CUSTOM |
SDK File
Projectに以下のファイルを追加する。(../nRF5_SDKの部分は適宜変えてください。)
| File | Path |
|---|---|
| app_error_handler_gcc.c | ../nRF5_SDK/components/libraries/util |
| app_error_weak.c | ../nRF5_SDK/components/libraries/util |
| app_error.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_format.c | ../nRF5_SDK/external/fprintf |
| nrf_fprintf.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_timer.c | ../nRF5_SDK/modules/nrfx/drivers/src |
| 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 | |
Sample Code
タイマーでバイブレーターを0.5秒ごとに作動、停止させます。 動作には、5Vの電源が必要となり、そのままでは動きません。代用として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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
構成Parts
- 振動モーター LA3R5-480AH1