Coder Social home page Coder Social logo

mcp47feb's Introduction

MCP47FEB

Arduino Library for the MCP47FEB22 DAC by Microchip

This is a work in progress of migrating an existing library created by Neuroelec for the MCP4728 DAC. MCP4728: https://code.google.com/archive/p/neuroelec/downloads

Made minor code corrections as well as re-implemented reading and writing routines due to some differences in registers and memory maps. Had to bit-shift, and/or alot...

The MCP47FEB22 is a 12-Bit Dual channel DAC controlled via I2C. -Has Non-Vol storage to retain outputs, gain, and powerdown states. -3 Selectable Vref Sources (VDD, Ext VRef pin, or Internal Band-Gap 1.22v) -Setting time of 6us. -Output gain -POR/BOR

Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/20005375A.pdf

mcp47feb's People

Contributors

akuma6099 avatar allantdrh avatar per1234 avatar

Stargazers

 avatar  avatar THX2112 avatar Volodymyr Smotesko avatar

Watchers

James Cloos avatar  avatar

Forkers

allantdrh

mcp47feb's Issues

unable to use DAC

First thanks for creating this library!

I am using a MCP47FEB22 for a DAC output, but I cannot set the values using the lib functions, here's my code, can you tell me where is the problem?

#include <mcp47FEB22.h>
#include <Wire.h>

mcp47FEB22 mcp47(0);

void setup() {
Serial.begin(9600);
mcp47.begin();
uint16_t a = 200;
uint16_t b = 0;

mcp47.analogWrite(a,b);

}

void loop() {
// put your main code here, to run repeatedly:

}

undefined reference to `makeWord(unsigned short)'

Back in 2019 I could this library very well with adafruit NRF board. Now I have switched to ESP32-WROOM board. getting this error. Not sure if Arduino have updated internal codes or something.

basically something is wrong with makeWord function. Any suggestion?

Here is the error:

libraries\MCP47FEB-master\mcp47FEB22.cpp.o:(.literal._ZN10mcp47FEB2211analogWriteEtt+0x0): undefined reference to makeWord(unsigned short)' libraries\MCP47FEB-master\mcp47FEB22.cpp.o: In function mcp47FEB22::fastWrite(unsigned char, unsigned short)':
C:\Users\attari\Documents\Arduino\libraries\MCP47FEB-master/mcp47FEB22.cpp:259: undefined reference to makeWord(unsigned short)' libraries\MCP47FEB-master\mcp47FEB22.cpp.o: In function mcp47FEB22::analogWrite(unsigned short, unsigned short)':
C:\Users\attari\Documents\Arduino\libraries\MCP47FEB-master/mcp47FEB22.cpp:259: undefined reference to `makeWord(unsigned short)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit ESP32 Feather.

Thanks

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.