Demo of Adafruit_SSD1306 graphics library and SPI interface on RedBear NANO nRF51822 board
Dependencies: Adafruit_GFX_nano SPI_Demo_Nano
This is a test of the RedBear nano board and the Adafruit oled display. Currently not working because of some problem with the SPI driver which I can't understand.
main.cpp
- Committer:
- tsh
- Date:
- 2015-02-26
- Revision:
- 13:21eae576159f
- Parent:
- 12:1404f010d12c
File content as of revision 13:21eae576159f:
/* Copyright (c) 2012-2014 RedBearLab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "mbed.h" #include "spi_master.h" #include "Adafruit_SSD1306.h" //DigitalOut spi_cs(P0_10); //DigitalOut rst(A3); //DigitalOut dc(A4); //DigitalOut cs(D2); DigitalOut led(D13); //SPIClass SPI1(NRF_SPI1); Adafruit_SSD1306_nrf gOled1(P0_5,P0_4,P0_10);// DC, RST, CS int main(void) { led = 1; // off wait (0.3); led = 0; // ON wait (0.3); led = 1; // off gOled1.configure(); //SPI1.begin(P0_8, P0_9, P0_11); //SPI1.transfer(0x55); while(1){ led = 0; // on wait(1); led = 1; wait(1); } }