GithubHelp home page GithubHelp logo

embedded-stdio-games's Introduction

embedded-stdio-games

Simple command-line interface based games for embedded devices. Inspired by asweigart/PythonStdioGames repository. It is a good way to learn python and good practice to implement the same in C. It was tested on STM32F103 Nucleo board.

DNA Game

Integration

Provided example is for STM32 microcontroller.

Copy source and header files into your project then include the provided header file.

// Game main loops
#include "dna.h"
#include "chonan.h"
// Utility function
#include "syscalls.h"

Initialize system calls with UART port that is connected to a UART <-> USB adapter. In case of STM32 Nucleo boards it is already available.

syscallsInit(&huart2);

In main() call one of the game loop functions

int main(void)
{
    while(1)
    {
        chohanGame();
        // or
        dnaGame();
    }
}

Open serial communication with default application

  1. List all the connected devices with ls /dev/cu.* command then look for usbserial or usbmodem.
  2. Open a serial connection: screen /dev/cu.usbmodem111203 115200.

Open serial communication with third-party application

  1. Install tio (using brew on MacOS).
  2. List all available devices with tio --list-devices then look for usbserial or usbmodem.
  3. Open serial connection with default options: tio /dev/cu.usbmodem111203 or tio /dev/cu.usbmodem153403 9600 if you want to specify the baudrate other than the default 115200.

embedded-stdio-games's People

Contributors

totibor 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.