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: MMA8451Q TSI mbed nRF24L01P
Diff: Transmitter.cpp
- Revision:
- 3:97b52150569f
- Parent:
- 2:1ddb39cd4f02
diff -r 1ddb39cd4f02 -r 97b52150569f Transmitter.cpp
--- a/Transmitter.cpp Sun Mar 18 15:55:44 2018 +0000
+++ b/Transmitter.cpp Sun Mar 18 15:59:43 2018 +0000
@@ -1,13 +1,11 @@
#include "nRF24L01P.h"
#include "MMA8451Q.h"
-#include "TSISensor.h"
-#include "USBMouse.h"
+#include "TSISensor.h"
#define MMA8451_addr (0X1d<<1)
-USBMouse mouse;
MMA8451Q acc(PTE25,PTE24,MMA8451_addr);
TSISensor tsi;
-Serial pc(USBTX, USBRX); // tx, rx
+Serial pc(USBTX, USBRX);
nRF24L01P my_nrf24l01p(PTD2, PTD3, PTD1, PTD0, PTD5, PTD4);
int main()
@@ -25,7 +23,6 @@
{
x=acc.getAccX();
y=acc.getAccY();
- // mouse.move(-1*20*y,20*x);
count[0]=(y+2.0f)*50.0f;
count[1]=(x+2.0f)*50.0f;
tsival=tsi.readPercentage();
@@ -33,21 +30,18 @@
{
if(tsival>=0.6)
{
- // mouse.press(MOUSE_LEFT);
+
count[2]=1;
count[3]=0;
}
else if(tsival<=0.4&&tsival!=0.0)
{
- // mouse.press(MOUSE_RIGHT);
count[3]=1;
count[2]=0;
}
}
else
{
- // mouse.release(MOUSE_LEFT);
- // mouse.release(MOUSE_RIGHT);
count[3]=0;
count[2]=0;
}