arduino uno
bbcc
processing with plotter code
linux mint
I have put together the code from the bare bones coffee pid controller and am trying to tune it however if I use an arduino uno and run the processing ide software and the plotter code, when I run th program with the uno it outputs data no problem. If I use the same code on a nano, it fails to output to the plotter software. When you hit the play/start button in the processing software with the uno the graph appears and you can change the PIDs settings while looking at the graph. If the nano is used when you press the play button a gray box appears the same size as the graph but thats it. I am unsure on what to change as the baud rate is correct in both bits of code.
if i connect the nano to the computer and enter the arduino ide i can connect to the serial monitor no problem so it seems to be communicating with the computer
Which nano ? There is also 3.3V version which uses less power and runs at 8MHz instead of 16MH. Is that what you have ? how is it connected and powered ?
As mentioned above when i connect the uno it runs fine when i connect a nano 5v 16mhz via usb the plotter fails to start even with the same program code on each arduino so far i have tried changing the bootloader on the nano to the bootloader used by the uno but i still get the same thing a gray box and the plotter will not start.
If i connect either board to the arduino ide the serial interface woorks fine and i can see what usb has been assigned to the board at that time, but for some reason the plotter software cant find the nano's usb connection even though it is connected and working.
the only thing i have changed is the baud rate to 9600
with the nano is connected the processing ide errors on this line
myPort = new Serial(this, Serial.list()[0], BAUDRATE);
the daudrate is 9600 changed on both the plotter and the bare bones software
the error message from the ide is
Error opening serialport/dev/ttyS0: incorrect serial port
then gives me a list of dev/tty locations including the one it is actually connected to i can see form the arduino ide with the serial monitor closed that the nano is connected on dev/ttyUSB0
When the the error happens as can be seen in the attached pic it prints out the entire list of usb locations,
I plugged in the usb and using the arduino ide i could see it was connected to dev/ttyUSB0 from the list it printed i could see that USB0 was number 32
As you mentioned i changed the number in the
from
myPort = new Serial(this, Serial.list()[0], BAUDRATE);
to
myPort = new Serial(this, Serial.list()[32], BAUDRATE);
on changing the number it came straight up outputting the correct data. seems strange that it completely missed USB0 even tho it was in the list but hay ho it now works a treat.
Thank you so much for everyone input much appreciated.
Jonathanw82:
seems strange that it completely missed USB0 even tho it was in the list
I don't understand why you are surprised. The program does what it is told to do... (The processing program is not being told to try to find an Arduino attached somewhere...)
--> You told the Processing program to use the first entry in the list, so it connects to /dev/ttyS0... if your arduino is not attached there how can you even think this is going to work ?