151-0153 Rabbit Semiconductor, 151-0153 Datasheet - Page 84

no-image

151-0153

Manufacturer Part Number
151-0153
Description
ASSEMBLY - RABBITFLEX CABLES
Manufacturer
Rabbit Semiconductor
Series
RabbitFLEX™r
Datasheet

Specifications of 151-0153

Accessory Type
Cable Assembly
For Use With/related Products
BL300F
Lead Free Status / RoHS Status
Vendor undefined / Vendor undefined
Similarly, we check each of the other three switches.
To make sure that the signal from the switch has settled, we wait 50 ms and recheck the digital input. Note
that there is no ‘&’ before switch_pressed. This is because switch_pressed is already a
pointer—it is used to point to which switch has been pressed.
If this debouncing check fails, then we will reach the end of the costatement, which means that the costate-
ment starts over again from the top. Thus, we once again start monitoring all of the switches.
We have now accepted the switch press. Recall that led is also already a pointer, and thus it is also not
preceded by an “&.” This line simply turns on the LED to indicate that the switch has been pressed.
78
} // end while loop
// Wait 50 ms to make sure the switch stays pressed (debouncing)
waitfor(DelayMs(50));
// Check if the switch is still pressed
if (flexDigIn(switch_pressed) == 1) {
else if (flexDigIn(&flex_digin35)) {
}
else if (flexDigIn(&flex_digin37)) {
}
// Light the corresponding output LED
flexDigOut(led, 0);
// Play the tone
flexToneLoad(tones[switchnum], tone_len[switchnum], REPEAT_TONE);
switch_pressed = &flex_digin35;
led = &flex_digout36;
switchnum = 3;
switch_pressed = &flex_digin37;
led = &flex_digout38;
switchnum = 4;
www.rabbit.com
Applications Programming

Related parts for 151-0153