代码拉取完成,页面将自动刷新
同步操作将从 GeekROS/Geek_Lite_Board 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
{
"version": "2.0.0",
"hardware": {
"status": true,
"build": "gcc"
},
"software": {
"status": true,
"build": "python"
},
"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": "sdk.board.init({port_data})\n",
"tips": {
"python": {
"label": "sdk.board.init(port:string)",
"kind": "function",
"insertText": "sdk.board.init(${1:port})",
"detail": "设置串口地址,port为字符串类型的串口地址或端口"
}
}
},
{
"name": "board_version",
"disabled": false,
"function": {
"message0": "开发板版本信息",
"args0": [],
"output": "String"
},
"code": "sdk.board.version.get_version()",
"tips": {
"python": {
"label": "sdk.board.version.get_version()",
"kind": "variable",
"insertText": "sdk.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": "sdk.common.time.set_state({time_state})\n",
"tips": {
"python": {
"label": "sdk.common.time.set_state(state:string)",
"kind": "function",
"insertText": "sdk.common.time.set_state(${1:state})",
"detail": "设置计时器状态:start|pause|end"
}
}
},
{
"name": "time_data",
"disabled": false,
"function": {
"message0": "当前计时器数值",
"args0": [],
"output": "Number"
},
"code": "sdk.common.time.millisecond",
"tips": {
"python": {
"label": "sdk.common.time.millisecond",
"kind": "function",
"insertText": "sdk.common.time.millisecond",
"detail": "获取当前计时器数值"
}
}
},
{
"name": "log_string",
"disabled": false,
"function": {
"message0": "输出日志%1",
"args0": [
{
"type": "input_value",
"name": "content",
"check": "String",
"default": "日志内容"
}
]
},
"code": "sdk.common.socket.log({content})\n",
"tips": {
"python": {
"label": "sdk.common.socket.log(content:string)",
"kind": "function",
"insertText": "sdk.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": "sdk.common.socket.log({content})\n",
"tips": {
"python": {
"label": "sdk.common.socket.log(content:string)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.power.set_state({channel}, {id}, {state})\n",
"tips": {
"python": {
"label": "sdk.board.power.set_state(channel:int, id:int, state:string)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.adc.set_low_voltage({voltage})\n",
"tips": {
"python": {
"label": "sdk.board.adc.set_low_voltage(voltage:float)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.adc.get_board_voltage()\n",
"tips": {
"python": {
"label": "sdk.board.adc.get_board_voltage()",
"kind": "function",
"insertText": "sdk.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": "sdk.board.adc.voltage",
"tips": {
"python": {
"label": "sdk.board.adc.voltage",
"kind": "variable",
"insertText": "sdk.board.adc.voltage",
"detail": "当前开发板电压"
}
}
},
{
"name": "read_pwm_voltage",
"disabled": false,
"function": {
"message0": "当前开发板PWM电压",
"args0": []
},
"code": "sdk.board.adc.get_pwm_voltage()\n",
"tips": {
"python": {
"label": "sdk.board.adc.get_pwm_voltage()",
"kind": "function",
"insertText": "sdk.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": "sdk.board.adc.pwm_voltage",
"tips": {
"python": {
"label": "sdk.board.adc.pwm_voltage",
"kind": "variable",
"insertText": "sdk.board.adc.pwm_voltage",
"detail": "当前开发板PWM电压"
}
}
},
{
"name": "read_cpu_temperature",
"disabled": false,
"function": {
"message0": "读取开发板芯片温度",
"args0": []
},
"code": "sdk.board.cpu.get_temperature()\n",
"tips": {
"python": {
"label": "sdk.board.cpu.get_temperature()",
"kind": "function",
"insertText": "sdk.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": "sdk.board.cpu.temperature",
"tips": {
"python": {
"label": "sdk.board.cpu.temperature",
"kind": "variable",
"insertText": "sdk.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": "sdk.board.led.set_state({channel}, {state})\n",
"tips": {
"python": {
"label": "sdk.board.led.set_state(channel:string, state:string)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.key.get_state()\n",
"tips": {
"python": {
"label": "sdk.board.key.get_state()",
"kind": "function",
"insertText": "sdk.board.key.get_state()",
"detail": "读取自定义按键状态"
}
}
},
{
"name": "key_state",
"disabled": false,
"function": {
"message0": "当前自定义按键状态",
"args0": [],
"output": "Number"
},
"code": "sdk.board.key.key_state",
"tips": {
"python": {
"label": "sdk.board.key.key_state",
"kind": "function",
"insertText": "sdk.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": "sdk.board.io.set_mode({channel}, {mode})\n",
"tips": {
"python": {
"label": "sdk.board.io.set_mode(channel:int, mode:string)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.io.set_state({channel}, {state})\n",
"tips": {
"python": {
"label": "sdk.board.io.set_state(channel:int, state:string)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.pwm.pwm_control({channel}, {rate}, {width})\n",
"tips": {
"python": {
"label": "sdk.board.pwm.pwm_control(channel:int, rate:int, width:int)",
"kind": "function",
"insertText": "sdk.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": "sdk.board.mpu.read_data()\n",
"tips": {
"python": {
"label": "sdk.board.mpu.read_data()",
"kind": "function",
"insertText": "sdk.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": "sdk.board.mpu.get_data({data})",
"tips": {
"python": {
"label": "sdk.board.mpu.get_data(data:string)",
"kind": "variable",
"insertText": "sdk.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"
}
}
}
]
}
]
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。