I want to send string of data from arduino to visual basic 2010. I want that my serial monitor to open automatically when my function starts because it will serial.print text. is there any code in arduino to make serial monitor opens automatically ? Thanks in advance.
Serial monitor happens on your PC. It has nothing to do with the Arduino.
Emsy23:
I want to send string of data from arduino to visual basic 2010. I want that my serial monitor to open automatically when my function starts because it will serial.print text. is there any code in arduino to make serial monitor opens automatically ? Thanks in advance.
There is not. As blh explained, the serial monitor is a function of the Arduino program running on your computer, not on the Arduino microcontroller board. But you are running VB on your computer, so could you not write a program in Basic that echoes any incoming serial data to a window?
When I want to send data from arduino vb6 serial , should i open my serial monitor ?
Emsy23:
When I want to send data from arduino vb6 serial , should i open my serial monitor ?
There is no need to open the Serial monitor when outputting serial data.
so what i should know here is to make visual basic my serial monitor for my arduino right ?
Your VB program needs to open the serial port (and leave it open ***) and read characters sent by the Arduino to that serial port. The VB program can then do what you want with the received characters including printing them and/or taking actions based on what is received.
What is the aim of this project ?
*** Note that when the VB program opens the serial port connected to the Arduino then the Arduino will reset.
my project is about food ordering machine , where orders are strings of data and price are integers. The final step of my project is to send this data to visual basic which is a kitchen server. I also want to change the price of my menus changing it from vb to arduino
Emsy23:
my project is about food ordering machine , where orders are strings of data and price are integers. The final step of my project is to send this data to visual basic which is a kitchen server. I also want to change the price of my menus changing it from vb to arduino
That sounds perfect E23. Arduino easily handles integer math and short (<1000 characters) strings. You'll need some machinations to get the data online, but it's doable. I've got a "time until retirement/decrementing" clock running 24/7 in my office. Arduino has very limited memory - it's made to learn how to control stuff.
An extensive food menu will require external memory capability.
I got here an sd card for data logging . what i need only is to send this strings of data to visual basic.
Emsy23:
I got here an sd card for data logging . what i need only is to send this strings of data to visual basic.
Start simple and get the serial comms working
unsigned int counter = 0;
char buffer[20];
void setup()
{
Serial.begin(115200); //match the baud rate to your VB program
}
void loop()
{
sprintf(buffer, "Counter now : %d", counter); //concatenate the counter with a message
Serial.println(buffer); //send the combined string via serial
counter++;
delay(1000);
}
What do you see in your VB program ?
Do you actually have a VB program ?
Wow thanks for that @UKHeliBob . What i have here is simple code also . that when 1 is input in textbox led will on and vice versa. What i need is when order was done, the strings of food orders will be sent to one box for transaction nmber 1, and if there is another transaction , other box will recieve that orders. can you suggest how to do that ?
Please clarify whether you have got simple serial comms between the Arduino and VB working.
when 1 is input in textbox led will on and vice versa.
You mention a textbox. This sounds like the input is into the VB program on the PC. Where does the Arduino come into it ?
Please provide a simple explanation as to where and how data is entered, where it is transmitted to, if anywhere, and what actions should be carried out as a result of receiving the data and where those actions are carried out.
@UKHeliBob in the final step of my machine , the arduino has strings of orders . after orders are confirmed (this are strings , example string order1 = "PIZZA", it will be send to visual basic by using serialport. i will Serial.print that data to visual basic. Visual basic will just display what it has recieved .
So where are you stuck ?
Im stuck with i want that i have three label box . each box in vb has designated function. first box will contain the first transaction orders let say transaction nmber 1, second box on the second transaction order and so on.
How can i execute that logic statement in vb6. transaction orders are coming from arduino.
How can i execute that logic statement in vb6.
So this is actually a VB programming problem. Is that right ?
YES
UKHeliBob:
So this is actually a VB programming problem. Is that right ?
Emsy23:
YES
Have you tried asking for help on a VB forum ?