4-digit shield class
Ich habe alle mir bekannten Funktionen mit dem Shieldstudio 4-digit shield in einer Klasse zusammengefügt und paar Funktionen ergänzt.
Download
4-digit shield_V1.0.0 (14)
V1.0.0
WriteSingleCharacter: Ein Zeichen an ein Digit schreiben.
WriteInverseCharacter: Ein Zeichen an ein Digit schreiben (invertiert).
WriteString: Eine Zeichenkette an alle Digits zeichnen.
CharEffect: Darstellung des/der Zeichen.
- MarqueeRight
- MarqueeLeft
- Blocks
SpecialCharacter: Sonderzeichen
- Fill
- Franc
- Yen
- Euro
- PlusMinus
- ArrowUp
- ArrowDown
- Empty
- Recangle
- Handsup
WriteCustomFont: Es kann jedes Digit selbst gezeichnet werden.
DoAnimation: Animation ausführen in unterschiedlichen Geschwindigkeiten.
- PongEasy
- PongHard
- Heart
Hier der Programmcode zum Beispielvideo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | using System.Threading; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; namespace Suplanus4digitShield { public class Program { const byte deviceAddress = 0x50; public static DigitShield ds = new DigitShield(deviceAddress, 400); public static OutputPort ledOnboard = new OutputPort(Pins.ONBOARD_LED, false); public static void Main() { while (true) { ledOnboard.Write(false); // Write single char ds.Clear(); ds.WriteSingleCharacter('T', MatrixUnit.A, CharEffect.ShortBlink); ds.WriteSingleCharacter('E', MatrixUnit.B, CharEffect.ShortBlink); ds.WriteSingleCharacter('S', MatrixUnit.C, CharEffect.ShortBlink); ds.WriteSingleCharacter('T', MatrixUnit.D, CharEffect.ShortBlink); Thread.Sleep(2000); // Custom Font ds.Clear(); ds.WriteCustomFont(BinaryCode.B0010000, BinaryCode.B0100100, BinaryCode.B0100000, BinaryCode.B0100100, BinaryCode.B0010000, MatrixUnit.A); ds.WriteCustomFont(BinaryCode.B1000000, BinaryCode.B0100100, BinaryCode.B0100000, BinaryCode.B0100100, BinaryCode.B1000000, MatrixUnit.D); Thread.Sleep(2000); // Animation: PongEasy ds.Clear(); ds.DoAnimation(AnimationTyp.PongEasy100); ds.DoAnimation(AnimationTyp.PongEasy50); ds.DoAnimation(AnimationTyp.PongEasy25); ds.DoAnimation(AnimationTyp.PongEasy10); ds.WriteString("LAME"); Thread.Sleep(2000); // Animation: PongHard ds.Clear(); ds.DoAnimation(AnimationTyp.PongHard100); ds.DoAnimation(AnimationTyp.PongHard50); ds.DoAnimation(AnimationTyp.PongHard25); ds.DoAnimation(AnimationTyp.PongHard10); // Write string ds.Clear(); ds.WriteString("www.Suplanus.de"); // Animation: Heart Thread.Sleep(2000); ds.Clear(); ds.DoAnimation(AnimationTyp.Heart); ledOnboard.Write(true); } } } } |


