Develope an application: Need to Understand Concepts for controlling Arduino.

Hello!

I would like to develop one application to set up Arduino.

It means that it configures all setting of Arduino if I double click the application (exe file).
Specifically, the application makes arduino blink LED using pin 2 and establish TCP connection to predefined server.
Users do not need to run the Arduino IDE and is not able to configure the code inside.

Since now I use Arduino IDE to put codes into microcontoller, I need to understand hardware and low level to make the purpose.

Can you give any idea for the approach?

Thanks

search the forum for the magic word - makefile ...

Arduino IDE uses avrdude application to upload pre-compiled hex file into arduino board.
So your application can do the same: call avrdude from .exe , passing name .hex file and port number as parameters.
Avrdude and hex file have to be located on users PC, or be integrated in .exe file.

This sounds to me more like; arduino has a few predefined routines, PC provides the initiative to run a particular routine and provides parameters to run it with. Are you sure you want to upload a new sketch every time the PC wants to run a new thing? I would use serial port and send command to arduino with parameters like Serial.print("Open 192.168.0.10\n");

Then arduino reads the line, parses it as open command, and with parameters 192, 168, 0, and 10.

Did I understand you correctly?

liudr:
This sounds to me more like; arduino has a few predefined routines, PC provides the initiative to run a particular routine and provides parameters to run it with. Are you sure you want to upload a new sketch every time the PC wants to run a new thing? I would use serial port and send command to arduino with parameters like Serial.print("Open 192.168.0.10\n");

Then arduino reads the line, parses it as open command, and with parameters 192, 168, 0, and 10.

Did I understand you correctly?

Thanks all for your information.

My draft sketch is as follows

  • User double clicks an application (.exe) which has all needed filed to upload sketch to Arduino.
  • The application set up all initiations on Arduino such as IP configuration and activate sensors. I'm assuming that all sensors are already wired to Arduino.
  • Once it is done, there are no reasons to run it again unless changes are needed.

So, a user simply runs the application and then finish all set ups. User does not need to change codes.

That is what I want. Later, I will add a simple GUI to select a few option.

Does each set of your sensor code take tons of code? If not, why not including code for each sensor type in arduino and just tell arduino to activate which sensor type on which pin using serial port? That simplifies the PC software by a lot and is very fast. Uploading sketch is tens of seconds if not minutes, while telling arduino which function to run in an already uploaded sketch takes a very small fraction of a second. I don't see the necessity of uploading code to arduino every time you make a choice, unless each choice corresponds to a set of code too large to share arduino FLASH with other sets of codes so you always have to upload. I hope that was understandable.

liudr:
Does each set of your sensor code take tons of code? If not, why not including code for each sensor type in arduino and just tell arduino to activate which sensor type on which pin using serial port? That simplifies the PC software by a lot and is very fast. Uploading sketch is tens of seconds if not minutes, while telling arduino which function to run in an already uploaded sketch takes a very small fraction of a second. I don't see the necessity of uploading code to arduino every time you make a choice, unless each choice corresponds to a set of code too large to share arduino FLASH with other sets of codes so you always have to upload. I hope that was understandable.

Yes, I think so. I can be a good option. But in this case, it is needed to upload sketch to Arduino first and then make a command to activate each function. If users buy arduino and they do not know how to program it, this option cannot be used.
The application which I'm saying is for the beginner who does not need to know about using Arduino.
After users run the application, your idea can be used for the purposes to activate the sensors.