Utilizando a Nucleo F103RB com um módulo LCD e um Joystick para interface

Dependencies:   mbed

Committer:
kaiquedog
Date:
Wed Aug 25 13:02:16 2021 +0000
Revision:
10:d77ef093800b
Parent:
9:891ffa97d8fb
Finalizado

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kaiquedog 0:bf743d54917c 1 #ifndef JOYSTICK_H
kaiquedog 0:bf743d54917c 2 #define JOYSTICK_H
kaiquedog 0:bf743d54917c 3 #include "mbed.h"
kaiquedog 0:bf743d54917c 4
kaiquedog 0:bf743d54917c 5 class Joystick {
kaiquedog 0:bf743d54917c 6 public:
kaiquedog 0:bf743d54917c 7 Joystick(PinName vrx, PinName vry, PinName Sw);
kaiquedog 0:bf743d54917c 8 /*
kaiquedog 0:bf743d54917c 9 *******************************
kaiquedog 0:bf743d54917c 10 **** DEFINIÇÕES DE FUNÇÕES ****
kaiquedog 0:bf743d54917c 11 *******************************
kaiquedog 0:bf743d54917c 12 */
kaiquedog 0:bf743d54917c 13 // Função que retorna o valor de VRX
kaiquedog 0:bf743d54917c 14 int ler_x(); // 1 --> VRX > 800 || 0 --> VRX < 200
kaiquedog 0:bf743d54917c 15
kaiquedog 0:bf743d54917c 16 // Função que retorna o valor de VRX
kaiquedog 0:bf743d54917c 17 int ler_y(); // 1 --> VRY > 800 || 0 --> VRY < 200
kaiquedog 0:bf743d54917c 18
kaiquedog 0:bf743d54917c 19 // Função que retorna 0 quando o botão for apertado
kaiquedog 0:bf743d54917c 20 int bot_select();
kaiquedog 0:bf743d54917c 21
kaiquedog 0:bf743d54917c 22 /*
kaiquedog 0:bf743d54917c 23 ********************************
kaiquedog 0:bf743d54917c 24 **** DEFINIÇÕES DE ENTRADAS ****
kaiquedog 0:bf743d54917c 25 ********************************
kaiquedog 0:bf743d54917c 26 */
kaiquedog 0:bf743d54917c 27 AnalogIn VRX; // Entrada analógica VRX
kaiquedog 9:891ffa97d8fb 28 AnalogIn VRY; // Entrada analógica VRY
kaiquedog 0:bf743d54917c 29 DigitalIn Switch; // Entrada digital SW
kaiquedog 0:bf743d54917c 30 };
kaiquedog 0:bf743d54917c 31
kaiquedog 0:bf743d54917c 32 #endif