Trying to write a custom library for a blinking light

80 views Asked by At

I'm new to arduino and want to make some libraries. Full Disclosure: I am not a programmer and have been following some tutorials and reading as much as I can about rewriting functions as libraries. Yet, I still have some questions.

Example: I want to set up a custom blink pattern for the LEDpin on my arduino UNO. I want to include this blinking code on future projects and would like to use it with the #include statement when I start a new project. (easy?)

As an example:

The often referenced Morse Code Library tutorial here

I have the files saved in ..\My Documents\Arduino\libraries\Morse\morse\ there are 4 files:

keywords.txt
morse.c
morse.h
morse.ino

They exist in those files exactly as the final code examples on the linked page.

Question 1: can anyone verify if this tutorial is accurate for an Arduino Uno using 1.6.4?

I can not get this or any "library" that I "create from scratch" to compile or upload to the mcu.

It doesn't seem to get any simpler than this in terms of a "custom library" tutorial. Would it help to post the error codes or PEBCAK?

Much of the style guide stuff was too advanced for me to follow but I did try to put the .c and .h files into a sub directory called \src. It didn't help.

I can't get rid of the ..\Morse\morse double directory. I am doing everything in arduino IDE and it makes it's own folders. If I move files around after I save it, it doesn't work when I reopen it and automatically resaves it where it was and I end up with all these weird duplicate files and folders.

Question 2: Do I need to be working in some other editor when creating a library?

Thanks!

1

There are 1 answers

0
AdminXVII On BEST ANSWER

The file in your folder should be:

Librairies/
  Morse/
    morse.cpp
    morse.h
    keywords.txt