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 kbt by
kbt.h
00001 00002 #ifndef KBT_H 00003 #define KBT_H 00004 00005 #include "mbed.h" 00006 00007 #define BITNUM 8 00008 #define DATANUM 7 00009 00010 #define rect 0 00011 #define L1 1 00012 #define L2 2 00013 #define R1 3 00014 #define R2 4 00015 #define up 5 00016 #define down 6 00017 #define right 7 00018 #define left 8 00019 #define triangle 9 00020 #define cross 10 00021 #define circle 11 00022 #define Start 12 00023 #define Select 13 00024 #define L_around 0 00025 #define L_updown 1 00026 #define R_around 2 00027 #define R_updown 3 00028 00029 class KBT{ 00030 public : 00031 bool Button[14]; 00032 int Stick[4]; 00033 int open_data[8]; 00034 00035 KBT(PinName TX, PinName RX); 00036 void init(long baudrate); 00037 bool button(int num); 00038 int stick(int num); 00039 00040 private : 00041 Serial bt; 00042 bool start; 00043 int stopcheck; 00044 int val; 00045 int count; 00046 int bitbox[8]; 00047 int data[8]; 00048 int check[9]; 00049 00050 long map(long x, long in_min, long in_max, long out_min, long out_max); 00051 void bitcheck(); 00052 void intSerial(); 00053 void numinit(); 00054 00055 }; 00056 00057 #endif 00058
Generated on Mon Jul 18 2022 04:00:10 by
