hi guys
i use thisapplication in my smartphone:
and in my arduino i use this code:
const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;
void setup() {
// initialize serial:
Serial.begin(9600);
// make the pins outputs:
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
// if there's any serial available, read it:
if (Serial.available() > 0)
{
int red = Serial.parseInt();
analogWrite(redPin, red);
analogWrite(greenPin, 0);
analogWrite(bluePin, 0);
}
Serial.println(Serial.parseInt());
delay(100);
}
i get never 1,2,3,4,5,6,7,8,9,10,11,12,13..................,255
somtimes i get 10 or 100 or 240... but never 1,2,3,4,5,6,7,8,9,10,11,12,13..................,255 with my bluetooth HC-05
what ill change in my arduino code ? thanks