dusty Geschrieben January 3, 2012 at 01:28 Geschrieben January 3, 2012 at 01:28 Hey, I thought I might help out. I made a class in Java that extends the LCD20x4 Bricklet allowing you to write text without having to specify the lines. I plan to add more functions to it though (word wrap etc). This allows you to use all the functions of the standard class as well as the new ones. Usage: Bricklet20x4Writer LCD = new Bricklet20x4Writer("UIDHERE"); ipcon.addDevice(LCD); LCD.clearDisplay(); LCD.writeText("The maximum this screen can hold is 80 characters anything over will be removed!"); EDIT: https://github.com/samvaughton/TinkerTools -> This is where I'm working on it, up to date version there. Link to the class (call your class file "BrickletLCD20x4Writer.java") http://pastebin.com/vZ2E728y Zitieren
Cathodion Geschrieben April 16, 2012 at 09:01 Geschrieben April 16, 2012 at 09:01 Hey, I'm a java programmer and I've ordered a 20x4 display as well. I'll team up with you on creating a nice java library for this display if you like. Kind regards, Geert Schuring. Zitieren
Anton Geschrieben May 27, 2012 at 12:04 Geschrieben May 27, 2012 at 12:04 Hey! Are you still working on the github? I've made some extensions for the DualRealay too. I've made a method that changes the state of the relay regardless if it's on or off. Usefull for a single button solution. So say its on, you call switchState(int relayNo) relay1 switches to off. vica versa. Nothing too fancy. Got the lcd as well so i'm up to making something cool for that. Haven't used github before only bitbucket.org. So im not sure how it works, can you send me an invite to my mail anton.as@me.com? Would be cool to collaborate on some extensions. Zitieren
adrianbernhard Geschrieben May 29, 2012 at 13:38 Geschrieben May 29, 2012 at 13:38 I've made some extensions for the DualRealay too. I've made a method that changes the state of the relay regardless if it's on or off. Usefull for a single button solution. So say its on, you call switchState(int relayNo) relay1 switches to off. vica versa. Nothing too fancy. Can you share the code here? Zitieren
Anton Geschrieben May 29, 2012 at 18:41 Geschrieben May 29, 2012 at 18:41 Sure: package Extensions; import com.tinkerforge.*; import com.tinkerforge.IPConnection.TimeoutException; public class DualRelay extends BrickletDualRelay { public DualRelay(String uid) { super(uid); } public void switchState(int relay) throws TimeoutException { boolean relay1 = getState().relay1; boolean relay2 = getState().relay2; if(relay == 0) { if (relay1) { setState(false, relay2); } else { setState(true, relay2); } } else if(relay == 1) { if(relay2) { setState(relay1, false); } else { setState(relay1, true); } } } } I've made a git repository for the extensions at Bitbucket.org: https://bitbucket.org/Antonas/tinkerforge-extensions If any of you want an invite, send me a PM. Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.