Pages: [1]   Go Down
Author Topic: I2C Port expander and keypads for Arduino  (Read 948 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I used the tutorial http://playground.arduino.cc/Main/I2CPortExpanderAndKeypads to connect a keypad with an I2C expander, and the program works on IDE 023, but gives me errors and cannot compile on IDE 105. I am a beginner in programing and don't know how to detect and change the incompatibilities.

I changed send and receive with read and write and WConstants.h with Arduino.h but then I get errors like this:

In file included from C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/HardwareSerial.h:100,
                 from C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:193,
                 from i2ckeypad.cpp:50:
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/USBAPI.h:191: error: declaration of C function 'int USB_Recv(uint8_t)' conflicts with
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/USBAPI.h:190: error: previous declaration 'int USB_Recv(uint8_t, void*, int)' here
In file included from i2ckeypad.cpp:50:
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:196: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:195: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:206: error: declaration of C function 'long int random(long int)' conflicts with
c:/.../arduino-1.0.5/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:207: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\...\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:206: error: previous declaration 'long int random(long int)' here

Can anyone help me with this? Thank you.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could just use the keypad_I2c library. It's included with the normal keypad library.

http://playground.arduino.cc/code/Keypad
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@tack thank you for your answer. I sow that tutorial. It says there "You can find more information inside the docs folder under the Keypad_I2C library folder." But there is no docs folder in the downloaded zip and no information on how to use that library. So I really don't know how to use it.

Anyone knows where I can find those docs?
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A quick Google turned up the following, which should help you:-

http://bradsduino.blogspot.co.uk/2013/01/i2c-version-of-using-4x4-universal-16.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you @tack. Solved the problem.
Logged

Pages: [1]   Go Up
Jump to: