![](/media/cache/profiles/2e72ed76b7b3b9ce2f15fce64178dfaf.jpg.50x50_q85.jpg)
Shows how to use a display, the onboard SD Card and the onboard SPI Flash. Requires a display module with direct Arduino pinning
Dependencies: DmTftLibrary SDFileSystem mbed
Diff: main.cpp
- Revision:
- 2:a77053c4f5cc
- Parent:
- 1:76ec0e6dfe81
- Child:
- 3:e1e1053e286f
--- a/main.cpp Tue May 20 15:41:11 2014 +0000 +++ b/main.cpp Fri Jul 04 10:36:42 2014 +0000 @@ -28,8 +28,13 @@ * Typedefs and defines *****************************************************************************/ -#define log(...) printf(__VA_ARGS__) -//#define log(...) +/* Note that there are restrictions on which platforms that can use printf + in combinations with the DmTftLibrary. Some platforms (e.g. LPC1549 LPCXpresso) + use the same pins for USBRX/USBTX and display control. Printing will + cause the display to not work. Read more about this on the display's notebook + page. */ +//#define log(...) printf(__VA_ARGS__) +#define log(...) #define DM_PIN_SPI_MOSI D11 #define DM_PIN_SPI_MISO D12 @@ -44,11 +49,11 @@ * Local variables *****************************************************************************/ -DmTftIli9341 tft; /* DM_TFT28_105 */ -//DmTftSsd2119 tft; /* DM_TFT35_107 */ +//DmTftIli9341 tft; /* DM_TFT28_105 */ +DmTftSsd2119 tft; /* DM_TFT35_107 */ -DmTouch touch(DmTouch::DM_TFT28_105); -//DmTouch touch(DmTouch::DM_TFT35_107); +//DmTouch touch(DmTouch::DM_TFT28_105); +DmTouch touch(DmTouch::DM_TFT35_107); SDFileSystem sd(DM_PIN_SPI_MOSI, DM_PIN_SPI_MISO, DM_PIN_SPI_SCLK, DM_PIN_CS_SDCARD, "sd"); // mosi,miso,clk,cs W25Q16BV flash(DM_PIN_SPI_MOSI, DM_PIN_SPI_MISO, DM_PIN_SPI_SCLK, DM_PIN_CS_FLASH); // mosi,miso,clk,cs