Simple radar simulator. Example of 2D graphics on DISCO-F746NG display.

Dependencies:   BSP_DISCO_F746NG Graphics mbed TS_DISCO_F746NG

Committer:
karpent
Date:
Sat Nov 05 20:24:59 2016 +0000
Revision:
4:66f13188c26b
Parent:
1:5e49b46de1b0
Code refactoring, 400ms timeout added when button is pressed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
karpent 0:d8b9955d2b36 1 /*
karpent 0:d8b9955d2b36 2 RadarDemo - Simple radar simulator, example of 2D graphics for STM32F746G-DISCO.
karpent 0:d8b9955d2b36 3
karpent 1:5e49b46de1b0 4 Copyright(c) 2016 karpent at gmail.com, MIT License
karpent 0:d8b9955d2b36 5
karpent 0:d8b9955d2b36 6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
karpent 0:d8b9955d2b36 7 to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
karpent 0:d8b9955d2b36 8 and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
karpent 0:d8b9955d2b36 9
karpent 0:d8b9955d2b36 10 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
karpent 0:d8b9955d2b36 11
karpent 0:d8b9955d2b36 12 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
karpent 0:d8b9955d2b36 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
karpent 0:d8b9955d2b36 14 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
karpent 0:d8b9955d2b36 15 THE USE OR OTHER DEALINGS IN THE SOFTWARE.
karpent 0:d8b9955d2b36 16 */
karpent 0:d8b9955d2b36 17
karpent 0:d8b9955d2b36 18 #include "RK043FN48H.h"
karpent 0:d8b9955d2b36 19 #include "RadarDemo.h"
karpent 0:d8b9955d2b36 20
karpent 0:d8b9955d2b36 21 RK043FN48H display;
karpent 0:d8b9955d2b36 22
karpent 0:d8b9955d2b36 23 int main()
karpent 0:d8b9955d2b36 24 {
karpent 0:d8b9955d2b36 25 RadarDemo demo(&display);
karpent 0:d8b9955d2b36 26 demo.Initialize();
karpent 0:d8b9955d2b36 27
karpent 1:5e49b46de1b0 28 // Set background color for non-transparent dark blue
karpent 0:d8b9955d2b36 29 display.SetActiveLayer(Background);
karpent 0:d8b9955d2b36 30 display.SetBackgroundColor(0xFF000032);
karpent 0:d8b9955d2b36 31 display.SetActiveLayer(Foreground);
karpent 0:d8b9955d2b36 32
karpent 0:d8b9955d2b36 33 while(demo.IsRunning()) {
karpent 1:5e49b46de1b0 34
karpent 1:5e49b46de1b0 35 // Render single frame
karpent 0:d8b9955d2b36 36 demo.Render();
karpent 1:5e49b46de1b0 37
karpent 1:5e49b46de1b0 38 // Wait a short time to see rendered frame
karpent 1:5e49b46de1b0 39 wait(0.02f);
karpent 0:d8b9955d2b36 40 }
karpent 0:d8b9955d2b36 41 }