Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

User-defined functions

Status
Not open for further replies.

frahman3

Member
Hi,
Currently i'm using dspic30F6014a with 20MHz oscillator and CCS c compiler ver.5.010. I have codes that requires to call sets of user-defined functions. The current code that I'm working is as below:

SETUP_ADC(adc_OFF);
setup_adc_ports(ALL_ANALOG);
setup_adc_ports(sAN0 |sAN1|sAN2|sAN3|sAN4|sAN5|sAN6|sAN7|sAN8|sAN9|sAN10|sAN11|sAN12|sAN13|sAN14|sAN15, VSS_VDD);
setup_adc(ADC_CLOCK_DIV_64 | ADC_TAD_MUL_2);
//setup_adc(ADC_CLOCK_INTERNAL);
// Built-in A/D setup function

//measurement pair 16-1
excitation_pair_16_1();
measurement_electrode2();
measurement_electrode3();
measurement_electrode4();
measurement_electrode5();
measurement_electrode6();
measurement_electrode7();
measurement_electrode8();
measurement_electrode9();
measurement_electrode10();
measurement_electrode11();
measurement_electrode12();
measurement_electrode13();
measurement_electrode14();

ert_adc_2();
ert_adc_3();
ert_adc_4();
ert_adc_5();
ert_adc_6();
ert_adc_7();
ert_adc_8();
ert_adc_9();
ert_adc_10();
ert_adc_11();
ert_adc_12();
ert_adc_13();
ert_adc_14();


Is there a way to minimize the number of rows here? Instead of writing the code as shown above, i'm thinking to call the functions in set of array [2,3,4..14]. Is that possible? If possible is there any examples? Please advice.

TQ
Arelone
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top