Giter VIP home page Giter VIP logo

analogshield's Introduction

analogShield

Analog Shield Library ADC / DAC library for the Digilent Analog Shield

To include the library in a sketch, once it is installed, it is simply invoked by typing:

#include <analogShield.h>

Once the shield library is included, the sketch will have access to a variable called analog, which has access to all the methods associated with the shield. The following are the six most important methods associated with the shield.

  unsigned int read(int channel, bool mode = false);

This method samples the selected analog input. ‘mode’ is an optional parameter. False (the default value) is normal single ended mode where each analog pin is referenced to ground. True enables ‘differential’ mode, where the value returned is the difference between the voltages on pairs of adjacent inputs (i.e. IN0-IN1 and IN2-IN3). Read returns an unsigned integer.

  signedRead(int channel, bool mode = false);

Signed read behaves identically to read, but returns a signed integer.

  write(int channel, unsigned int value);
  write(unsigned int value0, unsigned int value1, true); 
  write(unsigned int value0, unsigned int value1, unsigned int value2, true); 
  write(unsigned int value0, unsigned int value1, unsigned int value2, unsigned int value3, true);

These methods allow writing to the Analog Shield’s analog output. The first method writes to any arbitrary selected channel. The next three methods write to two or more channels simultaneously (but don’t allow selection of which channel is to be written). The simultaneous update methods are useful for higher speed applications where a small delay between channel outputs will produce unwanted signals or timing issues. For example, to use the shield to drive the X-Y input of an oscilloscope to draw a circle, a delay between writing the X and the Y channels produces a ghost ‘ellipse’ drawn during the interim between the X and Y DAC updates.

analogshield's People

Contributors

coredumpninja avatar mwingerson avatar wespo 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.