Jump to content

LowFilter

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About LowFilter

  • Rank
    Newbrie
  1. Yes, compiling! I'll let you know if it works or not Thanks a lot!
  2. Thanks very much guys! I'll try that tomorrow and i'll let you know
  3. Hi everybody! here is my program: #include <system.h> #define mode PORTA.1; #define dis1 PORTC.0; #define dis2 PORTC.1; #define dis3 PORTC.2; void main() { TRISA = 0xFF; //sets PORTA as input TRISC = 0; //sets PORTC as output ADCON0 = ADCON0 & 0x0E; //A/D converter registers ADCON0 = ADCON0 | 0x08; ADCON1 = ADCON1 & 0xFC; ADCON1 = ADCON1 | 0x04; unsigned short int hundreds, tens, units, b, c, e, sel; unsigned int sound; unsigned int tempo; ADCON0 = ADCON0 | 1; // starts AD conversion sel = ADRES; if(mode == 1) //Sound Mode { if(0<=sel<=50) //sound number detection { // sound=1; // } // if(51<=sel<=100) // { // sound=2; // } // if(101<=sel<=150) // { // sound=3; // } // if(151<=sel<=200) // { // sound=4; // } // if(201<=sel<=255) // { // sound=5; // } //end of sound number detection sound= sound << 4; dis1=1;dis2=0;dis3=0; //enables display 1 PORTB = PORTB & 0x0F; //to display 0 dis1=0;dis2=1;dis3=0; //enables display 2 PORTB = PORTB & 0x0F; //to display 0 dis1=0;dis2=0;dis3=1; //enables display 3 PORTB = PORTB & 0x0F; PORTB = PORTB | sound; // to display sound } else //Tempo Mode { tempo = sel + 20; //Tempo detection hundreds = tempo / 100; //hundreds detection b = hundreds * 100; c = Tempo - b; tens = c / 10; //tens detection e = tens * 10; units = tempo - b - e; //units detection hundreds << 4; tens << 4; units << 4; dis1=1;dis2=0;dis3=0; //enables display 1 PORTB = PORTB & 0x0F; PORTB = PORTB | hundreds; // to display hundreds dis1=0;dis2=1;dis3=0; //enables display 2 PORTB = PORTB & 0x0F; PORTB = PORTB | tens; //to display tens dis1=0;dis2=0;dis3=1; //enables display 3 PORTB = PORTB & 0x0F; PORTB = PORTB | units; // to display units } ADCON0 = ADCON0 & 0xFE; } and here is what is written by the BoostC when I try to compile it: "C:\Program Files\Matrix Multimedia\C4PICs16\sourceboost\boostc.pic16.exe" -t PIC16F77 MF1.c BoostC Optimizing C Compiler Version 6.57 (for PIC16 architecture) http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Licensed to C4PICs User under Site Full License for 10 node(s) Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only MF1.c failure C:\Documents and Settings\enrsdela\My Documents\Matrix Multimedia\C4PICs16\MF1\MF1.c(7): error: missing semicolon C:\Documents and Settings\enrsdela\My Documents\Matrix Multimedia\C4PICs16\MF1\MF1.c(7): error: failure Failed to locate output file 'MF1.obj' Done Failed I know this problem already happened to many people, but none of the topics already available on the forum have been helpful... help please!!! Thanks
×
×
  • Create New...