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.
Revision 9:4e06441ceecf, committed 2019-05-27
- Comitter:
 - alittera
 - Date:
 - Mon May 27 11:13:55 2019 +0000
 - Parent:
 - 8:da53af1db462
 - Commit message:
 - Final revision.; Tested with led on D13, also visible with the built in Led on Nucleo-F401RE;
 
Changed in this revision
--- a/IRremote.h Sun May 26 17:18:25 2019 +0000 +++ b/IRremote.h Mon May 27 11:13:55 2019 +0000 @@ -49,8 +49,8 @@ #define DECODE_SAMSUNG 1 #define SEND_SAMSUNG 1 -#define DECODE_WHYNTER 1 -#define SEND_WHYNTER 1 +#define DECODE_WHYNTER 0 +#define SEND_WHYNTER 0 #define DECODE_AIWA_RC_T501 1 #define SEND_AIWA_RC_T501 1 @@ -58,23 +58,21 @@ #define DECODE_LG 1 #define SEND_LG 1 -#define DECODE_SANYO 1 +#define DECODE_SANYO 0 #define SEND_SANYO 0 // NOT WRITTEN -#define DECODE_MITSUBISHI 1 +#define DECODE_MITSUBISHI 0 #define SEND_MITSUBISHI 0 // NOT WRITTEN #define DECODE_DISH 0 // NOT WRITTEN -#define SEND_DISH 1 +#define SEND_DISH 0 #define DECODE_SHARP 0 // NOT WRITTEN #define SEND_SHARP 1 -#define DECODE_DENON 1 -#define SEND_DENON 1 #define DECODE_PRONTO 0 // This function doe not logically make sense -#define SEND_PRONTO 1 +#define SEND_PRONTO 0 #define DECODE_DAIKIN 1 #define SEND_DAIKIN 1 @@ -116,7 +114,6 @@ MITSUBISHI, DISH, SHARP, - DENON, PRONTO, DAIKIN } @@ -243,9 +240,7 @@ bool decodeSharp (decode_results *results) ; // NOT WRITTEN # endif //...................................................................... -# if DECODE_DENON - bool decodeDenon (decode_results *results) ; -# endif + DigitalIn _recvpin; Ticker _ticker; @@ -327,16 +322,13 @@ void sendSharp (unsigned int address, unsigned int command) ; # endif //...................................................................... -# if SEND_DENON - void sendDenon (unsigned long data, int nbits) ; -# endif - //...................................................................... # if SEND_PRONTO void sendPronto (char* code, bool repeat, bool fallback) ; # endif # if SEND_DAIKIN void sendDaikin(unsigned char buf[], int len, int start); + void daikinWarm(); # endif
--- a/irSend.cpp Sun May 26 17:18:25 2019 +0000 +++ b/irSend.cpp Mon May 27 11:13:55 2019 +0000 @@ -26,6 +26,8 @@ if (time > 0) custom_delay_usec(time); } + + //+============================================================================= // Leave pin off for time (given in microseconds) // Sends an IR space for the specified number of microseconds.
--- a/ir_Daikin.cpp	Sun May 26 17:18:25 2019 +0000
+++ b/ir_Daikin.cpp	Mon May 27 11:13:55 2019 +0000
@@ -1,95 +1,4 @@
-/*
-Assuming the protocol we are adding is for the (imaginary) manufacturer:  Shuzu
 
-Our fantasy protocol is a standard protocol, so we can use this standard
-template without too much work. Some protocols are quite unique and will require
-considerably more work in this file! It is way beyond the scope of this text to
-explain how to reverse engineer "unusual" IR protocols. But, unless you own an
-oscilloscope, the starting point is probably to use the rawDump.ino sketch and
-try to spot the pattern!
-
-Before you start, make sure the IR library is working OK:
-  # Open up the Arduino IDE
-  # Load up the rawDump.ino example sketch
-  # Run it
-
-Now we can start to add our new protocol...
-
-1. Copy this file to : ir_Shuzu.cpp
-
-2. Replace all occurrences of "Shuzu" with the name of your protocol.
-
-3. Tweak the #defines to suit your protocol.
-
-4. If you're lucky, tweaking the #defines will make the default send() function
-   work.
-
-5. Again, if you're lucky, tweaking the #defines will have made the default
-   decode() function work.
-
-You have written the code to support your new protocol!
-
-Now you must do a few things to add it to the IRremote system:
-
-1. Open IRremote.h and make the following changes:
-   REMEMEBER to change occurences of "SHUZU" with the name of your protocol
-
-   A. At the top, in the section "Supported Protocols", add:
-      #define DECODE_SHUZU  1
-      #define SEND_SHUZU    1
-
-   B. In the section "enumerated list of all supported formats", add:
-      SHUZU,
-      to the end of the list (notice there is a comma after the protocol name)
-
-   C. Further down in "Main class for receiving IR", add:
-      //......................................................................
-      #if DECODE_SHUZU
-          bool  decodeShuzu (decode_results *results) ;
-      #endif
-
-   D. Further down in "Main class for sending IR", add:
-      //......................................................................
-      #if SEND_SHUZU
-          void  sendShuzu (unsigned long data,  int nbits) ;
-      #endif
-
-   E. Save your changes and close the file
-
-2. Now open irRecv.cpp and make the following change:
-
-   A. In the function IRrecv::decode(), add:
-      #ifdef DECODE_NEC
-          DBG_PRINTLN("Attempting Shuzu decode");
-          if (decodeShuzu(results))  return true ;
-      #endif
-
-   B. Save your changes and close the file
-
-You will probably want to add your new protocol to the example sketch
-
-3. Open MyDocuments\Arduino\libraries\IRremote\examples\IRrecvDumpV2.ino
-
-   A. In the encoding() function, add:
-      case SHUZU:    printf("SHUZU");     break ;
-
-Now open the Arduino IDE, load up the rawDump.ino sketch, and run it.
-Hopefully it will compile and upload.
-If it doesn't, you've done something wrong. Check your work.
-If you can't get it to work - seek help from somewhere.
-
-If you get this far, I will assume you have successfully added your new protocol
-There is one last thing to do.
-
-1. Delete this giant instructional comment.
-
-2. Send a copy of your work to us so we can include it in the library and
-   others may benefit from your hard work and maybe even write a song about how
-   great you are for helping them! :)
-
-Regards,
-  BlueChip
-*/
 
 #include "IRremote.h"
 #include "IRremoteInt.h"
@@ -97,7 +6,7 @@
 //==============================================================================
 //
 //
-//                              S H U Z U
+//                              DAIKIN LITTERA
 //
 //
 //==============================================================================
@@ -125,37 +34,20 @@
 //
 
 
-void IRsend::sendDaikinWake() {
-    enableIROut(38);
-    space(DYIRDAIKIN_ZERO_MARK);
-    //
-    mark(DYIRDAIKIN_ZERO_MARK);
-    space(DYIRDAIKIN_ZERO_MARK);
-    //
-    mark(DYIRDAIKIN_ZERO_MARK);
-    space(DYIRDAIKIN_ZERO_MARK);
-    //
-    mark(DYIRDAIKIN_ZERO_MARK);
-    space(DYIRDAIKIN_ZERO_MARK);
-    //
-    mark(DYIRDAIKIN_ZERO_MARK);
-    space(DYIRDAIKIN_ZERO_MARK);
-    //
-    mark(DYIRDAIKIN_ZERO_MARK);
-    space(DYIRDAIKIN_ZERO_MARK);
-}
-
-void IRsend::sendIRWarm() {
-    _pwm.write(0.5)
+void  IRsend::daikinWarm ()
+{
+    _pwm.write(0.5);
     IRsend::custom_delay_usec(100);
-    _pwm.write(0.0)
+    _pwm.write(0.0);
     IRsend::custom_delay_usec(5);
 }
 
 
 void IRsend::sendDaikin(unsigned char buf[], int len, int start) {
     int data2;
-	sendIRWarm();
+
+    daikinWarm();
+
     enableIROut(DYIRDAIKIN_FREQUENCY);
     mark(DYIRDAIKIN_HDR_MARK);
     space(DYIRDAIKIN_HDR_SPACE);
--- a/ir_Denon.cpp	Sun May 26 17:18:25 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#include "IRremote.h"
-#include "IRremoteInt.h"
-
-// Reverse Engineered by looking at RAW dumps generated by IRremote
-
-// I have since discovered that Denon publish all their IR codes:
-//  https://www.google.co.uk/search?q=DENON+MASTER+IR+Hex+Command+Sheet
-//  -> http://assets.denon.com/documentmaster/us/denon%20master%20ir%20hex.xls
-
-// Having looked at the official Denon Pronto sheet and reverse engineered
-// the timing values from it, it is obvious that Denon have a range of
-// different timings and protocols ...the values here work for my AVR-3801 Amp!
-
-//==============================================================================
-//                    DDDD   EEEEE  N   N   OOO   N   N
-//                     D  D  E      NN  N  O   O  NN  N
-//                     D  D  EEE    N N N  O   O  N N N
-//                     D  D  E      N  NN  O   O  N  NN
-//                    DDDD   EEEEE  N   N   OOO   N   N
-//==============================================================================
-
-#define BITS          14  // The number of bits in the command
-
-#define HDR_MARK     300  // The length of the Header:Mark
-#define HDR_SPACE    750  // The lenght of the Header:Space
-
-#define BIT_MARK     300  // The length of a Bit:Mark
-#define ONE_SPACE   1800  // The length of a Bit:Space for 1's
-#define ZERO_SPACE   750  // The length of a Bit:Space for 0's
-
-//+=============================================================================
-//
-#if SEND_DENON
-void  IRsend::sendDenon (unsigned long data,  int nbits)
-{
-	// Set IR carrier frequency
-	enableIROut(38);
-
-	// Header
-	mark (HDR_MARK);
-	space(HDR_SPACE);
-
-	// Data
-	for (unsigned long  mask = 1UL << (nbits - 1);  mask;  mask >>= 1) {
-		if (data & mask) {
-			mark (BIT_MARK);
-			space(ONE_SPACE);
-		} else {
-			mark (BIT_MARK);
-			space(ZERO_SPACE);
-		}
-	}
-
-	// Footer
-	mark(BIT_MARK);
-    space(0);  // Always end with the LED off
-}
-#endif
-
-//+=============================================================================
-//
-#if DECODE_DENON
-bool  IRrecv::decodeDenon (decode_results *results)
-{
-	unsigned long  data   = 0;  // Somewhere to build our code
-	int            offset = 1;  // Skip the Gap reading
-
-	// Check we have the right amount of data
-	if (irparams.rawlen != 1 + 2 + (2 * BITS) + 1)  return false ;
-
-	// Check initial Mark+Space match
-	if (!MATCH_MARK (results->rawbuf[offset++], HDR_MARK ))  return false ;
-	if (!MATCH_SPACE(results->rawbuf[offset++], HDR_SPACE))  return false ;
-
-	// Read the bits in
-	for (int i = 0;  i < BITS;  i++) {
-		// Each bit looks like: MARK + SPACE_1 -> 1
-		//                 or : MARK + SPACE_0 -> 0
-		if (!MATCH_MARK(results->rawbuf[offset++], BIT_MARK))  return false ;
-
-		// IR data is big-endian, so we shuffle it in from the right:
-		if      (MATCH_SPACE(results->rawbuf[offset], ONE_SPACE))   data = (data << 1) | 1 ;
-		else if (MATCH_SPACE(results->rawbuf[offset], ZERO_SPACE))  data = (data << 1) | 0 ;
-		else                                                        return false ;
-		offset++;
-	}
-
-	// Success
-	results->bits        = BITS;
-	results->value       = data;
-	results->decode_type = DENON;
-	return true;
-}
-#endif