You can install the controlP5 library or use G4P builder library using the Processing's library manager. You can check the provided examples and their websites:
You didn't mention what kind of dropdown you are using, cp5 or g4p? When you have problems it helps a lot if you post the current version of your sketch or some example that shows the problem. Otherwise we have to guess what you tried and that might not be very helpful.
I am using CP5 and am trying since morning to list all the COM ports and Baud Speeds and allow user to select and then should connect to that COM port at that Baud.
Your code is barely readable, please format your code, edit post, select code and hit ctrl+o.
It doesn't really make sense to have a list to select the port but set it right away in setup() before you have a chance to select it.
But anyways, you don't need two instances of controlP5, one is enough. Then you could store each controller in a variable and then access it later if needed.
Notice that i changed your variable-names to start with lower-case. That's just a convention to distinguish classes from variables.
You would then have to check if the selected value has changed. Then, if you already have an open serial port you would want to close it and open a new one with the selected parameters.
Answers
You can install the controlP5 library or use G4P builder library using the Processing's library manager. You can check the provided examples and their websites:
http://www.sojamo.de/libraries/controlP5/
http://www.lagers.org.uk/g4p/
Kf
Thank you very much.
Can you advise on how to define Maximum number of visible items when DropDown is clicked. As of now it is showing only one item
You didn't mention what kind of dropdown you are using, cp5 or g4p? When you have problems it helps a lot if you post the current version of your sketch or some example that shows the problem. Otherwise we have to guess what you tried and that might not be very helpful.
Anyways, here is a simple example using cp5:
Sorry, Missed out on that sir. here is the code. I am unable to use the selected Item or default Item set using lstPortList.setvalue(0);
Thanks.
I am using CP5 and am trying since morning to list all the COM ports and Baud Speeds and allow user to select and then should connect to that COM port at that Baud.
Your code is barely readable, please format your code, edit post, select code and hit ctrl+o.
It doesn't really make sense to have a list to select the port but set it right away in setup() before you have a chance to select it.
But anyways, you don't need two instances of controlP5, one is enough. Then you could store each controller in a variable and then access it later if needed.
Example:
Thanks. Code has improved. But need to give option to users to change COM port and Baud. May I request for help on selection change code.
You can use the function "controlEvent()" that is called by all cp5-controllers.
Notice that i changed your variable-names to start with lower-case. That's just a convention to distinguish classes from variables.
You would then have to check if the selected value has changed. Then, if you already have an open serial port you would want to close it and open a new one with the selected parameters.
Thank you so much for all the help.