I made another "Bayang" receiver modification. In this version, there are 4 servo-type outputs, any of them can be used also as bi-directional motor control, when signal is feeded to bi-directional ESC (electronic speed controller). Simple one-way motor analog speed control on D6 is disabled in this version, instead D6 is used as fourth servo (or ESC) signal. In file "Bayang.ino" I made comments how to easily change servo (or ESC) ranges for your needs. Look for commented lines like this: " //change "80.0" to other servo degrees what you need." Code is in attachment. Enjoy :)
Update: well, that was easier that I thought it will be, with my non-existing programming skills. I added four digital (On/Off, 1/0) outputs that are controlled from four buttons on "Floureon H101" remote, namely: Flip, Return, Invert, Headless. Summary, receiver features are: Servo1 - D7 Servo2 - D8 Servo3 - D9 On/Off from "FLIP" button - D10 On/Off from "RETURN" button - D11 On/Off from "HEADLESS" button - D12 On/Off from "INVERT" button - D13 Speed - D6
Again, Thanks to Authors of original code, and RC boat modification! I attach modified code here.
Hello again! I followed Your suggestions, and made additions to code. It is working now with 3 servos control! Thank You for this small code lesson ;-) Big Thankyou. I post here relevant code changes, so maybe someone else interested can do the same. In file "nRF24_multipro.ino": . . #include <Servo.h> Servo servo1; Servo servo2; Servo servo3; . . Serial.begin( 115200 ); Serial.println( "Start" ); servo1.attach( 7 ); servo2.attach( 8 ); servo3.attach( 9 ); . .
And, in file "Bayang.ino": . . servo1.write( - asin( roll / 511.5 - 1.0 ) / ( 3.1416 / 2 ) * 80.0 + 90 ); servo2.write( pitch / 1023.0 * 180 ); servo3.write( yaw / 1023.0 * 180 ); . . // neutral all servos position; motor off: servo1.write( 90 ); servo2.write( 90 ); servo3.write( 90 ); . . I think I will try to understand code of pushbuttons ("flip", "headless", etc), would be awesome to receive and use them too (you know - lights on/off, missile launch, self destruct, etc, etc :) :) )
I am very thankful for Your response! I will try to play with code next days. I tried code "as is", and it is working (with "Floureon H101" remote), so I know basically system is working. I will try to expand possibilities now. Thanks again!
Thank You for sharing this project! I am not so good at programming, could You help me a little? What parts of code should be cloned/modified to get more servo channels outputs? I studied code, yours and original RX, but I am lost there for now. Thanks in advance!