下面是小车
好丑 对不对 ,不过反正可以蛇皮走位就行。
只需要 一个 index.html 和Index.py 就可以实现 简单WiFi 控制小车。
需要准备
python
bottle 库
bottle 安装命令: pip install bottle
树莓派控制界面(web客户端)
index.html
遥控树莓派#front {
margin-left: 55px;
margin-bottom: 3px;
}
#rear{
margin-top: 3px;
margin-left: 55px;
}
.btn{
background: #62559f;
}
$(function(){
$("button").click(function(){
$.post("/cmd",this.id,function(data,status){});
});
});
左后转
右后转
js脚本解释:
$(function(){
$("button").click(function(){
$.post("/cmd",this.id,function(data,status){});