FLYSKY RC receiver compatible with TH9X transmitter. Uses an A7105-CL or A7105-SY 2.4Ghz module.

Dependents:   A7105_FLYSKY_RX_WITH_PPM

Files at this revision

API Documentation at this revision

Comitter:
pebayle
Date:
Fri Nov 13 08:49:01 2015 +0000
Parent:
1:b08e4695ffb7
Commit message:
just few changes in comments...

Changed in this revision

A7105_FLYSKY_RX.cpp Show annotated file Show diff for this revision Revisions of this file
A7105_FLYSKY_RX.h Show annotated file Show diff for this revision Revisions of this file
diff -r b08e4695ffb7 -r 19d3601a7744 A7105_FLYSKY_RX.cpp
--- a/A7105_FLYSKY_RX.cpp	Thu Jun 11 08:08:10 2015 +0000
+++ b/A7105_FLYSKY_RX.cpp	Fri Nov 13 08:49:01 2015 +0000
@@ -4,7 +4,16 @@
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /*
-// example program: 8 channels receiver with a FRDM-KL05Z platform :
+// example program: 8 channels receiver with a FRDM-KL05Z platform
+//
+// If you want to make a small RC receiver, you can do a custom board with a cheap KL05Z32VLC4 (LQPF32 0.8mm pitch package ),
+// an A7105CL or A7105SY module and a small 3.3V regulator. It works with target FRDM-KL05Z and no modification of mbed library!
+//
+// In order to program an external KL05Z32VLC4, I take a FRDM-KL25Z board (don't take FRDM-KL05Z board, there's a bug on design !!!),
+// cut wire under JP11 connector to disconnect onboard KL25Z chip, do a special cable (see FRDM-KL25Z schematic, J6 SWD CONNECTOR, 
+// you just need to solder 5 wires: 3.3V, GND, SWD_DIO, SWD_CLK, RST_TGT) to link your custom KL05Z32VLC4 board, and program FRDM-KL25Z
+// board with an FRDM-KL05Z firmware and it works fine as a cheap programmer interface!
+//
 
 #include "mbed.h"
 #include "A7105_FLYSKY_RX.h"
@@ -302,12 +311,7 @@
     //default id if failed
     if (!bindOk) for (cpt=0; cpt<4; cpt++)
         txId[cpt] = default_tx_id[cpt]; //txId <- pdefault_tx_id
-    
-    //compute channel offset
-    channelOffset = txId[0] >> 4;
-    if ( channelOffset > 9 ) channelOffset = 9;
-    //printf("\r\txId[0] = %x, channelOffset = %x", txId[0], channelOffset);
-    
+        
     //led off
     _statusLed = 1;
     
@@ -388,6 +392,7 @@
     channelCnt++; if ( channelCnt > 15 ) channelCnt = 0;
 
     //get channel number into "A7105_tx_channels" table
+    channelOffset = txId[0] >> 4; if ( channelOffset > 9 ) channelOffset = 9;
     channelNbr =  A7105_tx_channels[ txId[0] & 0x0F ][ channelCnt ] - channelOffset - 1;
         
     //listen to channel number
diff -r b08e4695ffb7 -r 19d3601a7744 A7105_FLYSKY_RX.h
--- a/A7105_FLYSKY_RX.h	Thu Jun 11 08:08:10 2015 +0000
+++ b/A7105_FLYSKY_RX.h	Fri Nov 13 08:49:01 2015 +0000
@@ -10,8 +10,8 @@
 static const unsigned char flysky_id[4] = { 0x54, 0x75, 0xC5, 0x2A }; //low byte first
 
 //default tx id
-//static const unsigned char default_tx_id[4] = { 0x06, 0x00, 0x00, 0x30 }; //low byte first
-static const unsigned char default_tx_id[4] = { 0xB2, 0xA1, 0x00, 0x00 }; //low byte first
+static const unsigned char default_tx_id[4] = { 0x06, 0x00, 0x00, 0x30 }; //low byte first (small quadcopter)
+//static const unsigned char default_tx_id[4] = { 0xB2, 0xA1, 0x00, 0x00 }; //low byte first (TH9X module)
 
 //A7105 register values (0xFF = don't modify register value)
 static const unsigned char A7105_regs_val[] = {