Go Down

Topic: Is it possible to make a library with script? (Read 379 times) previous topic - next topic

knightschade

I am working on an I2C LCD display. I have the Arduino talking to the display and I can control the segments on and off. I would like to make a library? or a table of some kind, so that when I want a certain number displayed the Arduino will send the correct bits and display the letter, without me manually having to type in the bank and bits every time the number changes. However...I don't know C or C++ or C anything for that matter, and don't have a compiler to code with it anyway. Is is possible to script a library or look up table of some kind for this purpose without C?
I am re-purposing the LCD from a Jaguar and I am driving it with a PCF8577 LCD driver, so it is not compatible with the liquid crystal library available from this site.
Resistance is Futile

Aeturnalus

If you've already got working code that can talk to the device from your sketch, it's quite simple to make a library for it - start by making a function that takes in a number and converts it to the necessary indices for an array of segments, and then encapsulate that into a class and it'll be a library.

See this tutorial for syntax and formatting to make the IDE recognize it.

The compiler is included with Arduino - all you need to know how to do is to use a text editor (or even the Arduino IDE itself) to make a few new files.

knightschade

Yes, I think I found that one Googling.

I guess I have to figure out how to write my code fully, first, than worry about making it a library.

Thanks.
Resistance is Futile

Go Up