参数资料
型号: 20-151-0178
厂商: Rabbit Semiconductor
文件页数: 81/162页
文件大小: 0K
描述: CABLE CONVERTER RS-232 TO USB
标准包装: 1
附件类型: USB 至 RS232 适配器
适用于相关产品: 基于 Rabbit 的板
产品目录页面: 619 (CN2011-ZH PDF)
其它名称: 20-151-0178-ND
316-1181
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描述
MAX11200EVKIT+ KIT EVALUATION FOR MAX11200
HCC06DRTF-S13 CONN EDGECARD 12POS .100 EXTEND
HK1608R47J-T INDUCTOR HI FREQ 470NH 5% 0603
PCM16XD0 PROCESSOR MODULE FOR MPLAB-ICE
SDR1006-681KL INDUCTOR POWER 680UH 0.28A SMD
相关代理商/技术参数
参数描述
20-151-0183 功能描述:处理器配件 UNIVL PWRSUPLY 12VDC 1A/W MOLEX MICROFIT3 RoHS:否 制造商:Olimex Ltd. 产品:Cable 用于:
2015103-1 制造商:TE CONNECTIVITY 功能描述:RF C/A, RT ANG QMA/DIN 1.0/2.3 CONN
2015-104 制造商:The Bergquist Company 功能描述:THERMAL PAD TO-3P PK5 制造商:The Bergquist Company 功能描述:THERMAL PAD, TO-3P, PK5 制造商:The Bergquist Company 功能描述:THERMAL PAD, TO-3P, PK5; Insulator Body Material:Silicone Elastomer; Thermal Conductivity:3.5W/m.K; Breakdown Voltage Vbr:4kV; Thickness:0.508mm; Volume Resistivity:100000Mohm-m; SVHC:No SVHC (19-Dec-2012); Electrical Property Ins /
2015-104 制造商:The Bergquist Company 功能描述:THERMAL PAD TO-3P 制造商:The Bergquist Company 功能描述:THERMAL PAD, TO-3P
201511 制造商:Phoenix Contact 功能描述:Misc Products