Hello,
Turn the LED on/off using the Cy_CapSense_IsProximitySensorActive () function provided for Proximity based on the Simple Proximity Sensor Demo posted earlier
The previous CE was a program that brightened and darkened the LED according to the distance. When using proximity sensing to turn the switch on and off, it is easy to use the provided Cy_CapSense_IsProximitySensorActive () function.
The program in the main.c file has been changed as follows.
-------------
static void process_touch(void)
{
uint32_t prox_status;
static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
prox_status = Cy_CapSense_IsProximitySensorActive (
CY_CAPSENSE_PROXIMITY0_WDGT_ID,
CY_CAPSENSE_PROXIMITY0_SNS0_ID,
&cy_capsense_context);
if((prox_status & 0x3) == 0){
led_data.state=LED_OFF;
}
else
{
led_data.state=LED_ON;
}
update_led_state(&led_data);
}
------------
Please use the one of Simple Proximity Sensor Demo (TARGET_CY8CKIT-062-BLE.zip) for CapSense and peripheral settings. Only the project is attached here.
Thanks,
Kenshow
Hello,
I wanted a simple proximity sensor demo that would work on ModusToolbox, but there isn’t one, so I made one.
The base was based on the CapSense sample for MTB and CE218137.
The environment used is as follows:
・ModusToolbox 2.2.1
・CY8CKIT-062-BLE
The settings of the peripherals (Pin and CapSense) are the same as CE218137, but they are set for ModusToolbox.
First, the CapSense settings are configured in the CapSense Configurator, which is the same as CE218137.
The LED and PWM are set programmatically, as it is using the CapSense sample for ModusToolbox.
The touch process is as follows:
-----------------
static void process_touch(void)
{
static uint32_t currentProxData = 0u;
static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
if(CY_CAPSENSE_PROXIMITY0_SNS0_DIFF0_VALUE >
CY_CAPSENSE_PROXIMITY0_FINGER_TH_VALUE)
{
/*If proximity value is not within the range, cap the value */
if((CY_CAPSENSE_PROXIMITY0_SNS0_DIFF0_VALUE -
CY_CAPSENSE_PROXIMITY0_FINGER_TH_VALUE)
<= UINT8_MAX)
{
/* Store the proximity data */
currentProxData = (uint8_t)(CY_CAPSENSE_PROXIMITY0_SNS0_DIFF0_VALUE -
CY_CAPSENSE_PROXIMITY0_FINGER_TH_VALUE);
}
/* Store the maximum value otherwise */
else
{
currentProxData = (uint8_t)UINT8_MAX;
}
}
led_data.brightness = currentProxData;
update_led_state(&led_data);
}
-----------------
CapSense Tuner can be used in this sample, so please use it for fine adjustment.
Thanks,
Kenshow
Show LessHello,
Since I created an ON / OFF switch program using a proximity sensor (Simple Proximity Sensor Demo using Cy_CapSense_IsProximitySensorActive API on PSoC6 for MTB2.2), I made a 7th dice using it. When you bring your hand closer, the dice rotate, and when you move your hand away, it slowly stops. A description of the 7-eyes dice for MTB can be found in Let's make the dice of seven eyes on PSoC 6 with DMA & Beep for ModusToolBox2.2.
As a matter of fact, the proximity sensing program by MTB has created a project with a shared library up to this program, so all BSP settings are common. Therefore, please use the BSP of Simple Proximity Sensor Demo.
The environment used is as follows:
・ModusToolbox 2.2.1
・CY8CKIT-062-BLE
Thanks,
Kenshow
To all,
Here is a new LED matrix driver component. It is highly based on the Cypress/Infineon component of the same type except it extends the number of maximum Commons from 8 to 16.
It uses the Cypress API interface and should be directly compatible to the Cypress component with the following exception:
Target PSoCs:
If you find issues with this component, please send me private messages. I will see what I can do to apply a fix.
Show LessI planned this program to show the minimum usage of the basic components of PSoC
and to help testing a new board or peripheral when application is yet to be written.
このプログラムは PSoC を初めて使用する方に基本的なコンポーネントの使い方をお見せするとともに
新しく作った基板や周辺をアプリケーションが出来る前に試せるようにと考えて作ってみました。
More than a couple weeks has passed since I posted CY8CKIT-044 version of this program.
And what I learned during this period is that PSoC 6 is different from PSoC 4!
Anyway, here is the first PSoC 6 version of this program.
このプログラムの CY8CKIT-044 版を投稿してから、既に2週間以上が経ってしまいました。
その間で学んだことは、PSoC 6 は PSoC 4 とは違う!という事でした。
何はともあれ、このプログラムの PSoC 6 用の初版です。
When you build and program or debug, you will see something like below.
Basically the same help message is displayed.
Except the last one and the prompt.
プロジェクトをビルドして書込むかデバッグを開始すると下記のような表示になります。
基本的に前回のものと同じです、
最後の命令とプロンプトを除いては。
Assuming that the E-Ink Shield is mounted on your CY8CKIT-062-BLE.
Enter "i2c" at the prompt.
Now prompt changes to "CM0P:i2c>"
Enter "scan" to scan the I2C bus... it finds a device at 0x68, which is the BMI160 on the E-Ink Shield.
We can read its ID from the register address 0.
So enter "readreg 0", then expected ID of D1 is returned.
CY8CKIT-062-BLE に付いてくる E-Ink シールドを接続した状態で
プロンプトに "i2c" と入力します。
するとプロンプトは "CM0P:i2c>" にかわります。
更に "scan" と入力すると I2C バス上にあるデバイスを探し始め... 0x68 にデバイスがあることが分かります、
これは E-Ink シールドに乗っている BMI160 センサーです。
このセンサはレジスタアドレス 0 を読むと ID を返すことになっています。
そこで "readreg 0" と入力すると、予定通り ID の D1 が返されました。
Now let's try the catch of the day!
Either push "reset" key or Enter "return" to return to the "CM0P:>" prompt.
Then enter "cm4" to switch the core to the CorTex-M4.
The splash says that it is "MCU Tester (CM4)..." and the last command is now "cm0".
Here we can use all commands in the previous mode, except "cm4".
For example, if you enter "i2c" same set of commands are available.
それでは今回の目玉を実験しましょう!
基板の RST ボタンを押すか、"return" コマンドを入力して "CM0P:>" プロンプトに戻ってください。
そこで "cm4" と入力すると、使用コアが CorTex-M4 に変わります。
オープニングメッセージも "MCU Tester (CM4) ..." となってコマンドリストの最後は cm0 に変わっています。
ここで cm0 の時に使えたコマンドは cm4 を除き全て同様に使用できます。
例えば ”i2c" と入力すると I2C モードで使用できた全てのコマンドがここでも使えます。
To return the root prompt, enter "return".
Then enter "mem" to test the Memory Mode.
According to the TRM of PSoC 6/62 SRAM seems to be starting from 0x08000000.
So please enter "dump 0x08000000" to see what in the memory now.
トップレベルのプロンプトに戻るには、"return" を入力します。
次にメモリーモードを試したいので、"mem" と入力してください。
PSoC 6/62 の TRM によると、SRAM は 0x08000000 から始まっているようなので
"dump 0x08000000" と入力して、今、メモリーの中に何が入っているのか見てください。
Enter "return" to go back to the root prompt.
Then enter "cm0" to switch the core to CorTex-M0+.
Now we are home.
再度、トップレベルのプロンプトに戻るのに "return" と入力してください。
その後、"cm0" と入力すると CorTex-M0+ のコアに戻ることができます。
ただいま!
To explain all the commands will take some time and energy, so let me cheat by saying that...
For other commands, please refer to the page of the previous version below.
コマンド全ての説明はかなり長くなってしまいますので、各コマンドについては
先のヴァージョンの説明がある以下の URL をご参照ください。
MCU Tester, a Swiss Army Knife for PSoC (CY8CKIT-044 version)
moto
27-May-2020 First introduction lines were added
28-May-2020 Sensor name corrected to BMI160
28-May-2020 There were source/header for spi and i2c missing with the first attachment. Attached file was replace with 200528A version.
2-Feb-2021 A version for CY8CKIT-062-WiFi-BT was added.
15-Feb-2021 A version for CY8CPROTO-063-BLE was added.
Show LessHello:
I am trying to add a custom service to the example code in CE217643 i.e. the BLE Temperature Measurement
with PSoC 6 MCU with BLE Connectivity, Health Thermometer Profile example application.
I have added a custom service to the ble GATT server via the schematic BLE block parameters tool.
The custom service has only one custom characteristic, the default uint8 field with read prosperities set.
The custom descriptor had one field the uint8 default.
I was looking for where the event handler or callback was/is for the custom service so I could access the custom characteristic value.
Why in the generated code module cyble_custom.c function Cy_BLE_CUSTOM_EventHandler... is there no code for handling a CY_BLE_CUSTOM_SERVER that my example is?
How ? and where ? do I write the Cy_BLE_CUSTOM_EventHandler for a CY_BLE_CUSTOM_SERVER?
What events in the handler do I need to look for, and what is in them?
Thanks Brian
Show LessHi,
I am uploading annotation component for the CY8CKIT-042 PSoC4 Pioneer Kit.
The component helps visualizing ports and pins and creating connection diagrams for CY8CKIT-042 PSoC4 Pioneer Kit. It shows pins with direct connection to the ADC_SAR bypass capacitor, OpAmps, USB-I2C bridge, USB-UART bridge, RGB LEDs, Capsense pad, Switch and PMOD connector.
The KIT-042 annotation component can be used in conjunction with Cypress stock annotation components (capacitors, resistors, etc.) as well as small-sized annotation components from the complimentary PSoC Annotation Library:
Attached archive contains KIT-042 component library. Upon installation it will show up in the folder:
/Community/Off-Chip/Annotation Library/Kits/
The component provided as-is, no liabilities. It is free to use, modify and distribute.
regards,
odissey1
Figure 1. Component default appearance
Figure 2. Typical component use in conjunction with complimentary PSoC Annotation Library (Diffeferntial pre-amp example).
As per the current implementation of PSoC4 BLE upgradable stack OTA example project, bonding data is not shared between "Application" and "Stack" projects.
So that, user has to connect and bond again with stack project before performing firmware update over the air.
Steps to be followed to perform firmware update over the air
Both "Application" and "Stack" projects store bonding data at different locations. That is the reason why user need to connect and bond with the stack project before performing firmware update over the air.
The solution is to make the "Application" and "Stack" projects share the bonding data between them. Below steps are followed to share the bonding data between "Application" and "Stack" projects. Both “Application” and “Stack” projects store the bonded device list in the structure “cyBle_flashStorage” separately.
Changes made to the Upgradable Stack OTA example project.
Updated project is attached with this post.
Show LessI am trying to get the DebugPrintf function working in CE220331 example project, and do not get anything via Tera Term.
I have enabled #define UART_DEBUG_ENABLE (true) in uart_debug.h .
Any hints would help.
Thanks
Brian
Show LessI decided to create a tutorial on various design strategies of reading multiple digital inputs (up to 16) and calculating each frequency.
Although intended to help students and those new to embedded processing, it can be used by anyone for the attached example projects and as a refresher.
I've attached a workspace with 8 projects each implementing different methods in different combinations. Each project is an improvement on the previous one.
Here are the different methods used:
I've also attached a document describing each of the 8 projects with:
The document includes Appendices about:
Requirements:
Target Hardware:
The example code is free to be used and modified for your own projects.
Enjoy!
Len
Show LessEsteemed Contributor
Honored Contributor II
Esteemed Contributor
Honored Contributor
Valued Contributor
Employee
Contributor
New Contributor II
Contributor
Expert II