Beginner nRF52840, second section, buzzer

Development board: NRF52840 EVAL KIT in the early 100s of the first snow

Downloader: JLINK V8 firmware, has been updated to the latest firmware, I have used ST LINK, and DAP can be downloaded, but once the whole chip is erased to unlock the chip write protection, you can only use JLINK to solve it.

Content: Buzzer (normal GPIO output, non-PWM output)

Schematic diagram

Code

#define BUZZER  NRF_GPIO_PIN_MAP(0,15)

Main function

main int (void)
{     nrf_gpio_cfg_output (15); // P015 output mode     the while (. 1)     {         nrf_gpio_pin_clear (15); // also used as arguments BUZZER row         nrf_delay_ms (500);         nrf_gpio_pin_set (15);             nrf_delay_ms (500);         } }







        

 

No effect, just listen to the sound of Didi

 

Guess you like

Origin blog.csdn.net/jwdeng1995/article/details/105485569