Coder Social home page Coder Social logo

mcp23008's Issues

FYI: Arduino Nano ESP32 Doensn't like excisting commands like pinMode

Arduino Nano ESP32. Including your library puts out:
In file included from C:\Users----\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/Arduino.h:223,
from C:\Users---\MCP23008\Arduino\MCP23008_test\MCP23008.h:10,
from C:\Users---\MCP23008\Arduino\MCP23008_test\MCP23008.cpp:9:
C:\Users---\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: error: 'digitalPinToGPIONumber' is not a type
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~
C:\Users---\MCP23008\Arduino\MCP23008_test\MCP23008.h:36:8: note: in expansion of macro 'pinMode'
bool pinMode(uint8_t pin, uint8_t mode);
..... etc.

changing in .h
bool pinMope(uint8_t pin, uint8_t mode);
bool digitalWripe(uint8_t pin, uint8_t value);
uint8_t digitalReat(uint8_t pin);

// 8 pins interface
// value = bit pattern
bool pinMope8(uint8_t value);
bool write8(uint8_t value);

// DEBUG functions
uint8_t getpinMope8();

and in .cpp accordingly, works now fine.
I guess the ESP32 doesn't recognize that its in a class.
Just a quick report.
Thank you.

Error in digitalRead example

Hi there,
there is an error in the MCP23008_digitalRead example:

MCP.pinMode8(0x00);

should instead be:

MCP.pinMode8(0xFF);

Cheers, Ale.

pinMode() behavior seems to differ from pinMode8().

Hello gents, I am testing this library before using in my project and I am having a problem that seems silly but I can't get my head around it.

What I see is that the digitalRead(pin) example works perfectly when using pinMode8(0x00). On the reverse, when I am using the single pin methods and setting each pin individually with:

MCP.pinMode(0, INPUT);

the resulting digitalRead(pin) is always 1 as return value. Curiously enough, if I set the pinMode as OUTPUT, everything works as expected.

At this point I am not sure if there is something crooked with the library code or if I am doing something wrong (mistunderstanding or problems with my schematics).

Although I believe it is not related, I am using a chip identified as 0x22 on I2C and I also have a 0x21 on the same bus.

Can you please helpme to find out what is going on here?

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.