Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FRDM_KL46_ADC_LCD_PRACT_4 by
Diff: main.cpp
- Revision:
- 6:4f24e31b4ff3
- Parent:
- 5:62cb70eb6400
--- a/main.cpp Fri Dec 11 00:56:15 2015 +0000
+++ b/main.cpp Sun Sep 22 03:10:47 2019 +0000
@@ -4,12 +4,12 @@
#include "TextLCD.h"
//Declaración del periferico SPI con sus pines a utilizar
-SPI spi_lcd(PTD6, NC, PTD5); // MOSI, MISO, SCLK:::::Datos del ejemplo
-
+SPI spi_lcd(PTE18, NC, PTE17); // MOSI, MISO, SCLK:::::Datos del ejemplo
+DigitalOut ledr(PTE29);
//Configuración de la libreria del LCD
-TextLCD_SPI lcd(&spi_lcd, PTD4, TextLCD::LCD16x2,TextLCD::HD44780); // SPI bus, CS pin, LCD Type ok
+TextLCD_SPI lcd(&spi_lcd, PTE16, TextLCD::LCD16x2,TextLCD::HD44780); // SPI bus, CS pin, LCD Type ok
-AnalogIn an_pin(PTB1); //Creación de la entrada analogica
+//AnalogIn an_pin(PTB1); //Creación de la entrada analogica
float conv;
@@ -17,7 +17,7 @@
int main() {
int i=0;
- conv=0;
+ //conv=0;
// Limpieza del LCD
lcd.cls();
@@ -40,13 +40,14 @@
while(true){
lcd.cls();
- conv=an_pin.read(); //Lectura del Pin Analogico
+ //conv=an_pin.read(); //Lectura del Pin Analogico
/*
Su ecuación va aqui
*/
lcd.printf("Variable del ADC: i= %f ", conv);
wait(0.5);
- i++;
+ i++;
+ ledr=!ledr;
}
//FIN DEL PROGRAMA
