
code c++ carte KL25Z avec écran TFT Qr4 526S01 TP28017 oscilloscope (en développement)
Dependencies: poirier-proj-95 TFT_fonts mbed
Revision 2:1d66e2e776bc, committed 2015-05-13
- Comitter:
- dujardin
- Date:
- Wed May 13 08:01:47 2015 +0000
- Parent:
- 1:b2794eb7c940
- Child:
- 3:24069293d35d
- Commit message:
- exemple utile aux ?tudiants DUT GEII; premiers pas vers une utilisation autonome;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
perso/diver.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Feb 17 06:24:26 2014 +0000 +++ b/main.cpp Wed May 13 08:01:47 2015 +0000 @@ -1,23 +1,10 @@ /* main.cpp 2014 Copyright (c) Seeed Technology Inc. All right reserved. - - Author:lawliet zou(lawliet.zou@gmail.com) - 2014-02-17 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + recompilé à partir d'une librairy donnée par + :lawliet zou(lawliet.zou@gmail.com) + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public */ #include "mbed.h" @@ -26,60 +13,22 @@ #include "Arial24x23.h" #include "Arial28x28.h" #include "font_big.h" +#include "diver.h" -#if defined(TARGET_LPC11U24) //SEEEDUINO_ARCH -#define PIN_XP P0_14 -#define PIN_XM P0_12 -#define PIN_YP P0_13 -#define PIN_YM P0_11 -#define PIN_MOSI P1_22 -#define PIN_MISO P1_21 -#define PIN_SCLK P1_20 -#define PIN_CS_TFT P1_24 -#define PIN_DC_TFT P1_25 -#define PIN_BL_TFT P1_5 -#define PIN_CS_SD P1_18 -#elif defined(TARGET_LPC1768) //SEEEDUINO_ARCH_PRO -#define PIN_XP P0_26 -#define PIN_XM P0_24 -#define PIN_YP P0_25 -#define PIN_YM P0_23 -#define PIN_MOSI P0_18 -#define PIN_MISO P0_17 -#define PIN_SCLK P0_15 -#define PIN_CS_TFT P2_3 -#define PIN_DC_TFT P2_4 -#define PIN_BL_TFT P2_5 -#define PIN_CS_SD P2_2 -#else //please redefine the following pins -#define PIN_XP -#define PIN_XM -#define PIN_YP -#define PIN_YM -#define PIN_MOSI -#define PIN_MISO -#define PIN_SCLK -#define PIN_CS_TFT -#define PIN_DC_TFT -#define PIN_BL_TFT -#define PIN_CS_SD -#endif +SeeedStudioTFTv2 TFT(PTB3, PTB1, PTB2, PTB0, PTD2, PTD3, PTD1, PTA5, PTC8, PTC9, PTA4); -//SeeedStudioTFTv2 TFT(PTB3, PTB1, PTB2, PTB0, PTD2, PTD3, PTD1, PTA5, PTC8, PTC9, PTA4); - -SeeedStudioTFTv2 TFT(PIN_XP,PIN_XM,PIN_YP,PIN_YM,PIN_MOSI,PIN_MISO,PIN_SCLK,PIN_CS_TFT,PIN_DC_TFT,PIN_BL_TFT,PIN_CS_SD); int main() { - //Configure the display driver + //Configure l'afficheur TFT TFT.background(Black); TFT.foreground(White); - TFT.cls(); + TFT.cls(); - //Print a welcome message - TFT.set_font((unsigned char*) Arial12x12); + //Print : message de bonjour + TFT.set_font((unsigned char*) Arial28x28); TFT.locate(0,0); - TFT.printf("Hello Mbed"); + TFT.printf("Bonjour la France v1"); //Wait for 5 seconds wait(5.0);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/perso/diver.h Wed May 13 08:01:47 2015 +0000 @@ -0,0 +1,40 @@ +// pour le moment ce sont des choses inutiles + + +/*#if defined(TARGET_LPC11U24) //SEEEDUINO_ARCH +#define PIN_XP P0_14 +#define PIN_XM P0_12 +#define PIN_YP P0_13 +#define PIN_YM P0_11 +#define PIN_MOSI P1_22 +#define PIN_MISO P1_21 +#define PIN_SCLK P1_20 +#define PIN_CS_TFT P1_24 +#define PIN_DC_TFT P1_25 +#define PIN_BL_TFT P1_5 +#define PIN_CS_SD P1_18 +#elif defined(TARGET_LPC1768) //SEEEDUINO_ARCH_PRO +#define PIN_XP P0_26 +#define PIN_XM P0_24 +#define PIN_YP P0_25 +#define PIN_YM P0_23 +#define PIN_MOSI P0_18 +#define PIN_MISO P0_17 +#define PIN_SCLK P0_15 +#define PIN_CS_TFT P2_3 +#define PIN_DC_TFT P2_4 +#define PIN_BL_TFT P2_5 +#define PIN_CS_SD P2_2 +#else //please redefine the following pins +#define PIN_XP +#define PIN_XM +#define PIN_YP +#define PIN_YM +#define PIN_MOSI +#define PIN_MISO +#define PIN_SCLK +#define PIN_CS_TFT +#define PIN_DC_TFT +#define PIN_BL_TFT +#define PIN_CS_SD +#endif*/