Coder Social home page Coder Social logo

obd_ii_click's Introduction

MikroE


OBD_II Click

  • CIC Prefix : OBDII
  • Author : MikroE Team
  • Verison : 1.0.0
  • Date : Nov 2017.

Software Support

We provide a library for the OBD_II Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Library Description

Library carries generic functions, neccesasry for communication with the module.

Key functions :

  • obdII_sendCommand - Sending provided command to the module
  • obdII_readResponse - Reads current response inside buffer
  • obdII_process - State machine function. This function calles frequently.

Examples Description

Example demnstrates how to read RPM from your vecihle.

  • System Initialization - Intializes UART module and GPIO pins
  • Application Initialization - Power on module and seting it to Automatic protocol detection by sending "ATSP0"
  • Application Task - (code snippet) - Sequential send command for RPM and converts readed response to RPM depend on
void applicationTask()
{
    uint8_t tmp[ 25 ];

    obdII_sendCommand( &RPM_CMD[0] );
    while( !obdII_responseReady() )
        ;
    obdII_readResponse( &rsp[0] );

    memcpy( &tmp[0], &rsp[11], 4 );
    tmp[5] = 0;
    rpm = xtoi( &tmp[0] );
    rpm = rpm / 4;
    WordToStr(rpm, &tmp[0]);

    mikrobus_logWrite( "Current RPM : ", _LOG_TEXT );
    mikrobus_logWrite( tmp, _LOG_LINE );
}

Note that not all vechiles uses same set of commands - so it might happens that routine for reading RPM on your vecihle is not same as these one provided inside example.

The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • Conversions
  • String
  • Stdlib

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.



obd_ii_click's People

Contributors

kacaperendic avatar

Stargazers

 avatar  avatar  avatar

Watchers

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