The code given does everything for a basic wedge-bot with a structure in place to allow for a weapon pwm value to be sent as well.

Needed Libraries:

nRF24L01 Library from here: GitHub

Software PWM from here: Google Code

Set up your controller:

open the txMix code and change the stick limit values to the values you wrote down in the last step. This will ensure that the code reacts correctly to your joystick (Image 1)

Customize pipe:

To ensure you are not interfering with anyone else at your event, you will need to change the radio pipe. This is in effect an identifier, and the receiver will only act on signals from the correct pipe, so be sure to change the pipe in both codes to the same thing.

In image 2 hex digits of the pipe have been highlighted. These are the two digits that need to be changed to customize the pipe. Change "E1" to any other 2 digit hex value and write it down so you can easily check it against opponents pipes at an event

Upload:

txMix to the controller

receive to the receiver module

Run down of the code:

txMix:

The code reads in the joystick position as an "UP" value and a "side" value. these values get constrained based on the max value provided to ensure full power will be given at the maximum stick postion.

These values are then checked to ensure that the stick has moved out of the neutral position, if it has not zeros are sent.

The values are then individually mixed into two variables, one for the left motor speed and one for the right motor speed. In these variables a negative value is used to indicate the motor is driving backwards as it simplifies the mixing.

The left and right speed values are then separated into four values pwm values, one for each: motor right forwards, motor left forwards, motor right backwards, motor left backwards.

The four pwm values are then sent to the receiver.

receive:

Simply receives signals from the controller, checks that the signal does not contain pwm values for forwards and backwards on a single motor then applies the pwm.

The receiver also fail safes to motors off when a signal is not received from the controller