- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Recently I posted a sample using CY8CKIT-044 but PSoC 4100S seems to be another popular candidate now,
I wrote this for TSoC (CY8C4146LQI-S433).
最近、CY8CKIT-044 用にサンプルをポストしましたが、この頃は PSoC 4100S も人気なようですので、
TSoC (CY8C4146LQI-S433) 版も作ってみました。
schematic / 回路図
As usual, top-level schematic is pretty simple, but the real world jumper wiring was a little bit of work...
例によってトップレベルの回路図はとても簡素だったのですが、ジャンパ配線はそれなりに大変でした・・・
Although the result must be trivial, let me put the pictures.
Note: I just purchased a web-camera arm, which is very helpful to take pictures of the boards.
まぁ、結果は言わずもがなですが、写真を載せておきます。
※ Webカメラ用のカメラアームを買ってみました、こういった基板デモの写真を撮るのに便利ですね。
Also, Launching the Tuner / ついでに CapSense Tuner も立ち上げておきます。
Button1 touched, LED 1 lights / ボタン1 に触れて、LED1 が光っています。
Button2 touched, LED2 lights / ボタン2に触れて LED2 が光っています。
Button3 touched, LED3 lights / ボタン3に触れて、LED3 が光っています。
And the following is the main.c. As TSoC has only 1 LED on board, I light it whenever any of the buttons is/are touched.
最後に main.c を載せておきます。TSoC には LED が一つしか搭載されていませんので、どれかのボタンがタッチされているときには、基板上の LED を点灯して、ボタンに合わせて外部の LED (LED1, LED2, LED3) を点灯するようにしています。
main.c
#include "project.h"
#define LED_ON 1u
#define LED_OFF 0u
#define BUTTON1 0x01
#define BUTTON2 0x02
#define BUTTON3 0x04
uint8_t button = 0 ;
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
EZI2C_Start() ; // <----
EZI2C_EzI2CSetBuffer1( // <----
sizeof(CapSense_dsRam), // <----
sizeof(CapSense_dsRam), // <----
(uint8_t *)&(CapSense_dsRam)) ; // <----
CapSense_Start() ;
CapSense_ScanAllWidgets() ;
for(;;) {
if (CapSense_NOT_BUSY == CapSense_IsBusy()) {
button = 0 ;
CapSense_ProcessAllWidgets() ;
CapSense_RunTuner() ; // <------
if (CapSense_IsSensorActive(CapSense_BUTTON0_WDGT_ID, CapSense_BUTTON0_SNS0_ID)) {
button |= BUTTON1 ;
LED1_Write(LED_ON) ;
} else {
LED1_Write(LED_OFF) ;
}
if (CapSense_IsSensorActive(CapSense_BUTTON0_WDGT_ID, CapSense_BUTTON0_SNS1_ID)) {
LED2_Write(LED_ON) ;
button |= BUTTON2 ;
} else {
LED2_Write(LED_OFF) ;
}
if (CapSense_IsSensorActive(CapSense_BUTTON0_WDGT_ID, CapSense_BUTTON0_SNS2_ID)) {
button |= BUTTON3 ;
LED3_Write(LED_ON) ;
} else {
LED3_Write(LED_OFF) ;
}
if (button) {
LED0_Write(LED_ON) ;
} else {
LED0_Write(LED_OFF) ;
}
CapSense_ScanAllWidgets() ;
}
}
}
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Moto-san,
I appreciate your contribution in CDC
regards