Motion detection using PIR sensor would observe the motions detected near the field of sensor and alerts you with a message whenever there is a detection

Dependencies:   ESP8266

Committer:
spriyanka
Date:
Wed Dec 13 20:30:20 2017 +0000
Revision:
0:0a3ec84d1493
Detection

Who changed what in which revision?

UserRevisionLine numberNew contents of line
spriyanka 0:0a3ec84d1493 1 # Getting started with Blinky on mbed OS
spriyanka 0:0a3ec84d1493 2
spriyanka 0:0a3ec84d1493 3 This guide reviews the steps required to get Blinky working on an mbed OS platform.
spriyanka 0:0a3ec84d1493 4
spriyanka 0:0a3ec84d1493 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
spriyanka 0:0a3ec84d1493 6
spriyanka 0:0a3ec84d1493 7 ## Import the example application
spriyanka 0:0a3ec84d1493 8
spriyanka 0:0a3ec84d1493 9 From the command-line, import the example:
spriyanka 0:0a3ec84d1493 10
spriyanka 0:0a3ec84d1493 11 ```
spriyanka 0:0a3ec84d1493 12 mbed import mbed-os-example-blinky
spriyanka 0:0a3ec84d1493 13 cd mbed-os-example-blinky
spriyanka 0:0a3ec84d1493 14 ```
spriyanka 0:0a3ec84d1493 15
spriyanka 0:0a3ec84d1493 16 ### Now compile
spriyanka 0:0a3ec84d1493 17
spriyanka 0:0a3ec84d1493 18 Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
spriyanka 0:0a3ec84d1493 19
spriyanka 0:0a3ec84d1493 20 ```
spriyanka 0:0a3ec84d1493 21 mbed compile -m K64F -t ARM
spriyanka 0:0a3ec84d1493 22 ```
spriyanka 0:0a3ec84d1493 23
spriyanka 0:0a3ec84d1493 24 Your PC may take a few minutes to compile your code. At the end, you see the following result:
spriyanka 0:0a3ec84d1493 25
spriyanka 0:0a3ec84d1493 26 ```
spriyanka 0:0a3ec84d1493 27 [snip]
spriyanka 0:0a3ec84d1493 28 +----------------------------+-------+-------+------+
spriyanka 0:0a3ec84d1493 29 | Module | .text | .data | .bss |
spriyanka 0:0a3ec84d1493 30 +----------------------------+-------+-------+------+
spriyanka 0:0a3ec84d1493 31 | Misc | 13939 | 24 | 1372 |
spriyanka 0:0a3ec84d1493 32 | core/hal | 16993 | 96 | 296 |
spriyanka 0:0a3ec84d1493 33 | core/rtos | 7384 | 92 | 4204 |
spriyanka 0:0a3ec84d1493 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
spriyanka 0:0a3ec84d1493 35 | frameworks/greentea-client | 1830 | 60 | 44 |
spriyanka 0:0a3ec84d1493 36 | frameworks/utest | 2392 | 512 | 292 |
spriyanka 0:0a3ec84d1493 37 | Subtotals | 42618 | 784 | 6384 |
spriyanka 0:0a3ec84d1493 38 +----------------------------+-------+-------+------+
spriyanka 0:0a3ec84d1493 39 Allocated Heap: unknown
spriyanka 0:0a3ec84d1493 40 Allocated Stack: unknown
spriyanka 0:0a3ec84d1493 41 Total Static RAM memory (data + bss): 7168 bytes
spriyanka 0:0a3ec84d1493 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
spriyanka 0:0a3ec84d1493 43 Total Flash memory (text + data + misc): 43402 bytes
spriyanka 0:0a3ec84d1493 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
spriyanka 0:0a3ec84d1493 45 ```
spriyanka 0:0a3ec84d1493 46
spriyanka 0:0a3ec84d1493 47 ### Program your board
spriyanka 0:0a3ec84d1493 48
spriyanka 0:0a3ec84d1493 49 1. Connect your mbed device to the computer over USB.
spriyanka 0:0a3ec84d1493 50 1. Copy the binary file to the mbed device.
spriyanka 0:0a3ec84d1493 51 1. Press the reset button to start the program.
spriyanka 0:0a3ec84d1493 52
spriyanka 0:0a3ec84d1493 53 The LED on your platform turns on and off.
spriyanka 0:0a3ec84d1493 54
spriyanka 0:0a3ec84d1493 55 ## Export the project to Keil MDK, and debug your application
spriyanka 0:0a3ec84d1493 56
spriyanka 0:0a3ec84d1493 57 From the command-line, run the following command:
spriyanka 0:0a3ec84d1493 58
spriyanka 0:0a3ec84d1493 59 ```
spriyanka 0:0a3ec84d1493 60 mbed export -m K64F -i uvision
spriyanka 0:0a3ec84d1493 61 ```
spriyanka 0:0a3ec84d1493 62
spriyanka 0:0a3ec84d1493 63 To debug the application:
spriyanka 0:0a3ec84d1493 64
spriyanka 0:0a3ec84d1493 65 1. Start uVision.
spriyanka 0:0a3ec84d1493 66 1. Import the uVision project generated earlier.
spriyanka 0:0a3ec84d1493 67 1. Compile your application, and generate an `.axf` file.
spriyanka 0:0a3ec84d1493 68 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
spriyanka 0:0a3ec84d1493 69 1. Set breakpoints, and start a debug session.
spriyanka 0:0a3ec84d1493 70
spriyanka 0:0a3ec84d1493 71 ![Image of uVision](img/uvision.png)
spriyanka 0:0a3ec84d1493 72
spriyanka 0:0a3ec84d1493 73 ## Troubleshooting
spriyanka 0:0a3ec84d1493 74
spriyanka 0:0a3ec84d1493 75 1. Make sure `mbed-cli` is working correctly and its version is `>1.0.0`
spriyanka 0:0a3ec84d1493 76
spriyanka 0:0a3ec84d1493 77 ```
spriyanka 0:0a3ec84d1493 78 mbed --version
spriyanka 0:0a3ec84d1493 79 ```
spriyanka 0:0a3ec84d1493 80
spriyanka 0:0a3ec84d1493 81 If not, you can update it:
spriyanka 0:0a3ec84d1493 82
spriyanka 0:0a3ec84d1493 83 ```
spriyanka 0:0a3ec84d1493 84 pip install mbed-cli --upgrade
spriyanka 0:0a3ec84d1493 85 ```
spriyanka 0:0a3ec84d1493 86
spriyanka 0:0a3ec84d1493 87 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32 KB restriction on code size.