Hi,
I have already been able to implement the wireless data sending of my Arduino Micro board via Bluetooth. I used following code to send my sensor data from the arduino board to PC. But I want it to be able to do a Keyboard.Press(); according to the data I receive from my sensors attached to the Micro board.
Is there any way to send this Keyboard.Press(); command wireless to my PC via Bluetooth ?
I use Arduino Micro with HC-05 to send data to the PC wireless.
#include <SoftwareSerial.h>
#include "Wire.h"
#include "I2Cdev.h"
#include "MPU9250.h"
MPU9250 accelgyro;
I2Cdev I2C_M;
int16_t ax, ay, az;
int16_t gx, gy, gz;
int16_t mx, my, mz;
float Axyz[3];
const int rxPort = 8; // connected to Bluetooth TX
const int txPort = 9; // connected to Bluetooth RX
SoftwareSerial myConnection = SoftwareSerial(rxPort, txPort);
void setup() {
Wire.begin();
Serial.begin(9600);
Serial.println("Initializing I2C devices...");
accelgyro.initialize();
Serial.println("Testing device connections...");
Serial.println(accelgyro.testConnection() ? "MPU9250 connection successful" : "MPU9250 connection failed");
delay(1000);
myConnection.begin(9600);
}
void loop()
{
myConnection.print(mapX);
myConnection.print(" , ");
myConnection.println(mapY);
////Keyboard.press('a');
}