robtillaart / mcp23008 Goto Github PK
View Code? Open in Web Editor NEWArduino library for I2C MCP23008 8 channel port expander
License: MIT License
Arduino library for I2C MCP23008 8 channel port expander
License: MIT License
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.
See - RobTillaart/MCP23S17#45
name collision is pinMode()
==> add./replace pinMode1()
name collision is digitalRead.
==> add/replace read1()
name collision is digitalWrite
==> add./replace write1()
Hi there,
there is an error in the MCP23008_digitalRead example:
MCP.pinMode8(0x00);
should instead be:
MCP.pinMode8(0xFF);
Cheers, Ale.
See - RobTillaart/MCP23S17#40
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.