Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (85 sloc) 5.59 KB

c't-Bot Teensy framework

This is a very basic framework for the c't-Bot with a Teensy 35 or Teensy 36 controller. It is licensed under the terms of the GPLv3 license.

Summary

This code was created for testing a new and simplified design of the c't-Bot software framework. The basic idea is to have a modular structured framework implemented in C++ built on modern language features.

Notice

Consider this as experimental code. If it breaks, you get to keep both pieces.

Setup

  1. install PlatformIO core as described here
  2. clone this git repository: git clone https://github.com/tsandmann/ctbot-teensy
  3. change to cloned repo: cd ctbot-teensy
  4. initialize build system for...
    • commandline build: platformio init
    • VS Code project: platformio init --ide vscode
    • Eclipse CDT project: platformio init --ide eclipse
    • any other environment supported by PlatformIO

Usage

  1. build project
    • commandline: plaformio run
    • VS Code: use “Build” button on the PlatformIO toolbar or shortcut (ctrl/cmd+alt+b)
    • Eclipse CDT: Project -> Build Project or shortcut (ctrl/cmd+b)
  2. upload firmware image
    • connect USB cable to teensy board
    • commandline: platformio run -v -e teensy36 -t upload
    • VS Code: use “Upload” button on the PlatformIO toolbar or shortcut (ctrl/cmd+alt+t) and select "PlatformIO: Upload"
  3. use a terminal program (e.g. minicom) to connect to the USB serial device
    • if you use minicom:
      • goto Serial port setup settings and set Serial Device to your serial device (typically sth. like /dev/cu.usbmodemXXXXXXX or /dev/tty.usbmodemXXXXXXX), Bps/Par/Bits to 4000000 8N1 and Hardware Flow Control to No as well as Software Flow Control to No
      • goto Screen and keyboard settings and set Add carriage return to Yes
  4. have fun with the command line interface
    • type help to get a list and description of available commands
  5. cruise around with the c't-Bot using
    • your remote control: arrow keys for forward, backward, left, right and power button for stop
    • the command line interface: set speed 30 30 for 30% of max speed on both wheels, set speed 0 0 (or just set speed) to stop
  6. press play on remote control get a little easter egg on the command line interface :) or I/II to shutdown the bot :(

Notices

Manual Build

  • this is currently untested
  • to compile for a teensy board
    1. install a C++ compiler for the arm-none-eabi architecture, e.g. arm-none-eabi-g++ with newlib C standard library and libstdc++ C++ runtime library. The compiler has to be capable to compile at least C++14.
    2. download and compile Teensy Core Libraries for Arduino into a static library, e.g. libFrameworkArduino.a
    3. download and compile Teensy Wire Library into a static library, e.g. libWire.a
    4. compile the following files from these subdirectories of the project:
      • src/*.cpp
      • lib/lcd/*.cpp
      • lib/PCF8574/*.cpp
      • lib/pid/*.cpp
      • lib/rc5/*.cpp
    5. add the following subdirectories to your compiler include path:
      • src/
      • lib/arduino/
      • lib/lcd/
      • lib/PCF8574/
      • lib/pid/
      • lib/rc5/
    6. additional linker flags (beside others): -Wl,--start-group libWire.a libFrameworkArduino.a -lm -lstdc++ -Wl,--end-group
You can’t perform that action at this time.