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.
Dependents: BlackberryTrackerballBreakout_HelloWorld
Trackball.h
00001 #ifndef MBED_TRACKBALL_H 00002 #define MBED_TRACKBALL_H 00003 00004 00005 #include "mbed.h" 00006 00007 #define dir_UP 1 00008 #define dir_DOWN 2 00009 #define dir_LEFT 3 00010 #define dir_RIGHT 4 00011 #define dir_BUTTON 5 00012 #define color_WHITE 1 00013 #define color_RED 2 00014 #define color_GREEN 3 00015 #define color_BLUE 4 00016 00017 //Setup a new class for a Trackball Module 00018 class Trackball 00019 { 00020 public: 00021 Trackball(PinName pin_btn, PinName pin_lft, PinName pin_rht, PinName pin_up, PinName pin_dwn, PinName pin_wht, PinName pin_grn, PinName pin_red, PinName pin_blu); 00022 unsigned int read(int dir); 00023 void write(unsigned int val, int color); 00024 private: 00025 //class sets up the pins 00026 DigitalIn _pin_btn; 00027 DigitalIn _pin_lft; 00028 DigitalIn _pin_rht; 00029 DigitalIn _pin_up; 00030 DigitalIn _pin_dwn; 00031 DigitalOut _pin_wht; 00032 DigitalOut _pin_grn; 00033 DigitalOut _pin_red; 00034 DigitalOut _pin_blu; 00035 }; 00036 00037 #endif
Generated on Thu Jul 14 2022 16:19:51 by
1.7.2