Browse Source

blink - update to use types.hh

usb_midi_launchpad
heck 7 months ago
parent
commit
432b614361
  1. 27
      src/main_blink.cc

27
src/main_blink.cc

@ -1,16 +1,31 @@
#include "daisy_seed.h" #include "daisy_seed.h"
#include "types.hh"
namespace ld = daisy; namespace Heck {
namespace Constants {
constexpr float BLINK_FREQ_HZ{ 1 };
}
static ld::DaisySeed hw{}; ld::DaisySeed hw{};
int main() float hz_to_ms(float hz)
{ {
return 1000. / hz;
}
int main()
{
hw.Init(); hw.Init();
while (true) { while (true) {
hw.SetLed(true); hw.SetLed(true);
hw.DelayMs(100); hw.DelayMs(hz_to_ms(Constants::BLINK_FREQ_HZ * 2));
hw.SetLed(false); hw.SetLed(false);
hw.DelayMs(100); hw.DelayMs(hz_to_ms(Constants::BLINK_FREQ_HZ * 2));
} }
}
} // namespace Heck
int main()
{
return Heck::main();
} }

Loading…
Cancel
Save