![](/media/cache/profiles/01e5405ccd7d3efa1fd033aa7b7489e9.jpg.50x50_q85.jpg)
Simple demo for MultipinRGB lib.
Dependencies: MultipinRGB max32630fthr
main.cpp@1:e10e0ccddca1, 2017-03-28 (annotated)
- Committer:
- j3
- Date:
- Tue Mar 28 23:36:03 2017 +0000
- Revision:
- 1:e10e0ccddca1
- Parent:
- 0:8a5a157f2603
- Child:
- 2:6a33adb8bf65
updated lib
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
j3 | 0:8a5a157f2603 | 1 | /******************************************************************************* |
j3 | 0:8a5a157f2603 | 2 | * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved. |
j3 | 0:8a5a157f2603 | 3 | * |
j3 | 0:8a5a157f2603 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
j3 | 0:8a5a157f2603 | 5 | * copy of this software and associated documentation files (the "Software"), |
j3 | 0:8a5a157f2603 | 6 | * to deal in the Software without restriction, including without limitation |
j3 | 0:8a5a157f2603 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
j3 | 0:8a5a157f2603 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
j3 | 0:8a5a157f2603 | 9 | * Software is furnished to do so, subject to the following conditions: |
j3 | 0:8a5a157f2603 | 10 | * |
j3 | 0:8a5a157f2603 | 11 | * The above copyright notice and this permission notice shall be included |
j3 | 0:8a5a157f2603 | 12 | * in all copies or substantial portions of the Software. |
j3 | 0:8a5a157f2603 | 13 | * |
j3 | 0:8a5a157f2603 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
j3 | 0:8a5a157f2603 | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
j3 | 0:8a5a157f2603 | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
j3 | 0:8a5a157f2603 | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
j3 | 0:8a5a157f2603 | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
j3 | 0:8a5a157f2603 | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
j3 | 0:8a5a157f2603 | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
j3 | 0:8a5a157f2603 | 21 | * |
j3 | 0:8a5a157f2603 | 22 | * Except as contained in this notice, the name of Maxim Integrated |
j3 | 0:8a5a157f2603 | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
j3 | 0:8a5a157f2603 | 24 | * Products, Inc. Branding Policy. |
j3 | 0:8a5a157f2603 | 25 | * |
j3 | 0:8a5a157f2603 | 26 | * The mere transfer of this software does not imply any licenses |
j3 | 0:8a5a157f2603 | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
j3 | 0:8a5a157f2603 | 28 | * trademarks, maskwork rights, or any other form of intellectual |
j3 | 0:8a5a157f2603 | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
j3 | 0:8a5a157f2603 | 30 | * ownership rights. |
j3 | 0:8a5a157f2603 | 31 | ******************************************************************************* |
j3 | 0:8a5a157f2603 | 32 | */ |
j3 | 0:8a5a157f2603 | 33 | |
j3 | 0:8a5a157f2603 | 34 | |
j3 | 0:8a5a157f2603 | 35 | #include "mbed.h" |
j3 | 0:8a5a157f2603 | 36 | #include "max32630fthr.h" |
j3 | 0:8a5a157f2603 | 37 | #include "MultipinRGB.h" |
j3 | 0:8a5a157f2603 | 38 | |
j3 | 0:8a5a157f2603 | 39 | |
j3 | 0:8a5a157f2603 | 40 | MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); |
j3 | 0:8a5a157f2603 | 41 | |
j3 | 0:8a5a157f2603 | 42 | |
j3 | 0:8a5a157f2603 | 43 | int main() |
j3 | 0:8a5a157f2603 | 44 | { |
j3 | 0:8a5a157f2603 | 45 | MultipinRGB leds(LED1, LED2, LED3); |
j3 | 0:8a5a157f2603 | 46 | |
j3 | 0:8a5a157f2603 | 47 | while(1) |
j3 | 0:8a5a157f2603 | 48 | { |
j3 | 1:e10e0ccddca1 | 49 | leds.toggleLed(MultipinRGB::Red); |
j3 | 1:e10e0ccddca1 | 50 | wait(0.25); |
j3 | 1:e10e0ccddca1 | 51 | leds.toggleLed(MultipinRGB::Red); |
j3 | 1:e10e0ccddca1 | 52 | leds.toggleLed(MultipinRGB::Green); |
j3 | 0:8a5a157f2603 | 53 | wait(0.25); |
j3 | 1:e10e0ccddca1 | 54 | leds.toggleLed(MultipinRGB::Green); |
j3 | 1:e10e0ccddca1 | 55 | leds.toggleLed(MultipinRGB::Blue); |
j3 | 1:e10e0ccddca1 | 56 | wait(0.25); |
j3 | 1:e10e0ccddca1 | 57 | leds.toggleLed(MultipinRGB::Blue); |
j3 | 0:8a5a157f2603 | 58 | } |
j3 | 0:8a5a157f2603 | 59 | } |