The electronic dice I posted last time was very popular. So, I used the switch to start and stop the dice, but this time replace it with CapSence.
This example is used PSoC 6 BLE Pioneer Kit CY8CKIT-062-BLE with PSoC Creator4.2 or 4.3. I used PSoC 6 this time, but I think that PSoC 4 can also be used. If PSoC 4 is available, I will check it and upload it.
The block diagram of H/W is as follows.
I just added CapSence to the previous H/W block.
CapSence is used as switch for start and stop instead of SW2. Button0 and 1 are added.
The whole circuit looks like this:
The software flow chart is shown below. Timer is set start if Button0 is active when sw is off (= 0). If Button1 is active when sw is on (= 1), the timer period is set longer and the LED lighting is delayed. It keeps its speed for 1.5 seconds and stops lighting. Please see the attached program for details.
In the code example, the code of SW2 is left. If you uncomment “#define SW2” in the 12th line of main.c file, it replace with the version of SW2. This concludes the general description.
Next time, I would like to design improving board, “Adults are impure after all. Allowing only you set any eyes of the dice without letting your child know”. You will definitely win.
Thank you very much for sharing your Code Example.
We appreciate your contribution for this.