Pages: [1]   Go Down
Author Topic: Is it possible to make a library with script?  (Read 357 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 96
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Resistance is Futile

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 360
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 96
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Resistance is Futile

Pages: [1]   Go Up
Jump to: