PN532
Dependents: PN532_GPIO PN532_ReadUid EX_encoder_PID_QianYuyangV4
Fork of LibPN532 by
Arduino.cpp
- Committer:
- zhangyx
- Date:
- 2018-01-15
- Revision:
- 3:685e0bf1409d
- Parent:
- 0:db8030e71f55
File content as of revision 3:685e0bf1409d:
//////////////////////////////////////////////////////////////////////////////// // arudino wraper functions // by dotnfc@163.com // 2016/09/10 18:16:00 #include "Arduino.h" /*============================================================================== * \brief arduino like 'tone ()' */ void tone(PwmOut &buz, long frequency) { if (frequency == 0) { buz = 0; return; } float period; // calculate the period of the note in turn play period = 1000000 / frequency; // set the period calculated at the PWM output buz.period_us (period); // establish a duty cycle of 50% buz.write (0.50f); }