Dan Allegre / oled_graphic

Dependencies:   mbed

Revision:
2:b558c2d645b2
Parent:
1:414748809a35
Child:
3:ffbd1961115d
--- a/main.cpp	Sun Jun 21 22:27:00 2015 +0000
+++ b/main.cpp	Mon Jun 22 06:50:18 2015 +0000
@@ -9,13 +9,13 @@
 DigitalOut rs(D8);      //RES (keep high)
 DigitalOut cs(D7);      //CS  (active low)
 
-SPI spi(SPI_MOSI,SPI_MISO,SPI_SCK);
-//SPI spi(PB_15,PB_14,PB_13);
+SPI spi(SPI_MOSI,SPI_MISO,SPI_SCK);             //spi1 is the i2s
+SPI spi2(PB_15,PB_14,PB_13);                    //spi2 is the display
  
 int main() {
     
-    spi.frequency(8e6);                         //8MHz spi.  This is fast enough for 88KHz 16 bit sampling.
-    spi.format(8,0);                           //16 bit.  clock polarity 0, phase 0.
+    spi2.frequency(8e6);                         //8MHz spi22.  This is fast enough for 88KHz 16 bit sampling.
+    spi2.format(8,0);                            //16 bit.  clock polarity 0, phase 0.
     wait(.1);
     
     rs.write(1);
@@ -116,7 +116,7 @@
     dc.write(0);        //data/command low for command.
     cs.write(0);
     while(i){
-        spi.write(*data);
+        spi2.write(*data);
         data++;
         i--;
     }
@@ -128,7 +128,7 @@
     dc.write(1);        //data/command high for data.
     cs.write(0);
     while(i){
-        spi.write(*data);
+        spi2.write(*data);
         data++;
         i--;
     }