I'm trying to communicate between two Arduino Due and Nano. Nano as Master and Due as a slave. As given in the library description Wire Lib
When the master request for data from the slave, first it goes to Request ISR. Wire.onRequest(requestEvent)
But when compile the program for Arduino Due I get following errors.
In file included from C:\Users\\Slave_Test3.ino:14:0:
C:\Users\..\AppData\Local\Arduino15\packages\arduino\hardware\sam1円.6.11\libraries\Wire\src/Wire.h:59:7: error: initializing argument 1 of 'void TwoWire::onRequest(void (*)())' [-fpermissive]
void onRequest(void(*)(void));
^
But If I change from Arduino Due to any other board this error does not come.
Thank you
1 Answer 1
Dead easy !!
(Well only because I had a -fpermissive
yesterday :) )
You are trying to implicitly cast, and you can't do that with modern GCC versions (quite rightly).
So you need to explicitly cast the first parameter to void*.
Because this is in a "core" library for the Due I would get the latest version of the board package and see if it goes away. You can turn the check off, but you will need to google on how to do that.
-
Thank you for the solution. Yes, I have the latest version of the board package. Still, I'm getting those errors. Can please elaborate your last suggestion I am new to this.Vishnu Prasad P– Vishnu Prasad P2017年08月14日 14:00:03 +00:00Commented Aug 14, 2017 at 14:00
-
Not really because I can't see the code that has the problem.Code Gorilla– Code Gorilla2017年08月14日 15:01:22 +00:00Commented Aug 14, 2017 at 15:01
-
I have written the same come as given here .Vishnu Prasad P– Vishnu Prasad P2017年08月14日 15:16:09 +00:00Commented Aug 14, 2017 at 15:16
-
1That link won't help. This "error" is not in your code, its in Wire.h as per your original postCode Gorilla– Code Gorilla2017年08月15日 07:18:35 +00:00Commented Aug 15, 2017 at 7:18
Explore related questions
See similar questions with these tags.
Wire
lib that the Due BSP includes.