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.
Dependencies: SDFileSystem emic2 mbed-rtos mbed
button.h
00001 #include "mbed.h" 00002 00003 #ifndef BUTTON_H 00004 #define BUTTON_H 00005 00006 // This is a button class for our custom button 00007 class button { 00008 00009 // pins connected to the button 00010 private: 00011 PwmOut servo; 00012 DigitalIn pb; 00013 int state; // where is the button (0 - 4) 00014 int press; // is the button up or down 00015 int id; // this is the ID, each button should have a unique id 00016 00017 public: 00018 // constructors 00019 button(); // Default 00020 button(PwmOut servo, DigitalIn pb, int id); 00021 00022 // functions 00023 PwmOut getServoPin(); // get the servo pin 00024 void setState(int); // set what state the button is in - up or down 00025 void setPress(int); // set the button press 00026 void moveServoIn(); // move servo into the slot 00027 void moveServoOut(); // move servo out of the slot 00028 int getID(); 00029 int updateState(); 00030 int getState(); 00031 int getPress(); 00032 int getLp(); 00033 void setup(); 00034 }; 00035 00036 #endif
Generated on Fri Jul 15 2022 04:33:16 by
1.7.2