Seemingly Simple Header File Problem


hello all,

   i've been running against seems simple, isn't working.  have main file (which includes wire.h), , header file of creation associated .c file.  functions in .c file can't see functions wire.h, else seems link fine (i.e. functions primary .ino file).  there obvious i'm missing?  i've tried silly stuff reordering include statements , including .c file directly, no joy.  i'm using platformio , can't tell if problems stems c problem, or else.  looking!

here's code gaze at:

primary.ino
***********
code: [select]

#include <wire.h>
#include <liquidcrystal_i2c.h>
#include <math.h>
#include "bwgi2c.h"  //this creation


bwgi2c.h
***********
code: [select]

#ifndef bwgi2c_h_   /* include guard */
#define bwgi2c_h_

int scan(void);
int verifyfreeaddress(int address); 

#endif // bwgi2c_h_


bwgi2c.c
***********
code: [select]

// long post in it's entirety, here's sample
int scan(void)
{     
    int error, address;

    wire.begin();  //this compiler says wire undefined
<snip>
}

please use code tags (</> button on toolbar) when post code or warning/error messages. reason forum software can interpret parts of code markup, leading confusion, wasted time, , reduced chance problem. make easier read code , copy ide or editor. if browser doesn't show posting toolbar can manually add code tags:
[code]// code here[/code]
using code tags , other important information explained in how use forum post. please read it.


the wire library c++. try changing filename of bwgi2c.c bwgi2c.cpp.


Arduino Forum > Using Arduino > Programming Questions > Seemingly Simple Header File Problem


arduino

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???