Button Input-wireless-serial input to Arduino

Hello all

Brand new ‘wixelite’ in need of some guidance.

The task I have set myself is to wirelessly connect a 15 button remote keypad to an Arduino Uno located in a model train. Due to IO restrictions on the Arduino end (I also need the Arduino to control speed and direction on the train aswell as a sound system) I was thinking that the best option there would be for the Arduino to receive the pin status via its onboard serial pin (Rx only as I dont need anything back from it).

That is to say:
Button input to “RemoteControl” wixel,
“RemoteControl” wixel wirelessly sends button pressed to “Receiver” wixel,
“Receiver” wixel will TX button status serially to Arduino.

I admit I am going round in circles at the moment trying to pick the right combination of examples from which I can create the necessary App to do all of this, some guidance here would be appreciated.

So far I have stripped apart the IO_repeater app which seems to fit some of my needs and I have also been looking at the wireless_serial App, (I set that up on the two wixels I have and have communicated with them) to be honest these seem way too advanced for the application I am trying to set up.

Hello.

I recommend looking at the wireless_tilt_mouse and wireless_tilt_mouse_receiver apps. Each of these apps are pretty simple and they demonstrate how to use the radioQueue library to regularly send some data (3 bytes) from a transmitter to a receiver.

On the transmitter, you would need to change it to read all your button inputs and store the states of the buttons in the packet to be sent. There’s actually a line in wireless_tilt_mouse.c that is already doing part of what you want:

txBuf[3] = (!isPinHigh(12) << MOUSE_BUTTON_LEFT) | (!isPinHigh(17) << MOUSE_BUTTON_RIGHT);

On the receiver end, you would need to add the Wixel’s UART library and add code to send the received data out on UART0 or UART1. You can remove the USB HID code.

–David

Hi David,

Thanks for the advice,I have managed to get two apps compiled based on the tilt_mouse apps.
I have just gone with a simple two button set up on the Tx board, with the status being checked with a basic
"if----else if" statement, passing the result into the tx buffer.

Now I need to build the hardware up to give it a test.

–Rolph.