Example program for EVAL-TempSense-ARDZ boards.
Dependencies: platform_drivers
main.cpp@0:782471fb58f7, 2019-08-27 (annotated)
- Committer:
- malavikasaji
- Date:
- Tue Aug 27 21:06:07 2019 +0000
- Revision:
- 0:782471fb58f7
- Child:
- 1:af9efbb9e9c5
Repository Created.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
malavikasaji | 0:782471fb58f7 | 1 | /* Copyright (c) 2019 Analog Devices, Inc. All rights reserved. |
malavikasaji | 0:782471fb58f7 | 2 | |
malavikasaji | 0:782471fb58f7 | 3 | Redistribution and use in source and binary forms, with or without modification, |
malavikasaji | 0:782471fb58f7 | 4 | are permitted provided that the following conditions are met: |
malavikasaji | 0:782471fb58f7 | 5 | - Redistributions of source code must retain the above copyright notice, |
malavikasaji | 0:782471fb58f7 | 6 | this list of conditions and the following disclaimer. |
malavikasaji | 0:782471fb58f7 | 7 | - Redistributions in binary form must reproduce the above copyright notice, |
malavikasaji | 0:782471fb58f7 | 8 | this list of conditions and the following disclaimer in the documentation |
malavikasaji | 0:782471fb58f7 | 9 | and/or other materials provided with the distribution. |
malavikasaji | 0:782471fb58f7 | 10 | - Modified versions of the software must be conspicuously marked as such. |
malavikasaji | 0:782471fb58f7 | 11 | - This software is licensed solely and exclusively for use with processors/products |
malavikasaji | 0:782471fb58f7 | 12 | manufactured by or for Analog Devices, Inc. |
malavikasaji | 0:782471fb58f7 | 13 | - This software may not be combined or merged with other code in any manner |
malavikasaji | 0:782471fb58f7 | 14 | that would cause the software to become subject to terms and conditions which |
malavikasaji | 0:782471fb58f7 | 15 | differ from those listed here. |
malavikasaji | 0:782471fb58f7 | 16 | - Neither the name of Analog Devices, Inc. nor the names of its contributors |
malavikasaji | 0:782471fb58f7 | 17 | may be used to endorse or promote products derived from this software without |
malavikasaji | 0:782471fb58f7 | 18 | specific prior written permission. |
malavikasaji | 0:782471fb58f7 | 19 | - The use of this software may or may not infringe the patent rights of one or |
malavikasaji | 0:782471fb58f7 | 20 | more patent holders. This license does not release you from the requirement |
malavikasaji | 0:782471fb58f7 | 21 | that you obtain separate licenses from these patent holders to use this software. |
malavikasaji | 0:782471fb58f7 | 22 | |
malavikasaji | 0:782471fb58f7 | 23 | THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND |
malavikasaji | 0:782471fb58f7 | 24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, |
malavikasaji | 0:782471fb58f7 | 25 | TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
malavikasaji | 0:782471fb58f7 | 26 | NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
malavikasaji | 0:782471fb58f7 | 27 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES |
malavikasaji | 0:782471fb58f7 | 28 | (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL |
malavikasaji | 0:782471fb58f7 | 29 | PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
malavikasaji | 0:782471fb58f7 | 30 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
malavikasaji | 0:782471fb58f7 | 31 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
malavikasaji | 0:782471fb58f7 | 32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
malavikasaji | 0:782471fb58f7 | 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
malavikasaji | 0:782471fb58f7 | 34 | |
malavikasaji | 0:782471fb58f7 | 35 | 2019-01-10-7CBSD SLA |
malavikasaji | 0:782471fb58f7 | 36 | |
malavikasaji | 0:782471fb58f7 | 37 | */ |
malavikasaji | 0:782471fb58f7 | 38 | |
malavikasaji | 0:782471fb58f7 | 39 | #include "mbed.h" |
malavikasaji | 0:782471fb58f7 | 40 | |
malavikasaji | 0:782471fb58f7 | 41 | Serial pc(USBTX, USBRX); // tx, rx |
malavikasaji | 0:782471fb58f7 | 42 | DigitalOut awakeSignal(LED4); |
malavikasaji | 0:782471fb58f7 | 43 | DigitalOut led1(LED1); |
malavikasaji | 0:782471fb58f7 | 44 | |
malavikasaji | 0:782471fb58f7 | 45 | #define SLEEP_TIME 500 // (msec) |
malavikasaji | 0:782471fb58f7 | 46 | |
malavikasaji | 0:782471fb58f7 | 47 | // main() runs in its own thread in the OS |
malavikasaji | 0:782471fb58f7 | 48 | int main() |
malavikasaji | 0:782471fb58f7 | 49 | { |
malavikasaji | 0:782471fb58f7 | 50 | awakeSignal = 1; |
malavikasaji | 0:782471fb58f7 | 51 | pc.printf("Hello World!"); |
malavikasaji | 0:782471fb58f7 | 52 | while (true) { |
malavikasaji | 0:782471fb58f7 | 53 | // Blink LED and wait 0.5 seconds |
malavikasaji | 0:782471fb58f7 | 54 | led1 = !led1; |
malavikasaji | 0:782471fb58f7 | 55 | wait_ms(SLEEP_TIME); |
malavikasaji | 0:782471fb58f7 | 56 | } |
malavikasaji | 0:782471fb58f7 | 57 | } |
malavikasaji | 0:782471fb58f7 | 58 |