PN532 Driver library This library provides an abstract API to drive the pn532 nfc chip, with I2C/HSU/SPI interface. Its based on the Seeed Studio's Arduino version.
Dependents: PN532_ReadUid Nfctest2
Arduino.cpp
00001 //////////////////////////////////////////////////////////////////////////////// 00002 // arudino wraper functions 00003 // by dotnfc@163.com 00004 // 2016/09/10 18:16:00 00005 00006 #include "Arduino.h" 00007 00008 00009 /*============================================================================== 00010 * \brief arduino like 'tone ()' 00011 */ 00012 void tone(PwmOut &buz, long frequency) 00013 { 00014 if (frequency == 0) { 00015 buz = 0; 00016 return; 00017 } 00018 00019 float period; 00020 00021 // calculate the period of the note in turn play 00022 period = 1000000 / frequency; 00023 // set the period calculated at the PWM output 00024 buz.period_us (period); 00025 // establish a duty cycle of 50% 00026 buz.write (0.50f); 00027 } 00028 00029
Generated on Tue Jul 12 2022 20:44:47 by 1.7.2