KAIQUE DOGNANI
/
LCD_Aula_25_03_2020
faf
Diff: main.cpp
- Revision:
- 1:d5b85bc9e87b
- Parent:
- 0:4a5c6f06b26c
- Child:
- 2:edc5d3177f86
--- a/main.cpp Wed Mar 25 19:24:43 2020 +0000 +++ b/main.cpp Fri Apr 03 22:06:47 2020 +0000 @@ -1,17 +1,43 @@ #include "mbed.h" #include "LCD_ka.h" +AnalogIn Ya(A1); +AnalogIn Xa(A2); +DigitalIn botao(D3); int main(){ - clc(); Inicia_LCD(); - disp("kaique e um fofo"); - - - + int y = Ya.read()*1000; + int x = Xa.read()*1000; + disp("Josueb6$#@!"); - - - - - + while(1){ + int y = Ya.read()*1000; + int x = Xa.read()*1000; + wait(0.00002); + if (botao == 0){ + apaga(); + wait(0.3); + } + if((x < 400)||(x > 600)||(y < 400)||(y > 600)){ + int y = Ya.read()*1000; + int x = Xa.read()*1000; + + if (x > 900){ + direita(); + wait(0.2); + } + if (y > 900){ + baixo(); + wait(0.2); + } + if (x < 100){ + esquerda(); + wait(0.2); + } + if (y < 100){ + cima(); + wait(0.2); + } + } + } }