- Mark as New
- Subscribe to RSS Feed
- Report Inappropriate Content
The electronic dice I posted last time was very popular. Many people have requested that we make on PSoC 4 version, so I made it based on CY8CKIT-044. I have also
created a new LED lighting board. This time it is based on Arduino.
The environment used is as follows:
・PSoC Creator 4.3
The block diagram of the hardware is same as LED Test. The H/W block diagram is shown below.
Once the H/W check posted last time is completed, the electronic dice will be completed by changing the decoding circuit, adding SW, and changing the program. Please refer to the previous article for LED wiring and pin assignment. The circuit on PSoC 4 is as follows.
Pin SW2 is Input and Pull Up. Read the value programmatically with GPIO input.
The pin assignments are as follows.
The PWM is set earlier than last time. Actually, the program is more effective.
When the SW2 button is pressed, the dice start to roll, and when they are released, the dice slows down the rolling and stops.
uint32_t sw=0; //sw is off (Stop rolling dicce)
CyGlobalIntEnable; /* Enable global
your initialization/startup code here (e.g. MyInst_Start()) */
PWM_1_Start(); // Start
/* Roll dice slowly */
CyDelay(1500); // keep
rolling slowly for 1.5sec
PWM_1_Stop();// Stop rolling dice
sw=0; // sw is off
PSoC 345 LP