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.
Dependencies: Gameduino mbed nRF2401A
Fork of Gameduino_Invaders_game by
Revision 5:3ede9991d8e0, committed 2014-03-09
- Comitter:
- TheChrisyd
- Date:
- Sun Mar 09 12:27:20 2014 +0000
- Parent:
- 4:bb78bedae411
- Commit message:
- Update to match Library update
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| nRF2401A.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Oct 26 22:34:08 2013 +0000
+++ b/main.cpp Sun Mar 09 12:27:20 2014 +0000
@@ -20,16 +20,15 @@
#include "nRF2401A.h"
#define WIRELESS
-nRF2401A wireless_joypad(p10, p11, p12, p13, p14);
-byte wireless_dpad = 0;
-byte wireless_buttons = 0;
+nRF2401A wireless_joypad(p10, p11, p12, p13, p14);//ce, cs, dr1, clk1, data
+uint8_t wireless_dpad = 0;
+uint8_t wireless_buttons = 0;
DigitalOut debug(LED1);
-//void nRF2401A_rx (void *arg);
void nRF2401A_rx (void *arg)
{
- wireless_joypad.readMsg_byte(&wireless_dpad, 0 );
- wireless_joypad.readMsg_byte(&wireless_buttons, 1 );
+ wireless_dpad = wireless_joypad.readMsg_byte( 0 );
+ wireless_buttons = wireless_joypad.readMsg_byte( 1 );
debug = !debug;
}
@@ -37,11 +36,7 @@
GD.begin();
#ifdef WIRELESS
wait(0.005);
- wireless_joypad.setDataPayloadLength(4 << 3)
- .setAddress(0x0, 0x0, 0x53, 0x53, 0x53, 3 << 3)
- .setCRCMode(nRF2401A::NO_CRC)
- .setDataRate(nRF2401A::BIT_RATE_250KBITS)
- .setChannel(0x02);
+ wireless_joypad.setAddress(0x0, 0x0, 0x53, 0x53, 0x53, 3 << 3);
wireless_joypad.flushControlPacket();
wireless_joypad.attachRXHandler(&nRF2401A_rx, 0);
--- a/nRF2401A.lib Sat Oct 26 22:34:08 2013 +0000 +++ b/nRF2401A.lib Sun Mar 09 12:27:20 2014 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/TheChrisyd/code/nRF2401A/#fb7cb88e80a4 +https://mbed.org/users/TheChrisyd/code/nRF2401A/#7245524e37e4
