How do you edit Component Blocks?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
        Hi all,   
   
I just got my PSoC FirstTouch Starter Kit and I'm blown away at what the PSoC chips can do! It's like having an analog workbench plus a powerful microprocessor on the end of your USB cable.   
   
Can anybody tell me how I can modify the "Component Block for LED Control" shown in the TopDesign.cysch window of the BubbleLevel project that comes with the FirstTouch kit? It comes with just seven wires connected to the control register and wire 3 is connected to two LEDs. This gives you a two LED wide dot when the board is exactly level, but I want to change that.   
   
I can right click on the LED_Control_Reg and change the number of bits from 7 to 8 and ditto with the inverter between the LED_Control_Reg and the LEDs, but how do I change the wires? I want to run an 8 wire bus with each wire controlling a single LED.   
   
I'm hoping for a graphical way to do this, but if I have to dig into files, how do I do that?   
   
Thanks,   
Dave   
0 Likes
2 Replies
markgsaunders
Employee
Employee
50 sign-ins 10 solutions authored 5 solutions authored
        You need to...   
   
1. Increase the size of the control register to 8   
2. Draw a wire from the new terminal to the bus (that 's the thick wire labeled [6:0])   
3. Name the wire "[7]"   
4. Change the width of the both buses (before and after the inverter) to [7:0]   
5. Change the size of the inverter to 8   
6. Change the bus to dPins_MSB to be [7:4]   
7. Change the C code from:   
if(BubbleValue > 6)   
{   
BubbleValue = 6;   
}   
to:   
if(BubbleValue > 7)   
{   
BubbleValue = 7;   
}   
   
This will give you an extra LED when you tip it one direction. I attached a picture...   
   
Note that the wiring changes are done by right-clicking and selecting "Edit Name and Width".   
   
-- mgs   
   
0 Likes
Anonymous
Not applicable
        Thank you! I just followed your instructions and it worked the first time!   
   
I really love the new PSoC 3 chips. I've been waiting for something like this for twenty years!   
   
Now to play with it some more ...   
0 Likes