Capacitive Button with PIC16F1934 TOUCHDATA Problem
Posted: Wed Mar 27, 2013 6:36 am
Hello,
I'm new on PIC and CCS C but on the other hand eager about this. I would like to use the mtouch system but i couldn't. I have got some problem with CCS C because when i did compile this code i have got 2 warnings like this.
"Variable never used: TOUCHPADSTATUS
Variable never used: TOUCHDATA"
The compiler version is V4.114
The PIC I am using is 16F1934
Code:
#include <CapSensButt.h>
#USE TOUCHPAD (PIN_B0='A')
#FUSES NOWDT //No Watch Dog Timer
#FUSES ECH
#FUSES WDT_SW
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOCLKOUT
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOWRT //Program memory not write protected
#FUSES NOVCAP
#FUSES PLL
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES BORV19
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(clock=8000000)
void main(void){
setup_lcd(LCD_DISABLED);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
char c;
while(TRUE)
{
TOUCHPAD_STATE(1);
enable_interrupts(GLOBAL);
c = TOUCHPAD_GETC(); //will wait until one of declared pins is detected
//if PIN_B0 is pressed, c will get value 'A'
if(c=='A')
{
output_high(PIN_A0);
delay_ms(1000);
while(touchpad_hit());
output_high(PIN_A0);
}
}
}
What should i do ?
Whats my fault ? Could u help me pls ?
Thanks alot. Have a nice day.
Ttelmah
Joined: 11 Mar 2010 Posts: 19553
Posted: Wed Mar 27, 2013 7:21 am
Nothing.
They are just warnings. The same applies when you add 'ERRORS' to #use rs232. The functions return extra data 'in case' you want it. The compiler warns you if you don't use this, but there is nothing wrong with not doing so.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum