Giter Site home page Giter Site logo

wavefrom_click's Introduction

MikroE


Waveform Click

  • CIC Prefix : WAVEFORM
  • Author : Dusan Poluga
  • Verison : 1.0.0
  • Date : apr 2018.

Software Support

We provide a library for the Waveform 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 contains generic functions for controlling the waveform and frequency output of the click board.

Key functions :

  • void waveform_sineOutput(uint32_t f) - Function for setting the sine wave output.
  • void waveform_triangleOutput(uint32_t f) - Function for setting the triangle wave output.
  • void waveform_squareOutput(uint32_t f) - Function for setting the square wave output.

Examples Description

Description :

The application is composed of three sections :

  • System Initialization - Initialize the GPIO and communication structures.
  • Application Initialization - Initialize the communication interface and configure the click board.
  • Application Task - Predefined characters are inputed from the serial port. Depending on the character sent the signal frequency, waveform or amplitude will be changed.
void applicationTask()
{
    char rxDat;
    uint32_t freqTmp;
 
    if(UART_Rdy_Ptr())
    {
       rxDat = UART_Rd_Ptr();
       mikrobus_logWrite(&rxDat,_LOG_BYTE);
    }
    if(rxDat>0)
    {
       switch(rxDat)
       {
           case waveform_cmd[0]: {
                                     waveform_digipotInc();
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[1]: {
                                     waveform_digipotDec();
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[2]: {
                                     freq += 1;
                                     freqTmp = freq << 14;
                                     waveform_sineOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[3]: {
                                     freq -= 1;
                                     freqTmp = freq << 14;
                                     waveform_sineOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[4]: {
                                     freq += 1;
                                     freqTmp = freq << 14;
                                     waveform_triangleOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[5]: {
                                     freq -= 1;
                                     freqTmp = freq << 14;
                                     waveform_triangleOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[6]: {
                                     freq += 1;
                                     freqTmp = freq << 14;
                                     waveform_squareOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           case waveform_cmd[7]: {
                                     freq -= 1;
                                     freqTmp = freq << 14;
                                     waveform_squareOutput(freqTmp);
                                     rxDat = 0;
                                     break;
                                 }
           default : {
                         break;
                     }
       }
    }
     rxDat = 0;
}

Additional Functions :

  • uint32_t waveform_aproxFreqcalculation(float freqency) - This function is used to calculate the aproximate value that will be written to the frequency set register.

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

Other mikroE Libraries used in the example:

  • SPI library
  • UART library
  • Conversions library
  • C_Sring library

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.



wavefrom_click's People

Contributors

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