- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi all!
i have some problem with module TTP 229. And i can't find same project TT229 with Psoc 5.
Can you teach me!
Sorry my english is not good.
Thanks all.
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should use a different drive mode for your SDO pin which is currently high impedance. When your button is not pressed the pin's state is not really defined.
Use "Resistive pull up" initially drive High.
Then you read "1" when the button is not pressed and "0" otherwise (when button shorts to GND)
Best practice is to wait until the button is released before proceeding further.
Of curse you will see a random number when you press the button: the loop executes so fast no way to determine the count.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this is my code:
for(;;)
{
uint8 data;
uint8 Count;
uint8 key;
for(Count=1;Count<17;Count++){
SCL_Write(0);
data=SDO_Read();
if(data==0)
{
key=Count;
led_Write(1);
LCD_WriteXY(0,0,key,3);
CyDelay(100);
}
else
{led_Write(0);}
SCL_Write(1);
}
}
}
i can blink led if i touch but i cant display the number of button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot see an LCD_Start() in your code snippet.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
int main(void)
{
LCD_Start();
CyGlobalIntEnable; /* Enable global interrupts. */
for(;;)
{
uint8 data;
uint8 Count;
uint8 key;
for(Count=1;Count<17;Count++){
SCL_Write(0);
data=SDO_Read();
if(data==0)
{
key=Count;
led_Write(1);
LCD_WriteXY(0,0,key,3);
CyDelay(100);
}
else
{
led_Write(0);
}
SCL_Write(1);
}
}
}
sorry Bob.
i have problem with this project. When i touch button 1 or orther button LCD display random number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should use a different drive mode for your SDO pin which is currently high impedance. When your button is not pressed the pin's state is not really defined.
Use "Resistive pull up" initially drive High.
Then you read "1" when the button is not pressed and "0" otherwise (when button shorts to GND)
Best practice is to wait until the button is released before proceeding further.
Of curse you will see a random number when you press the button: the loop executes so fast no way to determine the count.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let me try it. Thanks you so much.