void Initializer() { WiringPiLib = new WirinPiWrapper(); WiringPiLib.WiringPiSetupGpio(); WiringPiLib.PinMode(SHUTDOWNPIN, PinType.INPUT); WiringPiLib.PullUpDnControl(SHUTDOWNPIN, PullUpType.PUD_UP); WiringPiLib.PinMode(ACTIVPIN, PinType.INPUT); WiringPiLib.PullUpDnControl(ACTIVPIN, PullUpType.PUD_DOWN); for (int i = 0; i < Sensors.Length; i++) { WiringPiLib.PinMode(Sensors [i], PinType.INPUT); WiringPiLib.PullUpDnControl(Sensors[i], PullUpType.PUD_DOWN); } SleepBetweenActions = Int32.Parse(ConfigurationManager.AppSettings ["Hund_SleepBetweenActions"]); int pwmRange = Int32.Parse(ConfigurationManager.AppSettings ["Hund_PWM_Range"]); int servohertz = Int32.Parse(ConfigurationManager.AppSettings ["HundServohertz"]); int servoMaximalAusschlagGrad = Int32.Parse(ConfigurationManager.AppSettings ["HundServoMaximalAusschlagGrad"]); int hundServoMilliSecLeft = Int32.Parse(ConfigurationManager.AppSettings ["HundServoMicroSecLeft"]); int hundServoMilliSecRight = Int32.Parse(ConfigurationManager.AppSettings ["HundServoMicroSecRight"]); InvertSensorInput = bool.Parse(ConfigurationManager.AppSettings ["HundInvertSensorInput"]); NonPlausibleWaitTimerMilliSec = Int32.Parse(ConfigurationManager.AppSettings ["HundNonPlausibleWaitTimerMilliSec"]); LenkDeltaInGrad = float.Parse(ConfigurationManager.AppSettings ["HundLenkDeltainGrad"]); LenkServo = new Servo(PWMServoPin, servohertz, pwmRange, servoMaximalAusschlagGrad, WiringPiLib, hundServoMilliSecLeft, hundServoMilliSecRight); }
public FolienTastatur() { wiringPiLib.WiringPiSetupGpio(); for (int i = 0; i < Rows.Length; i++) { wiringPiLib.PinMode(Rows [i], PinType.OUTPUT); wiringPiLib.DigitalWrite(Rows [i], 0); wiringPiLib.PinMode(Cols [i], PinType.INPUT); wiringPiLib.PullUpDnControl(Cols[i], PullUpType.PUD_DOWN); } }