2740 views|4 replies

295

Posts

0

Resources
The OP
 

【Xingkong Board Python Programming Learning Main Control Board】 2. Power on and Mind+ Graphic Lighting and Music Clock Operation Evaluation [Copy link]

This post was last edited by kit7828 on 2022-11-3 18:44

1. Power on

The board is powered on by connecting it to the computer via a Type-C cable. After powering on, you need to wait for a while and the Linux running records of the character interface will appear in sequence.

Then, stay on the initial main interface of the Xingkong board, that is, the interface waiting for the Home button

After pressing the Home button, the main menu interface appears.

At this point, you can use touch and the A and B buttons to switch menus.

Tested the screen calibration under the app

2. Mind+ starts the first graphical routine

Test and run Mind+ graphical programming, which requires hardware connection

Then, add support for the Xingkong board in the extension. You can refer to my previous review post - unboxing post https://en.eeworld.com/bbs/thread-1223052-1-1.html

In the Mind+ graphical programming interface, by dragging and dropping components, changing characters, numbers, etc., after multiple modifications, the graphic engineering for this evaluation was completed.

After connecting to the Xingkong board, just click the run button on the right to see the effect.

Specific operation effect

For those who are not familiar with Pathon code, it only takes about 1-2 hours to complete such an interface, thanks to the charm of graphical programming. (It feels like it can be freed from the limitations of specific programming languages, which is very nice)

3. Code and operation log

The background automatically generates Pathon code and log information during operation

The specific code is

#  -*- coding: UTF-8 -*-

# MindPlus
# Python
from pinpong.extension.unihiker import *
from pinpong.board import Board,Pin
from unihiker import GUI
import time

# 事件回调函数
def on_buttona_click_callback():
    buzzer.play(buzzer.ENTERTAINER,buzzer.Once)
    p_p25_out=Pin(Pin.P25, Pin.OUT)
    p_p25_out.write_digital(1)
    time.sleep(1)
    p_p25_out=Pin(Pin.P25, Pin.OUT)
    p_p25_out.write_digital(0)


u_gui=GUI()
Board().begin()
u_gui.on_a_click(on_buttona_click_callback)
Hour = 10
Min = 0
Sec = 0
u_gui.draw_text(text="你好,行空板",x=40,y=20,font_size=20, color="#0000FF")
u_gui.draw_text(text="By Kit7828",x=110,y=52,font_size=12, color="#0000FF")
clock=u_gui.draw_clock(x=120,y=200,r=50,color="#FF0000")

while True:
    clock.config(h=Hour,m=Min,s=Sec)
    time.sleep(1)
    Sec = (Sec + 1)
    if (Sec > 59):
        Sec = 0
        Min = (Min + 1)
        if (Min > 59):
            Min = 0
            Hour = (Hour + 1)
            if (Hour > 23):
                Hour = 0

Log information during operation


root@unihiker:~/mindplus/cache 项目1、点灯及时钟显示正在上传中,请稍后...
项目上传成功,开始运行
root@unihiker:~/mindplus/cache/1、点灯及时钟显示# access control disabled, clients can connect from any host
root@unihiker:~/mindplus/cache/1、点灯及时钟显示# cd "/root/mindplus/cache/1、点灯及时钟显示"
root@unihiker:~/mindplus/cache/1、点灯及时钟显示# python /root/mindplus/cache/1 、点灯及时钟显示/.cache-file.py

  ___________________________
 |                           |
 |      PinPong v0.4.9       |
 |    Designed by DFRobot    |
 |___________________________|
 
[01] Python3.7.3 Linux-4.4.143-67-rockchip-g01bbbc5d1312-aarch64-with-debian-10.11 Board: UNIHIKER
selected -> board: UNIHIKER serial: /dev/ttyS3
[10] Opening /dev/ttyS3
[32] Firmata ID: 3.3
[22] Arduino compatible device found and connected to /dev/ttyS3
[40] Retrieving analog map...
[42] Auto-discovery complete. Found 30 Digital Pins and 30 Analog Pins
------------------------------
All right. PinPong go...
------------------------------

IV. Video

Please refer to the following video for the effects of button lighting and music playing


5. Conclusion

The charm of graphical programming is indeed very strong. You don’t need to be familiar with the style of a specific programming language, code standards, etc. You don’t need to type code, you just need to focus on the logic, and it is fast and convenient.

What needs to be complained is that runtime errors are often sent in the middle, which is mainly caused by the failure to detect the version information on the Xingkong board. The data cable was plugged and unplugged many times in the middle, and it ran normally after the version was detected.

VI. Suggestions

For clock applications, I personally think that the company should provide graphical components such as timers for precise timing. Timing through pure software should not be able to meet the precise requirements. In addition, for data communication and interaction between threads, I have not found suitable components or suitable reference posts. Perhaps the search scope is not enough.

This post is from Embedded System

Latest reply

Not bad. I'm sick of the whole clock thing with esp32.   Details Published on 2022-11-5 17:53

6555

Posts

0

Resources
2
 

For those who are not familiar with Pathon code, it only takes 1-2 hours to complete such an interface. This is indeed due to the charm of graphical programming.

This post is from Embedded System

Comments

Thanks for the encouragement  Details Published on 2022-11-7 11:22
 
 

6062

Posts

4

Resources
3
 

Not bad. I'm sick of the whole clock thing with esp32.

This post is from Embedded System

Comments

I feel that graphical programming is the trend  Details Published on 2022-11-7 11:22
 
 
 

295

Posts

0

Resources
4
 
damiaa posted on 2022-11-5 17:53 Not bad. I used esp32 to mess around with the whole clock and I was sick of it.

I feel that graphical programming is the trend

This post is from Embedded System
 
 
 

295

Posts

0

Resources
5
 
Jacktang posted on 2022-11-5 09:46 For those who are not familiar with Pathon code, it only takes about 1-2 hours to complete such an interface. This is indeed due to the charm of graphical programming. It is indeed this...

Thanks for the encouragement

This post is from Embedded System
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list