Code Monkey home page Code Monkey logo

quini27 / controlarduino- Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 3.0 3.09 MB

The program ControlArduino is a program developed in the IDE RAD Studio Tokio 10.2. It let you control an Arduino board through a user-friendly interface that allows you to configure the digital pins as digital inputs, digital outputs or PWM outputs. After configuration, the HMI shows the state of the digital and analog inputs as well as it allows set the state of the digital and PWM outputs.

Pascal 99.80% C++ 0.20%
arduino-sketch arduino-controller delphi-ide

controlarduino-'s Introduction

controlArduino-

The program ControlArduino is a program developed in the IDE RAD Studio Tokio 10.2. It let you control an Arduino board through a user-friendly interface that allows you to configure the digital pins as digital inputs, digital outputs or PWM outputs. After configuration, the HMI shows the state of the digital and analog inputs as well as allows set the state of the digital and PWM outputs.

Before using this program, the sketch delphicontrol3.ino must be downloaded on the Arduino board. This sketch receives and sends information trhough the serial port stated at 9600 baud rate, 8 bits legth data, 1 stop bit, no parity. At the beginning, it waits for commands to state the pins as digital inputs or outputs. In the loop routine it sends a string Ti.Tj.Tk.U0..U1..U2..U3..U4..U5..Z where i,j,k are the numbers of pin set as inputs, . is the state of the input: 0 or 1, in Ua, a is the number of analog input (0 to 5), and .. is the value of the analog input.

A SerialEvent function completes the sketch. This function receives a character between 'A' and 'X', that indicates the number of digital output and its state, they are defined by the calculation (int((char+1) / 2)-31 , char % 2). If a character 'Y' is sent, another two bytes are expected, the first one indicates the number of PWM output and the second one its state, between 0 and 255.

The ControlArduino program is based on the use of the ComPort components, developed by Dejan Crnila, which serve to communicate the program via USB port. These components can be downloaded from https://sourceforge.net/projects/comport/files/ and they must be previously installed in the Delphi IDE in order to open and compile the source files. Otherwise the executable file for Windows controlArduino.exe can be run directly. This program allows to configure the USB port to state the communication with the Arduino board, to begin the communication, to configure the digital pins as digital inputas, digital outuputs or PWM outputs and to close the connection. During the execution of this file, users can see the state of the inputs as well as to write on the outputs. A memolog windows reports the received string and the state of the connection.

Following the phlosophy of this program, it is easy to implement a control strategy in the computer to control a plant, using the Arduino board as a simple input/output interface.

IHM

controlarduino-'s People

Contributors

quini27 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.