Close

SDCard Info

A project log for DIPDuino=(Arduino+ZigBee+OLED+SDCard+SRAM)*DIP32

Arduino compatible, breadboard friendly DIP32 package with ATMega1284RFR2, OLED display, SD card, SRAM and ZigBee on board.

alex-gornostayevAlex Gornostayev 01/31/2017 at 18:200 Comments

I've compiled SDCard Info example with the updated OLED Display Library and it works fin, jut do't forhet to switch SS between the display and SDCard. Here is a sample code:

const int chipSelect = 23;

DIP_OLED oled;
char s[20];

void switch_sd_ss(void)
{
  //Select CS output to SD Card
  DDRB |= (1 << 4) | (1 << 5);
  PORTB |= (1 << 4);
  PORTB &= ~(1 << 5);
  delay(2);
}

void out_text(int x, int y, const char * str)
{
  oled.out_text(x, y, str);
  oled.display(); 
  switch_sd_ss(); 
}

void setup() {
  oled.init();
  oled.clear();
  out_text(12, 10, "SD Card Test");
...


Discussions