Dear Roi, dear friends of the forum, I address to everyone the question regarding the 3rd project “LED Slider” of the book “Android Apps for Arduino with MIT App Inventor 2” in which although I have followed faithfully I have not been able to increase or decrease the intensity of the led. Checking the serial port input I see that the data from the command block “call arduinoBluetoothClient.Send1ByteNumber number round get thumbPosition” is not arriving. Can you suggest any solution to this deadlock?
Hi.
do you get any errors?
Can you provide more details?
Did the other projects work well by sending the values?
Regards,
Sara
Hi Sara,
Thanks for the prompt response to my question.
No, I haven’t done anything wrong at all. The other projects worked fine.
I am struck by the fact that checking the function serial.available() returns 0
If you want, take a quick look at a simplified version of the program with which I check the data input from the application on my mobile;
int ledPin = 6;
int pwmValue;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
analogWrite(ledPin, LOW);
}
void loop() {
if (mySerial.available() > 0) {
pwmValue = Serial.read();
Serial.println(pwmValue);
analogWrite(ledPin, pwmValue);
}
Serial.println(pwmValue);
}
The output of myserial is always 0
It means that it probably is not receiving any data.
Did you double-chek the blocks of your application?
Does the application throw any errors?
Regards,
Sara
I have tried both, your application and the one from the link
Both of them don’t throws errors, but the led refuses to comply with the program:) Please show me the output from your Arduino’s serial. Mine is zero!!!
Best Regards
Kostas
Hi.
I only had the time to take a look at the code today.
The code is not supposed to print anything, because we don’t have any instructions to print on the Serial monitor.
Can you show me the blocks on your application?
To share a picture, upload it to google drive, imgur or dropbox and share a link to the file.
Just want to let you know that the website you mentioned, copies and stoles almost all our website content and changes it slightly to make it look original.
Regards,
Sara
Dear Sara and Rui, I’m back again after a few days absence due to commitments. I am back with the same question regarding the 3rd project of your book. Specifically, while I have copied and pasted both the project code for the arduino and the MIT appInventor, and implemented the circuit correctly (I have quite a bit of experience with it), the project refuses to work. I am also sending you the link to the dropbox as you suggested me, so you can see that there is no mistake on my part. I should also mention that I have implemented the 2 previous projects which respond correctly. The link in the dropbox is:
https://www.dropbox.com/sc/owil4c8pbam1jml/AACxdFt_dxXX4ihgREby_oYxa
I look forward to your comments.
Best wishes Kostas
Hi.
Everything seems fine.
Does the LED image/color on the app change when you move the slider?
Regards,
Sara
Dear Sara and Rui Hi. I am happy to announce that the project finally worked. The problem was not in the code, nor in wrong wiring, but in hardware failure. Specifically, inside the breadboard, the anode and cathode terminals of the led were short-circuited, as a result of which the photodiode did not light up at all. But what struck me and troubled me was that the serial output on the Arduino was always 0 and that’s why I thought something was wrong. But finally good, all is well, so I continue with the next projects. Thank you very much for your interest and support and I hope you continue to be creative for the benefit of electronics hobbyists. Many congratulations on the work you are producing. With sincere regards, Kostas