element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Azure Sphere Starter Kit
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Azure Sphere Starter Kit
  • More
  • Cancel
Azure Sphere Starter Kit
Forum Issue using i2c library
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Azure Sphere Starter Kit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 46 subscribers
  • Views 360 views
  • Users 0 members are here
  • i2c
  • azure sphere
  • microsoft
  • stepper motor
Related

Issue using i2c library

electronichussar
electronichussar over 5 years ago

Hey everyone. I'm trying to use the Azure Sphere to build a chess playing robot. To control the stepper motors to move the arm I am using the two click boards from the link: https://www.mikroe.com/stepper-13-click

This board uses the PCA9538A i2c expander chip. Now when I am trying to compile in Visual Studio I use the i2c library as documented by Microsoft but whenever I try to use a function that should exist in that library I receive the error "implicit declaration of function 'I2CMaster_WriteThenRead' [-Werror=implicit-function-declaration]". Does anyone have any idea of what I need to do to fix this?

  • Sign in to reply
  • Cancel

Top Replies

  • Sean_Miller
    Sean_Miller over 5 years ago +3
    For Azure code, I've found I have to see the entire solution to troubleshoot stuff like this, but, here is where I'd start: This message occurs when the compiler has no function declaration to refer to…
  • Sean_Miller
    Sean_Miller over 5 years ago

    For Azure code, I've found I have to see the entire solution to troubleshoot stuff like this, but, here is where I'd start:

     

    This message occurs when the compiler has no function declaration to refer to.  A function declaration provides the compiler the functions return type as well as the variable types passed as parameters in the function.

     

    Function declarations are most frequently provided in ".h" files known as header files.  The header files are referenced towards the top of your code using the "preprocessor directive" named "#include".  The compiler will add that code stated in the #include directive prior to compiling and in turn have no "implicit declarations".

     

    So, to troubleshoot, look at the top of the script that the error references.  After all the comments, look for a section with a few lines like.

    #include <file.h>

     

    It may be as simple as you need add the following line in that section:

    #include "i2c.h"

     

    In my Azure code, in the i2c.c file, I have a section of preprocessor directives that have two header files for i2C:

    #include <applibs/i2c.h>
    ....
    #include "i2c.h"

     

    A quick Google reference for more info:  https://www.tutorialspoint.com/cprogramming/c_header_files.htm

     

    For my Azure code, I used the Avnet Azure Sphere example as my starting base.  I put code for my additional I2C devices in the i2c.c code to quickly get things going.  Otherwise, I would have had to do a let of sorting like above and find a way to trigger my sensor calls.  In particular, I added the sensor calls to the AccelTimerEventHandler() function so it would get my devices I2C sensor data when it got the sensor data from the Azure Sphere.

     

    See ya',

    Sean

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube