Hello, I am new to creating libraries, and would like to know how to share a library with others, & how do I see my library? Thanks in advance. Code:
#include "TestLibrary.h"
void setup() {
}
void loop() {
blinkLED(13, 500); //pin, frequency in milliseconds
}
This part is for the .cpp:
/*
Morse.cpp - Library for flashing Morse code.
Created by David A. Mellis, November 2, 2007.
/*This is where you write the code you want to run*/
#include "Arduino.h"
#include "TestLibrary.h"
void blinkLED(int pin, int delayTime){
pinMode(pin, OUTPUT);
digitalWrite(pin, HIGH);
delay(delayTime);
digitalWrite(pin, LOW);
delay(delayTime);
}
This part is for the .h:
#include "Arduino.h"
void blinkLED(int pin, int delayTime);
Sorry, still too vague. Try harder this time. I'm certain you're capable of explaining this simple concept to me. Use your words. Maybe you think you're saving time by not writing very much, but you're wrong.
UptownKitten:
I still don't understand, I don't want to code to add a Arduino library to GitHub, or do I have to do that? The GitHub tutorials are telling me I have to code to add code to GitHub, what for? What is a simple way or how can I add a library or code to GitHub without having to actually code with the GitHub code? Can I use something else if not? What can I use for sharing code/libraries?
arduino_new and PieterP are haring off on the assumption that you want to add your library to the Arduino Library Manager index (Sketch > Include Library > Manage Libraries... and Tools > Manage Libraries... in the Arduino IDE, Libraries > Library Manager in the Arduino Web Editor. I'm an expert on the Library Manager but I don't play the assumptions game. If you won't make the effort to explain what you want to accomplish, I'm not going to make the effort to help you. It's that simple.
Take some deep breaths.
Sit down and explain exactly what you want to accomplish. Use lots of sentences.
Now, before posting, pretend you don't know anything about your situation and goals and read what you wrote. Does it make perfect sense to you? Is everything very clear? If not, keep working on your explanation until it's extremely clear and precise.
This is an extremely important skill that you will need to learn if you want any success getting help here on the forum.