• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

LED Slider

Q&A Forum › Category: Arduino › LED Slider
0 Vote Up Vote Down
KONSTANTINOS MAVRIDIS asked 2 years ago

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?

Question Tags: App Inventor2
9 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
do you get any errors?
Can you provide more details?
Did the other projects work well by sending the values?
Regards,
Sara

0 Vote Up Vote Down
KONSTANTINOS MAVRIDIS answered 2 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

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

0 Vote Up Vote Down
KONSTANTINOS MAVRIDIS answered 2 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

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

0 Vote Up Vote Down
KONSTANTINOS MAVRIDIS answered 2 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Everything seems fine.
Does the LED image/color on the app change when you move the slider?
 
Regards,
Sara

0 Vote Up Vote Down
KONSTANTINOS MAVRIDIS answered 2 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great!
I’m glad you found the issue.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.