-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathmain.cpp
52 lines (43 loc) · 1.34 KB
/
main.cpp
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
/*
* Copyright (c) 2015-2017, Niklas Hauser
* Copyright (c) 2016, Sascha Schade
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------
#include <modm/board.hpp>
#include "calc.hpp"
using namespace Board;
// ----------------------------------------------------------------------------
int
main()
{
Board::initialize();
LedJ13::setOutput(modm::Gpio::Low);
LedJ5::setOutput(modm::Gpio::Low);
LedA12::setOutput(modm::Gpio::Low);
LedD4::setOutput(modm::Gpio::Low);
// Use the logging streams to print some messages.
// Change MODM_LOG_LEVEL above to enable or disable these messages
MODM_LOG_DEBUG << "debug" << modm::endl;
MODM_LOG_INFO << "info" << modm::endl;
MODM_LOG_WARNING << "warning" << modm::endl;
MODM_LOG_ERROR << "error" << modm::endl;
uint32_t counter(0);
while (true)
{
modm::delay(Button::read() ? 250ms : 1s);
LedJ13::toggle();
LedJ5::toggle();
LedA12::toggle();
LedD4::toggle();
MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
MODM_LOG_INFO << "double: " << Calc::get() << modm::endl;
Calc::calc();
}
return 0;
}