EN

When the Blank Area Shows on STONE TOOLBOX (GUI Design software)

When the blank area shows "Download all files successfully", unplug the USB mini cable from the USB download conversion board, at this time the STONE screen can already move! Now you can touch it (all places can try oh, later can also be connected with the Arduino communication effect for comparison), feel the joy of their own success!

 

DEMO

(DEMO "nine-pane" page displayed on the serial touch screen)

 

Beginners can celebrate and reward themselves for making it this far for the first time, you're great! I believe that to get here successfully, touch, and see the results of victory is by no means something that ordinary people can do in one go! They must have encountered a lot of difficulties and hardened their natures even when they got here!

 

The next step is the use of the Arduino development board and communication with the serial screen, which can be the second step, after digesting the previous and being able to learn by example, then come to the advanced stage. Of course, if you are in a hurry, you can also continue with the following.

 

 

A) Getting the Arduino development board moving.

 

step by step as below.

 

1. connect the computer USB to the Arduino development board with the official USB connection cable included, as follows.

 

(arduino development board connected to the computer USB)

(Arduino development board connected to the computer USB)

 

2. click on the arduino.exe program in the Arduino-1.0.5 directory after unpacking, see Figure 4 above, to start the development interface.

 

3. click on the menu File--->Examples--->01. Basic--->Blink as shown below to read in the routines.

 

screenshot of the arduino platform opening routine

(screenshot of the Arduino platform opening routine)

 

This routine is simple and easy to demonstrate, the LED is ready-made on the board, eliminating the need to build and connect the circuit, and the blinking time is easy to adjust, simple and intuitive. Through this routine, newcomers can learn to open the file, compile, modify, upload, and also familiar with the basic syntax of Arduino, very good! Let the beginner do not have to find components, do not have to wire, you can start directly.

 

4. Here you can modify the delay parameter in the routine to change the time of LED blinking, as follows.

 

arduino main editing interface

(Arduino main editing interface)

 

 

Note: In the Arduino development environment, edit the code to use plain English half-angle entry mode, pay special attention to punctuation, otherwise it may be wrong! Beginners had better use copy and paste to edit, update values and symbols, etc. first!

 

5. click on the button in the orange position in the figure below to check, validate and compile.

 

Compile-time interface

(Compile-time interface)

 

This check, validate, and compile operation can also be done via the menu SKetch--->Verify/Compile. If no error is reported, you can proceed to the next step.

 

6Click the orange button in the picture below to Upload; please check in advance that the Arduino development board is connected to the computer, the USB to serial conversion board has been connected to the DC12V power supply and USB power supply, the blue and green serial cable can be removed.

 

Interface at the time of upload

(Interface at the time of upload)

 

You can also use the menu File --- "upload to achieve the upload operation.

 

7. after doing the above, if no error is reported, you can enjoy your results, enjoy the fun again!  The red LED on the development board is flashing according to your modified parameters! You can modify different blinking parameters, repeat the compilation, upload, and then compare the different effects.

 

At this point, the serial screen has moved, and the development board has moved! The next step is to prepare and program the two communication interactions.

 

 

B) Make the STONE serial screen and the Arduino development board communicate and interact with each other.

 

step by step as follows.

 

1, first look at the serial port baud rate and command word format of the header settings. The following figure.

 

My notes on setting serial port parameter

(My notes on setting serial port parameters)

 

Screen parameter configuration pop-up window of Tool4.3

(Screen parameter configuration pop-up window of STONE TOOL Box,)

 

From the STONE TOOL Box menu item Tool (T), select Screen configuration to bring up the above Screen parameter configuration window. configuration" in the upper part of the window, there are R1, R3, RA, respectively, set the project's serial port baud rate, command format of the head high and low bytes (such as the example of baud rate 115200, R3 = 0xA5, RA = 0x5A). Later we can ensure that their serial port can also be set to follow the product design rate, instruction format head programming! Like the front, we are direct to STONE DEMO compile, download, without any modification, so the following Arduino environment programming, all should be in accordance with STONE DEMO's original baud rate parameters and command word head characters to maintain consistency.

 

2, To the Arduino development board to send data to the serial screen, we can first understand the address of the serial screen variables. Open STONE TOOL Box, click the red arrow at the "0.jpg", "Data Variables" in turn, see the button "Data Variables " link page "2", and then click "2.jpg".

 

stone1

 

On page "2", the following figure, click on the variable data input, the right to see the DataVariables Variables address is 0x0020; ---- to write values to this address, you can see the desired display on this page Oh!

 

STONE TOOL BOX(gui design sofaware)

 

4, repeat the above operation, you can get Word ard on the page "16", its data entry Variables address is 0x0160; Slide Control on the page "18", its Data entry Variables address is 0x0180.

 

5, according to STONE's serial data writing instructions, respectively, to the above three addresses (0x0020, 0x0160, 0x0180) to write the value of 0x0001 instruction format is as follows (including the above access to the header characters A5 5A)

 

A5 5A 05 82 00 20 00 01 (Data Variables write 1)

A5 5A 05 82 01 60 00 01 (Word ard write 1)

A5 5A 05 82 01 80 00 01 (Slide Control write 1)

 

6, according to the Arduino function definition, the above instructions can be written as follows.

 

Serial.write(0xA5); //"A5" is the header character.

            Serial.write(0x5A); //"5A" is the header character.

            Serial.write(0x05);

            Serial.write(0x82);

            Serial.write(0x00); // Address of the data variable

            Serial.write(0x20); // Address of Data Variables

            Serial.write(0x00);

            Serial.write(0x01);

// -----------------------------------------------------------------

            Serial.write(0xA5); // "A5" is the header character

            Serial.write(0x5A); // "5A" is the header character

            Serial.write(0x05);

            Serial.write(0x82);

            Serial.write(0x01); // The address of Word ard

            Serial.write(0x60); // Address of Word ard.

            Serial.write(0x00);

            Serial.write(0x01);

// -------------------------------------------------------------------------

            Serial.write(0xA5); // "A5" is the header character

            Serial.write(0x5A); // "5A" is the header character

            Serial.write(0x05);

            Serial.write(0x82);

            Serial.write(0x01); //address of slide control

            Serial.write(0x80); //address of slide control

            Serial.write(0x00);

            Serial.write(0x01);

 

7, in the Arduino development interface, menu File --- "New, new file frank2.ino, the above three variables address recursive writing (recursive step value can be adjusted within the range specified), the period of 1 second (can be adjusted within the specified range), so it is convenient to see the effect of change. See the recorded video for details.

 

8, you can modify the Arduino program incremental step value, compile again, upload, observe the modified effect.

 

Note: Make sure all the connections are connected correctly as described in "Hardware Connection" above! Here, because the program of Arduino development board is only modified, so the computer USB connects to the Arduino development board, on the one hand, to supply power to the Arduino development board, on the other hand, to update and download the modified Arduino program at any time, while the DC5V power supply from USB to serial converter board should be connected to the DC5V power supply of cell phone charger, rechargeable battery, etc.

 

Recorded video description: video from STONE TOOL Box, open STONE DEMO compilation, download, there are hardware connection, software use, and demonstrate the effect of the touch screen after download (manual touch, including the three pages that need to be compared later --- Data Variables, Word ard, Slide Control), then recorded Arduino development environment compilation, upload, directly using the communication program we prepared (in the example program Blink based on the addition of communication module), this program has, of course, including the code of LED blinking, you can see the LED blinking. There is a video connecting the communication line between the serial screen and Arduino, after connecting the USB to the DC5V power supply of the serial converter board, we can see the data transfer from the Arduino to the serial touch screen. programmed step value in incremental). This completely shows the actions of the serial touch screen, the blinking LEDs of the Arduino board, and the data transfer actions of the Arduino board to the serial touch screen. The video was recorded in about 7 minutes or so. From the video, it is obvious that the computer screen has flickering, but STONE's touch screen STVI056WT-01 does not have a similar flickering phenomenon, is this the technical advantage of STONE? If so, kudos to STONE!

 

I believe this recorded video can make up for the lack of many text descriptions, if there is something in the description that cannot be reviewed, please contact me, thank you!

 

The development board Arduino source code is transcribed as follows.

 

/*

  frank2

  STONE and arduino COMM

  Turns on an LED on for one second, then off for one second, repeatedly.

  The address 0x0020 is ardress of Data Variables;

  The address 0x0160 is ardress of Word art;

  The address 0x0180 is ardress of Slide Control;

 

  This example code is in the file of frank.   On  20210608  shenzhen China

 */

 

// Pin 13 has an LED connected on most Arduino boards.

// give it a name:

int led = 13;

int iData = 1;       // for Data variables

int iSlide = 2;                  // for Slide Control

int iWord = 1;                // for Word ard

// the setup routine runs once when you press reset:

void setup() {               

  // initialize the digital pin as an output.

  pinMode(led, OUTPUT);    

 

  Serial.begin(115200);  // Open the serial communication function and wait for the serial port to open, the baud rate is the same as STONE setting

  while (!Serial) {

    ; // wait for serial port to connect. Needed for Leonardo only

  } 

}

 

// the loop routine runs over and over again forever:

void loop() {

 

            Serial.write(0xA5);       //"A5" is the header character

            Serial.write(0x5A);       //"5A" is the header character

            Serial.write(0x05);

            Serial.write(0x82);                 //Write command

            Serial.write(0x00);     // The address of Data Variables

            Serial.write(0x20);    // The address of Data Variables

            Serial.write(0x00);

            Serial.write(iData);

           

  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(500);               // wait for a half second  Adjustable range:200-2000

             iData+=1;     //Step value of 1, adjustable observation effect Range 1-20

             iSlide+=10;          //Step value of 10, adjustable viewing effect Range 1-20

             iWord+=1;           //Step value of 1, adjustable observation effect Range 1-20

           if(iData>=99)  iData=1;    //Setting change range

           if(iSlide>=230)  iSlide=2;                //Setting change range

           if(iWord==230) iWord=1;                //Setting change range

  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW

  delay(500);               // wait for a half second,Adjustable range:200-2000

 

            Serial.write(0xA5);       //"A5" is the header character 165

            Serial.write(0x5A);       //"5A" is the header character 90

            Serial.write(0x05);

            Serial.write(0x82);          //Write command

            Serial.write(0x01);    // The address of Slide

            Serial.write(0x80);    // The address of Slide

            Serial.write(0x00);

            Serial.write(iSlide);

           

            Serial.write(0xA5);       //"A5" is the header character 165

            Serial.write(0x5A);       //"5A" is the header character 90

            Serial.write(0x05);

            Serial.write(0x82);                 //Write command

            Serial.write(0x01);    // The address of Word art

            Serial.write(0x60);    // The address of Word art

            Serial.write(0x00);

            Serial.write(iWord);          

}