Giter VIP home page Giter VIP logo

ftduino_direct's Introduction

ftduino_direct

An arduino sketch and Python3 library to access the ftduino hardware

What is it?

The ftduino is an Arduino based Microcontroller intended to be used in combination with the fischertechnik robotics range of construction kits, as you already might know since you're here...

The ftduino can be programmed using the Arduino IDE according to the instructions to be found at the ftduino repository.

To access the ftduino hardware via Python, the ftduino_direct project provides a ftduino Arduino sketch (ftduino_direct.ino) and a Python module (ftduino_direct) to communicate to the ftduino via USB.

Installation

Arduino sketch

First, follow the instructions found at the ftduino homepage to install the Arduino IDE and set it up to be used with the ftduino.

Second, download the ftduino_direct.ino sketch.

Third, open the ftduino_direct.ino sketch into the ftduino IDE and upload it to your ftduino.

Your ftduino is now ready. It will indicate this by flashing the internal red LED with a frequency of 2Hz, until inital USB communication takes place.

You might open the Arduino IDE serial console and issue the command "LED_set 1" to switch on the internal red LED of the ftduino. "LED_set 0" turns the LED off again. Make sure to set the serial console to "CR" to issue a CR code on pressing Return or Enter, otherwise your commands will not be sent.

Python module

First download the Python Package and untar the file.

Second open a shell window, cd into the unpack directory and issue the command 'sudo python3 setup.py install'. The package will now be installed to your system.

Third get the test.py Python script and run it. It will switch on a motor connected to M1 of the ftduino and flash the red LED.

Use

See test.py on how to use...

You might execute all functions provided by Till Harbaum's sketch library using the .comm method of ftduino_direct.py, namely:

void input_set_mode(uint8_t ch, uint8_t mode);
uint16_t input_get(uint8_t ch);

void output_set(uint8_t port, uint8_t mode, uint8_t pwm);
void motor_set(uint8_t port, uint8_t mode, uint8_t pwm);
void motor_counter(uint8_t port, uint8_t mode, uint8_t pwm, uint16_t counter);
bool motor_counter_active(uint8_t port);
void motor_counter_set_brake(uint8_t port, bool on);

void ultrasonic_enable(bool ena);
int16_t ultrasonic_get();

void counter_set_mode(uint8_t ch, uint8_t mode);
uint16_t counter_get(uint8_t ch);
void counter_clear(uint8_t ch);
bool counter_get_state(uint8_t ch);

ftduino_direct's People

Contributors

peterdhabermehl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.