1,7 → 1,7 |
#include ".\main.h" |
|
#define LED1 PIN_C6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
#define LED2 PIN_C5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
#define LED1 PIN_C6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER |
#define LED2 PIN_C5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER |
#define LED3 PIN_C4 //CHANGE PIN_XX TO YOUR LED PIN NUMBER |
#define LED4 PIN_D3 //CHANGE PIN_XX TO YOUR LED PIN NUMBER |
|
32,11 → 32,8 |
#define DIVISOR 99 // 20 kHz |
//#define DIVISOR 39 // 50 kHz |
|
#define regreseM (2.02) |
#define regreseN (-451) |
#define MAX_OUTPUT 706 |
|
|
|
void sound_beep( unsigned int lenght, int16 frequency) |
{ |
unsigned int i; |
54,7 → 51,7 |
unsigned int16 napeti; |
unsigned int1 button_press; // semafor pro cteni tlacitek |
|
setup_adc_ports(sAN0|VSS_VDD); |
setup_adc_ports(sAN0|VSS_VREF); |
setup_adc(ADC_CLOCK_DIV_2); |
setup_spi(SPI_SS_DISABLED); |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
67,9 → 64,6 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
setup_oscillator(OSC_8MHZ); |
|
// set_pwm1_duty(0); |
// set_pwm2_duty(0); |
|
output_high(LED1); |
output_high(LED2); |
output_high(LED3); |
127,7 → 121,7 |
{ |
button_press=true; |
sound_beep(100,700); |
if(setpoint < (1023-5) )setpoint+=5; |
if(setpoint < (MAX_OUTPUT-5) )setpoint+=5; |
} |
} |
|
149,7 → 143,7 |
{ |
button_press=true; |
sound_beep(100,500); |
if(setpoint < 1023 )setpoint++; |
if(setpoint < MAX_OUTPUT )setpoint++; |
} |
} |
|