Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Embed:
(wiki syntax)
Show/hide line numbers
LedBlinker.h
00001 #ifndef __LEDBLINKER_H 00002 #define __LEDBLINKER_H 00003 00004 #include "mbed.h" 00005 00006 class LedBlinker { 00007 public: 00008 LedBlinker(PinName p, float sample_frequency, float code_frequency); 00009 public: 00010 void set_code(uint8_t code); 00011 void update(); 00012 private: 00013 uint8_t _code; 00014 00015 uint32_t _tics_per_code, _tics_per_bit; 00016 00017 uint32_t _counter; 00018 uint8_t _bit; 00019 DigitalOut *_led; 00020 }; 00021 00022 #endif
Generated on Tue Jul 12 2022 17:58:39 by 1.7.2