unsure about instances of uart
darnit
Posts: 25
I am trying to create a library file and in that file i want to have methodes that just send 'canned' messages to the lcd.· In order to get the library file to compile i had to create an instance of txUart.· The thing i am worried about is that i· have an instance of txUart opened in my primary program class.· will this cause a conflict or use unnecessary resources?
Comments
//main class
static Uart txUart = new Uart(...);
static myLib lib = new myLib(txUart, ...);
//your library class
public class myLib {
· private Uart tx;
· public myLib(Uart tx, ...) {
··· this.tx = tx;
··· ...
· }
· //use tx.sendByte() in this library class
}
regards peter