Skip to content

RonSchoon/AdeeptRaspTankGUI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdeeptRaspTankGUI

A simple and easy to change Web GUI for the Adeept RaspTank.

Just a starter for those who are learning to code Python and Web interfaces, but don’t want to also learn the vue.js Javascript Framework. It helps to easily add new functions to the GUI that control new code in the robot.

Custom GUI for Adeept Rasp Tank

Do the following to get it going:

Copy files:

indexcust.html -> <your adeept_rasptank path>/server/dist/

js/code.js -> <your adeept_rasptank path>/server/dist/js/

css/styles.css -> <your adeept_rasptank path>/server/dist/css/

Edit code:

Open python code file (you need to use appropiate credentials to save the file): <your adeept_rasptank path>/server/app.py

Search for

“@app.route('/')”

Add the following after the return:

@app.route('/cust')
def custom():
    return send_from_directory(dir_path+'/dist', 'indexcust.html')

After that it should look like:

@app.route('/')
def index():
    return send_from_directory(dir_path+'/dist', 'index.html')

@app.route('/cust')
def custom():
    return send_from_directory(dir_path+'/dist', 'indexcust.html')

Save and close the file.

Restart the webserver.py

Open the custom GUI in a Webbrowser (add /cust to the link):

<ip | hostname>:5000/cust

The original GUI is still available under: <ip | hostname>:5000

To make Hand and Arm up and down buttons work, add the following in file:

<your adeept_rasptank path>/server/webserver.py in function: robotCtrl

add before the line:

elif 'home'
elif 'armup' == command_input:
    H1_sc.singleServo(12, 1, 7)

elif 'armdown' == command_input:
    H1_sc.singleServo(12, -1, 7)

elif 'ARstop' in command_input:
    H1_sc.stopWiggle()

elif 'forearmup' == command_input:
    H2_sc.singleServo(13, -1, 7)

elif 'forearmdown' == command_input:
    H2_sc.singleServo(13, 1, 7)

elif 'FAstop' in command_input:
    H2_sc.stopWiggle()

Needs a webserver.py restart

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 51.9%
  • HTML 34.3%
  • CSS 13.8%