Skip to content

Commit

Permalink
Add note about hardware peripheral SPI & how to enable spi1 hardware.
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-77 committed Apr 30, 2024
1 parent 50e0b09 commit e0d04d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/pico_CMake_setup/MyProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
#include <stdio.h>
#include "pico/stdlib.h"

// Pin definitions for OLED
// Pin definitions for OLED display
// NOTE: SCK & MOSI pins must be one of the hardware peripheral SPI pins
#define OLED_RST 3
#define OLED_DC 2
#define OLED_CS 5
#define OLED_SCK 18
#define OLED_MOSI 19
#define SPI_FREQ 0 // 0 means default frequency

// spi0 is used by default, to use spi1 uncomment the following line:
//#define PICO_USE_SPI1

// Include lcdgfx and use like for Arduino
#include "lcdgfx.h"
DisplaySSD1306_128x64_SPI oled(OLED_RST, {-1, OLED_CS, OLED_DC, SPI_FREQ, OLED_SCK, OLED_MOSI});
Expand Down

0 comments on commit e0d04d1

Please sign in to comment.