Arduino två tusen nio mega
I use Visual Studio Serial ports 1, 2, 3 are just used via the pins on the board. You need to post your code, describe what you really want to do, and post a diagramme. For starters, pin 18 is Serial1, but why don't you use a standard USB cable like everybody else does? Much the same can be said for Visual Studio. There may well be "experts" around who are disdainful of anything else, but they don't include you, and mere mortals get by with the standard IDE to programme a Mega just fine.
Check the "getting started". The Arduino IDE is free. I build a Gui with C Code.
I want to use the Serialport 2 to communicate with the Gui while using Serialport from Usb to communicate with my Visual Studio Debugger. In the setup routine i use the begin function with the value for both. What i get are numbers which dont make sense. Have a look at the examples in Serial Input Basics - simple reliable non-blocking ways to receive data.
I have no problem with receive the data. Maybe I misunderstood your answer. If i send 1 from Gui via COM4 to arduino i receive If i send 10 i get I have really no clue what happen to this serial adapter. I ordered an other one No surprise there.
Arduino Mega 2560 Rev3
It almost souns like it isnt possible at all Is it possible that i didnt understand the basic of this kind of communication? First, the COM ports imply the serial ports on Windows. It is smart enough to assign the same port every time you plug it in. You probably could force Windows to assign it to another port. I have no idea of how you would do that and, much more to the point, no idea of why you would want to.
Perhaps you might explain that, but don't waste too much time on it.
Arduino Mega Tutorial – Pinout & Schematics
No exceptions. This is shared with pins 0,1. This is not only very possible, but also a lot simpler than you think it is. It could be that what you really want to do is beyond Mega's ability, but your post is so incoherent that that is just a guess, and I suspect it is rather more likely that you are simply on the wrong tram, and it will come out OK in the end. One thing you might do though, is refrain from buying any more of those cables until you know what you are doing.
Ultimate Guide to Arduino Mega 2560 Pinout, Specs & Schematic
I would start by using software that is basically known to work; that will exclude problems in your C code. Start both serial monitor and the other terminal program. Whatever you type in serial monitor should show in the other terminal program and vice versa. I've just tested it with the above program and it works. Once you have that working, you can work on your C code.
Be accurate, "or something" is not accurate. And this statement does not say what you did; if you tried to upload code via COM4, that will never work you can only upload via the USB port on the board. Now it works as it should. Debug and use my app at the same time. But one problem left. I can only receive 32 Byte at ones on my C App.