I wrote a simple "bit-banging" sketch to send data between a pair of Arduino Uno's, and it works well.
While I know I'm reinventing the wheel here, in view of the availability of SPI, I2C, Serial... it was
an interesting process, and may well work over fairly long(ish) distances when serial isn't an option (eg all used up).
Alternatives comms processes exist, but I really need some help getting to the bottom of my problem, that being, trying to turn the working sketch into a library (my first). I've stared at the code for ages, checked the header and class files were formatted correctly based on my research, but it just won't compile.
The variable scError is declared in the .H file, but on compiling, I get...
C:\arduino-1.8.9\portable\sketchbook\libraries\SimpleComms\SimpleComms.cpp: In function 'int scSendByte(char)':
C:\arduino-1.8.9\portable\sketchbook\libraries\SimpleComms\SimpleComms.cpp:216:3: error: 'scError' was not declared in this scope
If I sneak the variable declaration into the .CPP file, compilation errors indicating the functions aren't declared. It's almost like the .H file isn't being included, but if I "include" a non-existent file in the code, I get the appropriate error indicating the file doesn't exist.... I'm at a loss....
All the files are in the attached zip, the working sketch in examples\working, the test sketch for the library in examples\sc1.
Be gentle with me, it's my first posting
SimpleComms.zip (6.12 KB)