论文部分内容阅读
摘 要:在创客教育理念和人工智能共同的推动下,中小学信息技术教学计划逐渐增加编程素养的训练内容。作为课程指导老师,如何与时俱进地为课堂引进新技术成了亟待解决的难题。该文主要研究图形化编程软件Mixly图形块转换为C语言源码的基本原理,以及通过分析官方库文件,总结智能器件第三方库五步开发步骤:第一,定义第三方库及图形块的基本信息;第二,定义图形块的样式;第三,可编程芯片驱动程序设计;第四,实现图形块转换成C语言;第五,导入Mixly开发平台。
关键词:图形化编程 Arduino Mixly 单片机教学
中图分类号:TP319 文献标识码:A文章编号:1672-3791(2021)05(c)-0043-05
Research and Implementation of the Third Party Library Based on the Graphical Programming Platform Mixly
YU Peng
(Guangxi Vocational & Technical Institute of Industry, Nanning, Guangxi Zhuang Autonomous Region, 530000 China)
Abstract: Under the joint promotion of maker education concept and artificial intelligence, the training content of programming literacy is gradually increased in the information technology teaching plan of primary and secondary schools. As a course instructor, how to keep pace with the times for the classroom to introduce new technology has become a problem to be solved. This paper mainly studies the basic principle of graphics programming software Mixly graphics block into C language source code, and summarizes the five steps of the third-party library development of intelligent devices by analyzing the official library files: First, the basic information of the third-party library and the graph block is defined; Secondly, the style of the graph block is defined; Third, the driver design of programmable chip; Fourth, realize the conversion of graph block into C language; Fifth, import the Mixly development platform.
Key Words: Graphic programming; Arduino; Mixly; MCU teaching
随着新技术的发展和创客教育理念的普及,中小学信息技术课在国家政策的引导下逐渐增加编程素养的训练内容。然而,微控制器传统的编程模式还是基于国外微处理器开发平台以及C语言,甚至汇编语言等程序设计语言,这对中高职层次以上的学生也是一道不低的门槛[1]。教育技术研究团队另辟途径,以谷歌、麻省理工学院开源图形化编程工具为内核,二次开发适合国内青少年思维习惯的图形化编程软件,这些软件将一条条深奥的指令、函数、器件功能变换成图形块,青少年创客用类似搭建乐高积木的方式,通过拖拽图形块实现创意设计。这种设计理念有效降低了技术门槛,节约了开发者学习时间,让青少年创客可以更专注于创意设计的实现[2]。
目前,图形化编程工具领域主要分为两大流派,即麻省理工学院的Scratch和谷歌的Blockly。北京师范大学傅骞团队以Blockly为内核引擎,开发了Mixly图形化编程软件,该软件支持以Arduino为主控板的图形化编程,特别适合没有编程基础的初学者;该软件也支持厂商或者有一定编程基础的开发者开发电子器件第三方库文件,这项功能极大地拓展了Mixly器件的普适性[3],该文主要研究Mixly第三方库的实现方案。
1 Mixly第三方库的实现方案
Mixly的生态系统是傅骞开发团队最重要的设计理念。Mixly实现图形化编程的基本原理是把图形块对应的程序转化成C语言,再通过Arduino IDE下载至Arduino微处理器。笔者通过分析官方库文件,总结了五步開发过程:第一,定义第三方库及图形块的基本信息;第二,定义图形块的样式;第三,驱动程序设计;第四,实现图形块转换成C语言;第五,导入Mixly。下面以四位一体数码管显示模块为例,介绍该模块第三方库的开发过程。
1.1 定义第三方库及图形块的基本信息
关键词:图形化编程 Arduino Mixly 单片机教学
中图分类号:TP319 文献标识码:A文章编号:1672-3791(2021)05(c)-0043-05
Research and Implementation of the Third Party Library Based on the Graphical Programming Platform Mixly
YU Peng
(Guangxi Vocational & Technical Institute of Industry, Nanning, Guangxi Zhuang Autonomous Region, 530000 China)
Abstract: Under the joint promotion of maker education concept and artificial intelligence, the training content of programming literacy is gradually increased in the information technology teaching plan of primary and secondary schools. As a course instructor, how to keep pace with the times for the classroom to introduce new technology has become a problem to be solved. This paper mainly studies the basic principle of graphics programming software Mixly graphics block into C language source code, and summarizes the five steps of the third-party library development of intelligent devices by analyzing the official library files: First, the basic information of the third-party library and the graph block is defined; Secondly, the style of the graph block is defined; Third, the driver design of programmable chip; Fourth, realize the conversion of graph block into C language; Fifth, import the Mixly development platform.
Key Words: Graphic programming; Arduino; Mixly; MCU teaching
随着新技术的发展和创客教育理念的普及,中小学信息技术课在国家政策的引导下逐渐增加编程素养的训练内容。然而,微控制器传统的编程模式还是基于国外微处理器开发平台以及C语言,甚至汇编语言等程序设计语言,这对中高职层次以上的学生也是一道不低的门槛[1]。教育技术研究团队另辟途径,以谷歌、麻省理工学院开源图形化编程工具为内核,二次开发适合国内青少年思维习惯的图形化编程软件,这些软件将一条条深奥的指令、函数、器件功能变换成图形块,青少年创客用类似搭建乐高积木的方式,通过拖拽图形块实现创意设计。这种设计理念有效降低了技术门槛,节约了开发者学习时间,让青少年创客可以更专注于创意设计的实现[2]。
目前,图形化编程工具领域主要分为两大流派,即麻省理工学院的Scratch和谷歌的Blockly。北京师范大学傅骞团队以Blockly为内核引擎,开发了Mixly图形化编程软件,该软件支持以Arduino为主控板的图形化编程,特别适合没有编程基础的初学者;该软件也支持厂商或者有一定编程基础的开发者开发电子器件第三方库文件,这项功能极大地拓展了Mixly器件的普适性[3],该文主要研究Mixly第三方库的实现方案。
1 Mixly第三方库的实现方案
Mixly的生态系统是傅骞开发团队最重要的设计理念。Mixly实现图形化编程的基本原理是把图形块对应的程序转化成C语言,再通过Arduino IDE下载至Arduino微处理器。笔者通过分析官方库文件,总结了五步開发过程:第一,定义第三方库及图形块的基本信息;第二,定义图形块的样式;第三,驱动程序设计;第四,实现图形块转换成C语言;第五,导入Mixly。下面以四位一体数码管显示模块为例,介绍该模块第三方库的开发过程。
1.1 定义第三方库及图形块的基本信息