void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
int c = Serial.parseInt();
float myArray[MY_SIZE];
if(c == 3)
{
for (int i = 0; i < MY_SIZE; i++)
{
myArray = analogRead(Mic);
_ Serial.println(myArray*);_
_ }_
_ //send array here*_ } } Now what i wanna do is, i want to send the filled myArray via my hc05 bluetooth modul to a java/android application that im building. I already thought about doing this by just reading the console-output, but that wouldnt work because i will also print other things later. So how can i just send the filled Array as a whole via my HC05 Bluetooth module? Thanks in advance for any help.
In particular note the advice to Auto format code in the IDE and using code tags when posting code here unless part of your code should actually be in italics
try the following simple program (using an Arduino Due)
// HC-05 Bluetooth module AT commands
// note Serial1 baudrate is 9600
// using Arduino Due (not HC-05 Rx and Tx are 3.3V
// Arduino %V and GND to HC-05 5V and GND
// Arduino pin 18 Tx to HC-05 Rx
// Arduino pin 19 Rx to HC-05 Tx
void setup()
{
Serial.begin(9600);
Serial.println("Enter AT commands:");
Serial1.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
if ( Serial1.available()) // read from HC-05 and send to Arduino Serial Monitor
Serial.write( Serial1.read());
if (Serial.available()) // Keep reading from Arduino Serial Monitor and send to HC-05
Serial1.write(Serial.read());
}
pair the Android with HC-05 and run the Bluetooth Serial app
the app should be able to connect to the HC-05 - text typed on Serial Monitor will appear on Bluetooth Serial and text typed on bluetooth seial should appear on the Serial Monitor
if that works you can start by ammending the code to send your array then write your own app using Android Studio to receive the data
take care if using a 5V Arduio - the HC-05 is a 3.3V device therefore you require a level converter