Examples for the Knowing the RP2040 book.
This examples were tested with the Raspberry Pi Pico C/C++ SDK v1.4.0 and the Raspberry Pi Pico board.
To compile and run the code follow instructions on the Raspberry Pi Pico C/C++ SDK Users Guide.
Organization of the files follow the chapters of the book.
Running code in both ARM cores, with synchronization.
Generating and handling PIO interrupts.
Putting the RP2040 in sleep and dormant modes.
Collecting ADC data using DMA.
Sending Data to a SPI LCD Display using DMA.
Measuring the clocks, changing the processors clock and outputting a clock in a GPIO pin.
Setting the Real Time Clock and using its alarms.
Using the System Timer.
Watchdog demonstration.
Digital output example: driving a four digit seven segment display.
Digital input example: reading a 4x4 matrix keypad.
Generating PWM signals.
Using the PWM peripheral to measure frequency and duty cycle.
Using the PIO to generate a square wave in a pin.
Serially transmit data with a clock.
Receive the data sent by SerialTx.
Using the PIO to interface an HC-SR04 ultrasonic sensor.
Reading numbers through the UART and print the sum.
Finding the addresses of the devices connected to a I^2^C bus.
Using an I^2^C 24C32 EEPROM.
Using SPI to interface an ADXL345 accelerometer.
Using the ADC to read the internal temperature sensor and an external light sensor (LDR).
A five key USB keyboard device
A very basic serial to USB adapter.