- 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
Hi
I tried with CY8CKIT-059.
main.c
=====================
#include "project.h"
#define DELTA_VALUE 5
int main(void)
{
int period = 1000 ;
int count = 0 ;
int comp = 0 ;
int delta = DELTA_VALUE ;
CyGlobalIntEnable; /* Enable global interrupts. */
for(;;)
{
if (count < comp) {
LED_Write(0) ;
} else {
LED_Write(1) ;
}
count++ ;
if (count >= period) {
count = 0 ;
comp += delta ;
if (comp >= period) {
delta = -DELTA_VALUE ;
} else if (comp <= 0) {
delta = DELTA_VALUE ;
}
}
CyDelayUs(1) ;
}
}
=====================
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I tried with CY8CKIT-059.
main.c
=====================
#include "project.h"
#define DELTA_VALUE 5
int main(void)
{
int period = 1000 ;
int count = 0 ;
int comp = 0 ;
int delta = DELTA_VALUE ;
CyGlobalIntEnable; /* Enable global interrupts. */
for(;;)
{
if (count < comp) {
LED_Write(0) ;
} else {
LED_Write(1) ;
}
count++ ;
if (count >= period) {
count = 0 ;
comp += delta ;
if (comp >= period) {
delta = -DELTA_VALUE ;
} else if (comp <= 0) {
delta = DELTA_VALUE ;
}
}
CyDelayUs(1) ;
}
}
=====================
moto