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-25
- Revision:
- 3:6122dfbc9d9e
- Parent:
- 2:7e5609174292
- Child:
- 4:9decf12340fa
File content as of revision 3:6122dfbc9d9e:
/* 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); SPIClass SPI1(NRF_SPI1); Serial pc(USBTX, USBRX); Adafruit_SSD1306_nrf gOled1(&SPI1,A4,A3,D2); int main(void) { spi_cs = 1; pc.printf("SPI Demo Start \r\n"); //SPI1.begin(); SPI1.begin(P0_8, P0_9, P0_11);//SCK, MOSI, MISO pc.printf("Step 1 \r\n"); }