#include <SoftwareSerial.h>
int in = A0;
SoftwareSerial bt_connection(2, 3); // RX, TX
void setup() {
// initialize the serial communication:
Serial.begin(9600);
bt_connection.begin(9600);
pinMode(in, INPUT);
}
void loop() {
byte val =map(analogRead(in), 0,1024.0, 0, 255);
bt_connection.write(val);
delay(30);
}