Skip to content
danentwistle edited this page Jul 13, 2015 · 2 revisions

Overview

Coderbot is a framework for building programs that can access Raspberry Pi peripherals using Blockly. Blockly is a web-based visual programming language and Coderbot provides a (Flask-based) web server for creating Blockly programs remotely in your web browser and executing them on the Pi.

Step by step example

  1. Coderbot has started on a private LAN and is accessed on 10.0.0.1:8080
  2. A user can load 10.0.0.1:8080 in their web browser provided they are connected to the same private LAN
  3. On the Coderbot website the user make a program in Blockly and presses Run
  4. Blockly code is translated to Python, send to the Pi, and finally executed.
  5. The user can preview the translated Python code by clicking Show

In more detail…

  1. The move forward Blockly puzzle piece is translated to get_motion().move(dist=1.5) in python.
  2. The Flask-based webserver calls handle_program_exec() in main.py which gets the code from the client and instantiates a new python program using that code (using the classes defined in program.py)
  3. In our example, getmotion().move(dist=1.5) in program.py eventually results in PWM output on the GPIO pins.
Clone this wiki locally