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.
Ir.h
00001 00002 /* Parallax High Speed Continuous Servo 00003 John Donnal 2018 00004 */ 00005 00006 #ifndef _IR_H 00007 #define _IR_H 00008 00009 /** 00010 * Includes 00011 */ 00012 #include "mbed.h" 00013 00014 /** 00015 * 38KHz IR Receiver (for Sony RM-EZ4 Remote) 00016 */ 00017 class IrIn { 00018 00019 public: 00020 00021 /** 00022 * Constructor. 00023 * 00024 * @param output mbed pin for input channel. 00025 */ 00026 IrIn(PinName input); 00027 00028 /** 00029 * Decode IR data, blocks until data is received 00030 */ 00031 int read(); 00032 private: 00033 00034 void falling_edge_(); 00035 void rising_edge_(); 00036 InterruptIn ir_; 00037 Timer t_; 00038 int rx_in_progress_; 00039 int rx_complete_; 00040 int rx_bits_; 00041 int msg_; 00042 }; 00043 00044 #endif /* CONTINUOUS_SERVO_H */
Generated on Thu Aug 25 2022 02:14:57 by
