参数资料
型号: 151-0153
厂商: Rabbit Semiconductor
文件页数: 81/162页
文件大小: 0K
描述: ASSEMBLY - RABBITFLEX CABLES
标准包装: 1
系列: RabbitFLEX™
附件类型: 缆线组件
适用于相关产品: BL300F
Each of the changes that are shown below are made to the main() function of speaker_tone.c .
Flex_IOPin *switch_pressed;
Flex_IOPin *led;
int switchnum;
First of all, at the top of main() , we need to add a few variables. The variable *switch_pressed
will point to the switch that has been pressed. The variable *led will point to the LED that we should
light up. And the variable switchnum indicates the number of the switch (1-4) that was pressed. We will
see how these will be used later in this walk-through.
We will now skip farther down over some code that does not need to change.
// Display a menu of choices to the user
printf("Press a switch on the demo board to play a sound!\n");
The above code should simply replace the menu of options that are presented to the user. Instead of using
the Stdio window to select the tone to play, we will be using switches on the demo board.
Again, we will skip down further, to just before the main while() loop.
// Initialize the output LEDs to turn off
flexDigOut(&flex_digout32, 1);
flexDigOut(&flex_digout34, 1);
flexDigOut(&flex_digout36, 1);
flexDigOut(&flex_digout38, 1);
The lines of code above will turn off the attached LEDs. Note that to turn off the LEDs on the demo board,
we must actually turn on the connected digital output. This is because the Flex library takes into account
drivers that invert the signal. All flexDigOut() calls always keep the logic uninverted. In the case of a
sinking driver, when flexDigOut() is called with a logic 1, the library turns the sinking transistor off
so that the output can go high and the logical 1 is available at the pin. So when using sinking drivers, the
transistor is turned on by calling flexDigOut() with a logic 0.
flexDigOut() is the function that manipulates a single digital output. Note that, like
flexSpeakerPWM() , this function takes a pointer to a Flex_IOPin structure. This first call to
flexDigOut() manipulates the flex_digout32 digital output. Note that “flex_digout32” should
correspond to how you have named your digital output. When you design your RabbitFLEX board, you
have the option of setting your own software name for each pin. If you designed your RabbitFLEX board
to have a digital output attach to an LED, then you might want to call that output “flex_led”. It the case
above, we used a different naming scheme. “digout” indicates that this is a digital output. “32” indicates
that this digital output is located on connector J3, pin 2. Again, when you design your board, you can name
your RabbitFLEX pins in whatever way makes the most sense for your application.
RabbitFLEX User’s Manual
75
相关PDF资料
PDF描述
1515738-1 INSERT ASSEMBLY 1 CHANNEL
1515739-1 INSERT ASSEMBLY, 2 X 1310
1515740-1 INSERT ASSEMBLY 4 CHANNEL
1515747-1 INSERT ASSEMBLY 4 CHANNEL
1515867-1 PROTECTIVE CAP,PLUG CONN.
相关代理商/技术参数
参数描述
151-01530 功能描述:RATCHET P CLAMP SIZE A SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,6.2mm-13.7mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01531 功能描述:RATCHET P CLAMP SIZE B SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,13.2mm-19.5mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01532 功能描述:RATCHET P CLAMP SIZE C SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,19.2mm-36mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01533 功能描述:RATCHET P CLAMP SIZE D SOFT INSE 制造商:hellermanntyton 系列:- 零件状态:新产品 配件类型:插件 配套使用产品/相关产品:Ratchet P 夹,35.1mm-51mm 捆扎直径 材料:热塑性塑胶(TPE) 特性:- 标准包装:100
151-01554 功能描述:WIDE STRAP ADHESIVE MOUNT BLK 制造商:hellermanntyton 系列:* 零件状态:在售 标准包装:3,000