Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
#include "G:\Aruna\My Electronic projects\servo tester\main.h"void main(){ INT16 preset = 0; INT16 time = 1500; INT16 temp1 = 0; INT16 temp2 = 0; INT16 i = 0; INT16 j = 0; setup_adc_ports (sAN2|VSS_VDD); setup_adc (ADC_CLOCK_INTERNAL); setup_timer_0 (RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1 (T1_DISABLED); setup_comparator (NC_NC); setup_vref (FALSE); //set_adc_channel (2); //delay_us (100); // TODO: USER CODE!! WHILE (1) { output_high (PIN_A4); delay_us (2000); output_low (PIN_A4); delay_us (20000 - 2000) ; }}
You won't be able to return them easily. Basically you would send it off to China and hope in a few months they will refund you. If you want your money back, claim that you never received your items - usually they dont ship with tracking so you will win the case. Not entirely ethical but I had to do it once for a product that I received that was a scam.
#include "G:\Aruna\My Electronic projects\servo tester\main.h"void main(){ INT16 preset = 0; INT16 time = 1500; INT16 temp1 = 0; INT16 temp2 = 0; INT16 i = 0; INT16 j = 0; setup_adc_ports (sAN2|VSS_VDD); setup_adc (ADC_CLOCK_INTERNAL); setup_timer_0 (RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1 (T1_DISABLED); setup_comparator (NC_NC); setup_vref (FALSE); //set_adc_channel (2); //delay_us (100); // TODO: USER CODE!! WHILE (1) { /* preset = read_adc (); WHILE ( ! adc_done ()) { } temp1 = preset / 1023; temp2 = 1800 * temp1; time = 600 + temp2; temp1 = 0; temp2 = 0; */ FOR (i = 0; i < 150; i++) { output_high (PIN_A4); delay_us (2200); output_low (PIN_A4); delay_us (20000); } FOR (i = 0; i < 150; i++) { output_high (PIN_A4); delay_us (1500); output_low (PIN_A4); delay_us (20000) ; } FOR (i = 0; i < 150; i++) { output_high (PIN_A4); delay_us (900); output_low (PIN_A4); delay_us (20000) ; } }}
HiThe code above won't work.The period of the pulses is 20000ms. But since you're doing a delay of 2200ms before that, the total period is 22200ms. Not good.Why aren't you using the internal timer?
hiits us not ms