cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

 Hi Everyone,.

   

I want to use capsense chip as a slave with I2C comminication. There are five capsense button. If  I pressed first button  1. led working .If I pressed second button 2. led working.  How do I code for master and slave. I don't know I2C comminication. I should send 1 byte for every button. I would appreciate if you give an idea.Thanks

0 Likes
7 Replies
Anonymous
Not applicable
        Hi yılmaz   
You would be better start with example design, for example, DelSig_I2Cs   
You'd use one byte for a LED or one bit for a LED   
That's depend on your design, Both OK.   
0 Likes
HeLi_263931
Honored Contributor II
        
  1. read on e.g. wikipedia on I2C (https://en.wikipedia.org/wiki/I2c ) to learn and understand this system
  2.     
  3. read the datasheet of the device you want to talk to (you didn't even tell which one it is), to learn how it works
  4.     
  5. the easy part: read the I2C component data sheet, and look up the examples for this component
  6.     
  7. write the program you need 🙂
  8.    
0 Likes
HeLi_263931
Honored Contributor II

Aargh! This should have been a numbered list. And in the HTML it even is marked as such! Who had the idea to style numbered list without numbers?

0 Likes
Anonymous
Not applicable
        Hi hli and psoc73, I have searched about I2C comm. I added a capsense button example. Do you have a problem about example? And I want to add more button and led.How do I make it?   
0 Likes
HeLi_263931
Honored Contributor II

Oh, so you want to connect two PSoCs with each other? I think that, then, the Slave should read the data the master writes, shouldn't it?

   

No, I don't have an example handy, but maybe one of the examples for the I2C component may help?

0 Likes
Anonymous
Not applicable

 Hi hli.

   

Yes I want to use two chip as a master and slave. I try to send 1 byte when  pressed button and led will work . But when i send to data form master, all leds working side of slave.  When i  pressed button1, led1 will work. When I pressed button2, led2 two will work. I want to do this.When i pressed button,probably I  should send to differents data side of master.But i can't do this. 

0 Likes
HeLi_263931
Honored Contributor II

Since the code you posted has no receive part on the slave, it cannot be the one you used to get it work with one button. And since you got it working already (for a single button at least), what is your real question anyway? There is, AFAIK, no existing example for the exact requirements you have. So no-one here can point you to one...

0 Likes