1 Star 0 Fork 19

liuxileon/Geek_Lite_Board

forked from GeekROS/Geek_Lite_Board 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.json 44.15 KB
一键复制 编辑 原始数据 按行查看 历史
GeekROS 提交于 2022-03-18 19:13 . 2.0.0
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
{
"version": "2.0.0",
"hardware": {
"status": true,
"build": "gcc"
},
"software": {
"status": true,
"build": "python",
"package": [
{
"name": "websocket-client",
"version": "0.48.0"
},
{
"name": "requests",
"version": ""
},
{
"name": "pyserial",
"version": ""
},
{
"name": "numpy",
"version": ""
},
{
"name": "opencv-python",
"version": ""
}
]
},
"blocks": {
"status": true
},
"guide": [
{
"id": "basic",
"title": "基础",
"colours": {
"primary": "#58C0A6"
},
"blocks": [
{
"name": "board_open",
"disabled": false,
"function": {
"message0": "设置开发板串口地址为%1",
"args0": [
{
"type": "input_value",
"name": "port_data",
"check": "String",
"default": "/dev/ttyACM0"
}
]
},
"code": "geek.board.init({port_data})\n",
"tips": {
"python": {
"label": "geek.board.init(port:string)",
"kind": "function",
"insertText": "geek.board.init(${1:port})",
"detail": "设置串口地址,port为字符串类型的串口地址或端口"
}
}
},
{
"name": "board_version",
"disabled": false,
"function": {
"message0": "开发板版本信息",
"args0": [],
"output": "String"
},
"code": "geek.board.version.get_version()",
"tips": {
"python": {
"label": "geek.board.version.get_version()",
"kind": "variable",
"insertText": "geek.board.version.get_version()",
"detail": "获取开发板版本信息"
},
"hardware": {
"label": "Board_Version()",
"kind": "variable",
"insertText": "char version = Board_Version()",
"detail": "获取开发板版本信息"
}
}
},
{
"name": "time_state",
"disabled": false,
"function": {
"message0": "设置计时器状态为%1",
"args0": [
{
"type": "field_down",
"name": "time_state",
"check": "String",
"options":[
[
"开始",
"start"
],
[
"暂停",
"pause"
],
[
"结束",
"end"
]
]
}
]
},
"code": "geek.common.time.set_state({time_state})\n",
"tips": {
"python": {
"label": "geek.common.time.set_state(state:string)",
"kind": "function",
"insertText": "geek.common.time.set_state(${1:state})",
"detail": "设置计时器状态:start|pause|end"
}
}
},
{
"name": "time_data",
"disabled": false,
"function": {
"message0": "当前计时器数值",
"args0": [],
"output": "Number"
},
"code": "geek.common.time.millisecond",
"tips": {
"python": {
"label": "geek.common.time.millisecond",
"kind": "function",
"insertText": "geek.common.time.millisecond",
"detail": "获取当前计时器数值"
}
}
},
{
"name": "log_string",
"disabled": false,
"function": {
"message0": "输出日志%1",
"args0": [
{
"type": "input_value",
"name": "content",
"check": "String",
"default": "日志内容"
}
]
},
"code": "geek.common.socket.log({content})\n",
"tips": {
"python": {
"label": "geek.common.socket.log(content:string)",
"kind": "function",
"insertText": "geek.common.socket.log(${1:content})",
"detail": "输出字符串日志,content为字符串类型"
}
}
},
{
"name": "log_number",
"disabled": false,
"function": {
"message0": "输出日志%1",
"args0": [
{
"type": "input_value",
"name": "content",
"check": "Number",
"default": 0,
"precision": 0.001
}
]
},
"code": "geek.common.socket.log({content})\n",
"tips": {
"python": {
"label": "geek.common.socket.log(content:string)",
"kind": "function",
"insertText": "geek.common.socket.log(${1:content})",
"detail": "输出数字日志,content为数字类型"
}
}
}
]
},
{
"id": "adc_power",
"title": "ADC电源",
"colours": {
"primary": "#F56C6C"
},
"blocks": [
{
"name": "power_state",
"disabled": false,
"function": {
"message0": "设置%1电源通道%2状态为%3",
"args0": [
{
"type": "field_down",
"name": "channel",
"check": "Number",
"options": [
[
"5v",
"5"
],
[
"24v",
"24"
]
]
},
{
"type": "field_down",
"name": "id",
"check": "Number",
"options": [
[
"所有通道",
"0"
],
[
"通道一",
"1"
],
[
"通道二",
"2"
],
[
"通道三",
"3"
],
[
"通道四",
"4"
]
]
},
{
"type": "field_down",
"name": "state",
"check": "String",
"options": [
[
"打开",
"on"
],
[
"关闭",
"off"
]
]
}
]
},
"code": "geek.board.power.set_state({channel}, {id}, {state})\n",
"tips": {
"python": {
"label": "geek.board.power.set_state(channel:int, id:int, state:string)",
"kind": "function",
"insertText": "geek.board.power.set_state(${1:channel}, ${2:id}, ${3:state})",
"detail": "可控电源状态控制,channel为电源通道:5|24,id为ID:1-4,state为状态:on|off"
},
"hardware": {
"label": "Power_State(channel:int, id:int, state:char)",
"kind": "function",
"insertText": "Power_State(${1:channel}, ${2:id}, ${3:state})",
"detail": "可控电源状态控制,channel为电源通道:5|24,id为ID:1-4,state为状态:on|off"
}
}
},
{
"name": "set_low_voltage",
"disabled": false,
"function": {
"message0": "设置电压报警阈值为%1",
"args0": [
{
"type": "input_value",
"name": "voltage",
"check": "Number",
"default": 0,
"min": 0,
"max": 24,
"precision": 0.001
}
]
},
"code": "geek.board.adc.set_low_voltage({voltage})\n",
"tips": {
"python": {
"label": "geek.board.adc.set_low_voltage(voltage:float)",
"kind": "function",
"insertText": "geek.board.adc.set_low_voltage(${1:voltage})",
"detail": "设置电压报警阈值,voltage为低电压报警值,数字类型"
},
"hardware": {
"label": "Adc_Low_Voltage(voltage:float)",
"kind": "function",
"insertText": "Adc_Low_Voltage(${1:voltage})",
"detail": "设置电压报警阈值,voltage为低电压报警值,数字类型"
}
}
},
{
"name": "read_board_voltage",
"disabled": false,
"function": {
"message0": "读取开发板电压",
"args0": []
},
"code": "geek.board.adc.get_board_voltage()\n",
"tips": {
"python": {
"label": "geek.board.adc.get_board_voltage()",
"kind": "function",
"insertText": "geek.board.adc.get_board_voltage()",
"detail": "读取开发板电压"
},
"hardware": {
"label": "Adc_Board_Voltage()",
"kind": "function",
"insertText": "float board_voltage = Adc_Board_Voltage()",
"detail": "读取开发板电压"
}
}
},
{
"name": "board_voltage",
"disabled": false,
"function": {
"message0": "当前开发板电压值",
"args0": [],
"output": "Number"
},
"code": "geek.board.adc.voltage",
"tips": {
"python": {
"label": "geek.board.adc.voltage",
"kind": "variable",
"insertText": "geek.board.adc.voltage",
"detail": "当前开发板电压"
}
}
},
{
"name": "read_pwm_voltage",
"disabled": false,
"function": {
"message0": "当前开发板PWM电压",
"args0": []
},
"code": "geek.board.adc.get_pwm_voltage()\n",
"tips": {
"python": {
"label": "geek.board.adc.get_pwm_voltage()",
"kind": "function",
"insertText": "geek.board.adc.get_pwm_voltage()",
"detail": "当前开发板PWM电压"
},
"hardware": {
"label": "Adc_Pwm_Voltage()",
"kind": "function",
"insertText": "float pwm_voltage = Adc_Pwm_Voltage()",
"detail": "读取开发板PWM电压"
}
}
},
{
"name": "pwm_voltage",
"disabled": false,
"function": {
"message0": "当前开发板PWM电压值",
"args0": [],
"output": "Number"
},
"code": "geek.board.adc.pwm_voltage",
"tips": {
"python": {
"label": "geek.board.adc.pwm_voltage",
"kind": "variable",
"insertText": "geek.board.adc.pwm_voltage",
"detail": "当前开发板PWM电压"
}
}
},
{
"name": "read_cpu_temperature",
"disabled": false,
"function": {
"message0": "读取开发板芯片温度",
"args0": []
},
"code": "geek.board.cpu.get_temperature()\n",
"tips": {
"python": {
"label": "geek.board.cpu.get_temperature()",
"kind": "function",
"insertText": "geek.board.cpu.get_temperature()",
"detail": "读取开发板芯片温度"
},
"hardware": {
"label": "Cpu_Temperature()",
"kind": "function",
"insertText": "float temperature = Cpu_Temperature()",
"detail": "读取开发板芯片温度"
}
}
},
{
"name": "cpu_temperature",
"disabled": false,
"function": {
"message0": "当前开发板CPU温度值",
"args0": [],
"output": "Number"
},
"code": "geek.board.cpu.temperature",
"tips": {
"python": {
"label": "geek.board.cpu.temperature",
"kind": "variable",
"insertText": "geek.board.cpu.temperature",
"detail": "当前开发板CPU温度值"
}
}
}
]
},
{
"id": "led",
"title": "LED灯效",
"colours": {
"primary": "#F19D38"
},
"blocks": [
{
"name": "set_led_state",
"disabled": false,
"function": {
"message0": "设置%1灯的状态为%2",
"args0": [
{
"type": "field_down",
"name": "channel",
"check": "String",
"options": [
[
"全部",
"all"
],
[
"绿色",
"green"
],
[
"红色",
"red"
],
[
"蓝色",
"blue"
]
]
},
{
"type": "field_down",
"name": "state",
"check": "String",
"options": [
[
"打开",
"on"
],
[
"关闭",
"off"
],
[
"状态翻转",
"switch"
]
]
}
]
},
"code": "geek.board.led.set_state({channel}, {state})\n",
"tips": {
"python": {
"label": "geek.board.led.set_state(channel:string, state:string)",
"kind": "function",
"insertText": "geek.board.led.set_state(${1:channel}, ${2:state})",
"detail": "设置LED灯状态,channel为通道:green|red|blue,state为状态:off|on|switch"
},
"hardware": {
"label": "Led_State(channel:char, state:char)",
"kind": "function",
"insertText": "Led_State(${1:channel}, ${2:state})",
"detail": "设置LED灯状态,channel为通道:green|red|blue,state为状态:off|on|switch"
}
}
}
]
},
{
"id": "key",
"title": "KEY按键",
"colours": {
"primary": "#E05788"
},
"blocks": [
{
"name": "read_key_state",
"disabled": false,
"function": {
"message0": "读取自定义按键状态",
"args0": []
},
"code": "geek.board.key.get_state()\n",
"tips": {
"python": {
"label": "geek.board.key.get_state()",
"kind": "function",
"insertText": "geek.board.key.get_state()",
"detail": "读取自定义按键状态"
}
}
},
{
"name": "key_state",
"disabled": false,
"function": {
"message0": "当前自定义按键状态",
"args0": [],
"output": "Number"
},
"code": "geek.board.key.key_state",
"tips": {
"python": {
"label": "geek.board.key.key_state",
"kind": "function",
"insertText": "geek.board.key.key_state",
"detail": "当前自定义按键状态:0为抬起,1为按下"
},
"hardware": {
"label": "Key_State",
"kind": "variable",
"insertText": "int key_state = Key_State",
"detail": "当前自定义按键状态:0为抬起,1为按下"
}
}
},
{
"name": "key_event",
"disabled": false,
"function": {
"message0": "当自定义按键状态为%1时",
"args0": [
{
"type": "field_down",
"name": "state",
"check": "Number",
"options": [
[
"按下",
"1"
],
[
"抬起",
"0"
]
]
}
],
"message1": "%1",
"args1": [
{
"type": "input_statement",
"name": "SUBSTACK"
}
],
"shapeType": "event"
},
"code": "def key_state_{state}_event(geek):\n{code}\n",
"tips": {
"python": {
"label": "key_state_event",
"kind": "function",
"insertText": "def key_state_${1:state}_event(geek):\npass\n",
"detail": "监听KEY自定义按键状态事件,state设置为0、1触发不同状态的事件"
}
}
}
]
},
{
"id": "io",
"title": "IO控制",
"colours": {
"primary": "#64C7DE"
},
"blocks": [
{
"name": "io_mode",
"disabled": false,
"function": {
"message0": "设置IO通道%1模式为%2",
"args0": [
{
"type": "field_down",
"name": "channel",
"check": "Number",
"options": [
[
"通道一",
"1"
],
[
"通道二",
"2"
],
[
"通道三",
"3"
],
[
"通道四",
"4"
],
[
"通道五",
"5"
],
[
"通道六",
"6"
],
[
"通道七",
"7"
],
[
"通道八",
"8"
],
[
"通道九",
"9"
],
[
"通道十",
"10"
],
[
"通道十一",
"11"
],
[
"通道十二",
"12"
],
[
"通道十三",
"13"
],
[
"通道十四",
"14"
],
[
"通道十五",
"15"
],
[
"通道十六",
"16"
],
[
"通道十七",
"17"
],
[
"通道十八",
"18"
]
]
},
{
"type": "field_down",
"name": "mode",
"check": "String",
"options": [
[
"输入模式",
"in"
],
[
"输出模式",
"out"
]
]
}
]
},
"code": "geek.board.io.set_mode({channel}, {mode})\n",
"tips": {
"python": {
"label": "geek.board.io.set_mode(channel:int, mode:string)",
"kind": "function",
"insertText": "geek.board.io.set_mode(${1:channel}, ${2:mode})",
"detail": "设置IO模式,channel为通道:1-18,mode为模式:in|out"
},
"hardware": {
"label": "Io_Model",
"kind": "funtion",
"insertText": "Io_Model(${1:channel}, ${2:mode})",
"detail": "设置IO模式,channel为通道:1-18,mode为模式:in|out"
}
}
},
{
"name": "io_state",
"disabled": false,
"function": {
"message0": "设置IO通道%1状态为%2",
"args0": [
{
"type": "field_down",
"name": "channel",
"check": "Number",
"options": [
[
"通道一",
"1"
],
[
"通道二",
"2"
],
[
"通道三",
"3"
],
[
"通道四",
"4"
],
[
"通道五",
"5"
],
[
"通道六",
"6"
],
[
"通道七",
"7"
],
[
"通道八",
"8"
],
[
"通道九",
"9"
],
[
"通道十",
"10"
],
[
"通道十一",
"11"
],
[
"通道十二",
"12"
],
[
"通道十三",
"13"
],
[
"通道十四",
"14"
],
[
"通道十五",
"15"
],
[
"通道十六",
"16"
],
[
"通道十七",
"17"
],
[
"通道十八",
"18"
]
]
},
{
"type": "field_down",
"name": "state",
"check": "String",
"options": [
[
"高电平",
"high"
],
[
"低电平",
"low"
],
[
"状态反转",
"switch"
]
]
}
]
},
"code": "geek.board.io.set_state({channel}, {state})\n",
"tips": {
"python": {
"label": "geek.board.io.set_state(channel:int, state:string)",
"kind": "function",
"insertText": "geek.board.io.set_state(${1:channel}, ${2:state})",
"detail": "设置IO模式,channel为通道:1-18,state为模式:high|low|switch"
},
"hardware": {
"label": "Io_State",
"kind": "funtion",
"insertText": "Io_State(${1:channel}, ${2:state})",
"detail": "设置IO模式,channel为通道:1-18,state为模式:high|low|switch"
}
}
}
]
},
{
"id": "pwm",
"title": "PWM控制",
"colours": {
"primary": "#E04C41"
},
"blocks": [
{
"name": "pwm_control",
"disabled": false,
"function": {
"message0": "设置%1频率为%2脉宽为%3",
"args0": [
{
"type": "field_down",
"name": "channel",
"check": "Number",
"options": [
[
"所有通道",
"0"
],
[
"通道一",
"1"
],
[
"通道二",
"2"
],
[
"通道三",
"3"
],
[
"通道四",
"4"
],
[
"通道五",
"5"
],
[
"通道六",
"6"
],
[
"通道七",
"7"
],
[
"通道八",
"8"
],
[
"通道九",
"9"
],
[
"通道十",
"10"
],
[
"通道十一",
"11"
],
[
"通道十二",
"12"
],
[
"通道十三",
"13"
],
[
"通道十四",
"14"
],
[
"通道十五",
"15"
],
[
"通道十六",
"16"
]
]
},
{
"type": "input_value",
"name": "rate",
"check": "Number"
},
{
"type": "input_value",
"name": "width",
"check": "Number"
}
]
},
"code": "geek.board.pwm.pwm_control({channel}, {rate}, {width})\n",
"tips": {
"python": {
"label": "geek.board.pwm.pwm_control(channel:int, rate:int, width:int)",
"kind": "function",
"insertText": "geek.board.pwm.pwm_control(${1:channel}, ${2:rate}, ${2:width})",
"detail": "PWN控制,channel为通道:0-16,rate为分辨率,width为脉宽"
},
"hardware": {
"label": "Pwm_Motion(channel:int, rate:int, width:int)",
"kind": "function",
"insertText": "Pwm_Motion(${1:channel}, ${2:rate}, ${2:width})",
"detail": "PWN控制,channel为通道:0-16,rate为分辨率,width为脉宽"
}
}
}
]
},
{
"id": "sensor",
"title": "传感器",
"colours": {
"primary": "#F5C343"
},
"blocks": [
{
"name": "read_mpu_data",
"disabled": false,
"function": {
"message0": "读取MPU传感器数据",
"args0": []
},
"code": "geek.board.mpu.read_data()\n",
"tips": {
"python": {
"label": "geek.board.mpu.read_data()",
"kind": "function",
"insertText": "geek.board.mpu.read_data()",
"detail": "读取MPU传感器数据"
}
}
},
{
"name": "get_mpu_data",
"disabled": false,
"function": {
"message0": "当前MPU的%1数据",
"args0": [
{
"type": "field_down",
"name": "data",
"check": "String",
"options": [
[
"pitch轴姿态",
"pit"
],
[
"yaw轴姿态",
"yaw"
],
[
"roll轴姿态",
"rol"
],
[
"环境气温",
"temperature"
],
[
"海拔高度",
"altitude"
],
[
"气压",
"pressure"
]
]
}
],
"output": "Number"
},
"code": "geek.board.mpu.get_data({data})",
"tips": {
"python": {
"label": "geek.board.mpu.get_data(data:string)",
"kind": "variable",
"insertText": "geek.board.mpu.get_data(${1:data})",
"detail": "当前MPU传感器数据,data为要取出的数据:pit|yaw|pol|temperature|altitude|pressure"
},
"hardware": {
"label": "Mpu_Read_Data",
"kind": "variable",
"insertText": "Mpu_Read_Data.${1:data}",
"detail": "当前MPU传感器数据,data为要取出的数据:pit|yaw|pol|temperature|altitude|pressure"
}
}
}
]
}
]
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuxileon/Geek_Lite_Board.git
git@gitee.com:liuxileon/Geek_Lite_Board.git
liuxileon
Geek_Lite_Board
Geek_Lite_Board
master

搜索帮助