Patch SM OLED 1306 I2C set up
OMG…
I tried the OLED_1306 I2C driver and code example and it just works
I was thinking I needed to tell it the correct pins and spent some time on this, and then just thought well I’ll just try it.
// Connect SM pins / B9 - I2C_SCL / B8 - I2C_SDA / 3.3v
#include <stdio.h>
#include <string.h>
#include “daisy_seed.h”
#include “dev/oled_ssd130x.h”
using namespace daisy;
using MyOledDisplay = OledDisplay;
DaisySeed hw;
MyOledDisplay display;
int main(void)
{
uint8_t message_idx;
hw.Configure();
hw.Init();
/** Configure the Display */
MyOledDisplay::Config disp_cfg;
/** And Initialize */
display.Init(disp_cfg);
message_idx = 0;
char strbuff[128];
while(1)
{
System::Delay(500);
switch(message_idx)
{
case 0: sprintf(strbuff, "Testing. . ."); break;
case 1: sprintf(strbuff, "Daisy. . ."); break;
case 2: sprintf(strbuff, "1. . ."); break;
case 3: sprintf(strbuff, "2. . ."); break;
case 4: sprintf(strbuff, "3. . ."); break;
default: break;
}
message_idx = (message_idx + 1) % 5;
display.Fill(false);
display.SetCursor(0, 0);
display.WriteString(strbuff, Font_11x18, true);
display.Update();
}
}
1 Like
I’m glad to see that you got it working
I also got the MPC4728 connected with the 1306 OLED on the I2C bus. I used I2C scanner in Arduino IDE to test. Thanks for your great tutorials!
Niceee!! The Quad DAC is so awesome.
I’m glad my tutorial was helpful