atmega328p mutual qtouch

Go To Last Post
32 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

#include <avr/io.h>
#include <avr/interrupt.h>
#define __delay_cycles(n)     __builtin_avr_delay_cycles(n)
#define __enable_interrupt()  sei()

#include "touch_api.h"
#include "touch.h"
/*----------------------------------------------------------------------------
                            manifest constants
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                    macros
----------------------------------------------------------------------------*/

#define GET_SENSOR_STATE(SENSOR_NUMBER) qt_measure_data.qt_touch_status.sensor_states[(SENSOR_NUMBER/8)] & (1 << (SENSOR_NUMBER % 8))
#define GET_ROTOR_SLIDER_POSITION(ROTOR_SLIDER_NUMBER) qt_measure_data.qt_touch_status.rotor_slider_values[ROTOR_SLIDER_NUMBER]

/*----------------------------------------------------------------------------
                            type definitions
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                prototypes
----------------------------------------------------------------------------*/
extern void touch_measure(void);
extern void touch_init( void );
extern void init_system( void );
extern void init_timer_isr(void);
extern void set_timer_period(uint16_t);
/*----------------------------------------------------------------------------
                            Structure Declarations
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                    macros
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                global variables
----------------------------------------------------------------------------*/
/* Timer period in msec. */
uint16_t qt_measurement_period_msec = QT_MEASUREMENT_PERIOD_MS;
uint16_t time_ms_inc=0;
/*----------------------------------------------------------------------------
                                extern variables
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
                                static variables
----------------------------------------------------------------------------*/

/* flag set by timer ISR when it's time to measure touch */
volatile uint8_t time_to_measure_touch = 0u;

/* current time, set by timer ISR */
volatile uint16_t current_time_ms_touch = 0u;

/*============================================================================
Name    :   main
------------------------------------------------------------------------------
Purpose :   main code entry point
Input   :   n/a
Output  :   n/a
Notes   :
============================================================================*/

int main( void )
{

   /* initialise host app, pins, watchdog, etc */
    init_system();

    /* configure timer ISR to fire regularly */
    init_timer_isr();

    /* Initialize Touch sensors */
    touch_init();

    /* enable interrupts */
    __enable_interrupt();

    /* loop forever */
    for( ; ; )
    {
        touch_measure();

    /*  Time Non-critical host application code goes here  */
    }
}

this is the code i want to make selfcap qtouch but when building the project it gives me a error  given below ......


Error		recipe for target 'main.o' failed
Error		recipe for target 'touch.o' failed
Error		touch_api_ptc.h: No such file or directory
Error		touch_api_ptc.h: No such file or directory	

it would be appreciable if you can help me....

Rjchoudhary

Last Edited: Fri. Jul 3, 2020 - 10:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Rajat choudhary wrote:
it would be appreciable if you can help me....
Well the reason is right there in front of you:

Rajat choudhary wrote:

Error		touch_api_ptc.h: No such file or directory

This means one of two things. Either the header file simply is not there at all or it is present but when #include tries to find it, it is not being told to look in the right place. I suspect the latter. So you probably need some kind of -I to give an additional location where headers should be searched. In As7 this can be done in "Directories" within the project compiler configuration. This is an example of the kind of thing...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rajat choudhary wrote:
this is the code

I rather doubt that is the complete code!

 

the project

You need to give more detail!

 

  • What tools are you using?
  • What "project" is it - where did you get it? or how did you create it?
  • etc

 

 

it gives me a error  given below ......

No, those are not the errors - that's just a very brief summary!

 

Assuming Atmel studio, See https://www.avrfreaks.net/commen... to get the complete details - in the 'Output' window.

 

EDIT

 

clawson beat me to it.

 

More on Include Paths:

 

https://www.avrfreaks.net/commen...

 

As noted there, this is really nothing specific to AVR or Atmel Studio - this is the same stuff that would apply to setting up any 'C' project in any IDE for any target.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Jul 3, 2020 - 11:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Note that the ATmega328P doesn't have a hardware touch controller - so the ATmega328PB  might be a better bet if you specifically need this?

 

The  ATmega328PB Xplained Mini  has 2 touch buttons:

 

 

https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATMEGA328PB-XMINI

 

When you plug that into Atmel Studio, it will be automatically detected, and Studio will give you ready-to-go examples to work with those buttons.

 

I would strongly suggest that you get one, and use that to gain familiarity with this stuff!

 

It also gives you an on-board debugger.

 

It costs under $10.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Jul 3, 2020 - 11:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


awneil wrote:
Studio will give you ready-to-go examples to work with those buttons

Sadly, it won't.

Microchip have failed to deliver on that one!

 

sad

 

Starting with 'New ASF Example Project...' gives just 2 examples - neither of which uses touch:

 

 

And START has only one - again, nothing with touch:

 

 

sad

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

So the next place to look is always the Product Page:

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen...

 

In this case:

 

https://www.microchip.com/wwwproducts/en/ATmega328PB

 

Where we find Application Note  AN_42652 - AT12075: ATmega328PB Xplained Mini Demo :

 

 

Even this is not quite right - as it refers to a different version of the board:

 

 

The current shipping version doesn't have a slider it has 2 separate buttons - see the picture in #4:

 

 

frown

 

But the Project does build, and it does run on the target.

 

If you slide your finger from BTN1 to BTN2, the LED comes on; and sliding from BTN2 to BTN1 turns it off again:

 

https://photos.app.goo.gl/iUhMyL... <-- video of the project in action (they still haven't got inline video to work on this site)

 

 

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Jul 3, 2020 - 04:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Googling "ATmega328PB Xplained Mini touch" finds this:

 

https://microchipsupport.force.com/s/article/How-to-get-started-with-QTouch-and-Data-Visualizer-in-ATmega328PB-Xplained-mini

 

 

Sadly, as noted in #5, there is no such example.

 

angry

 

There are 42 "touch" examples for other chips, but nothing for the mega328PB (or, in fact, any mega):

 

 

angry

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Further googling finds this:

 

 

Following the instructions there, I did manage to create a Project using the 2 buttons on the ATmega328PB XPlained mini:

 

https://photos.app.goo.gl/E6NadwGMuLXTAuGp8   <-- video of the project in action

 

So  BTN1 turns the LED on, and BTN2 turns it off.

 

Notes

  1. START doesn't automatically set up the LED - you have to specifically include that in the Project, or just do it "manually".
  2. the buttons on this board are Self-Cap - not Mutual.
  3. the instructions linked above tell you to use stuff from touch_example.c, but don't tell you where to find it - it is under 'examples'.

 

 

 

 

Attachment(s): 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jul 6, 2020 - 09:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sir i have tried to make the sample code from microchip developer website: https://microchipdeveloper.com/touch:intro-to-ptc-hands-on-project

and the same error i am getting again and again i can't figure it out the directories problem.so can you suggest me the steps...

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Rajat choudhary wrote:
the sample code from microchip developer website

I don't see any actual "sample code" there - it's just a set of instructions for how you are supposed to create your own code.

 

So go back and make sure they you have completely and exactly followed all the steps.

 

Note that it is a "legacy" tool:

 

 

- so maybe it isn't actually (fully) working any more?

 

i am getting again and again i can't figure it out the directories problem.so can you suggest me the steps...

It's all been clearly explained in #2 and the linked thread in #3:

  1. The error message tells you what header was not found
  2. You need to find where that header actually is
  3. You need to add that location to your Include Paths

 

Obviously, if the header is not actually present on your system at all, then no amount of fiddling with Include Paths will help!

In this case, this means that there is something missing from your setup - so you'd need to work out what that is, and where to obtain it.

Again, as this is a legacy tool, it may well be that it is no longer available at all.

 

Perhaps you'd be better off with START - which is the current tool.

As I showed above, that does work.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Jul 4, 2020 - 08:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes i have done that but still not working..now its getting very complicated for me to understand the things required to make a qtouch project..what i have done wrong or what i should do please suggest me.

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have specified three places for it to look for #include files.

 

It's telling you that the file it's looking for is "touch_api_ptc.h

 

So is that file in one of those three places ?

 

Also:

 

Please read #3 again, and pay attention to the bit about the 'Output' window ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Jul 4, 2020 - 09:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

awneil wrote:
You have specified [only] three places for it to look for #include files.

These are the Include Paths in the working project that I posted (in #8):

 

 

Clearly, your project is missing a lot !!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Jul 4, 2020 - 09:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No i can't see any thing which will help me to find those folders. The folders you have mentioned above is not in my system.....and if there any way to find those tell me please .

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Again, you're using an out-of-date tool - is it really worth pursuing?

 

Why not just use the current, supported tool?

 

 i can't see any thing which will help me to find those folders

Go on - this is basic PC user stuff.

 

You find these files the same way you'd find anything on a PC:

 

Use the Windows File Explorer to find where those files are!

 

https://edu.gcfglobal.org/en/windowsbasics/finding-files-on-your-computer/1/

 

Once you know where they are, then you can add those locations into your Include Paths.

 

But, again, the tool should really have done this for you - so this suggests that there is something fundamentally wrong with your setup, and/or you have not properly followed the instructions.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Sat. Jul 4, 2020 - 10:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sir can you please suggest me a mutual ptc qtouch code which will work properly...I'm trying a lot to find those files but couldn't get..

Rjchoudhary

Last Edited: Sat. Jul 4, 2020 - 10:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

suggest me a mutual ptc qtouch code

I already have done - See #8.

 

I'm trying a lot to find those files

The files are either on your system, or they're not. It's a simple search.

 

If they're not then, yet again:

you're using an out-of-date tool - is it really worth pursuing?

 

Why not just use the current, supported tool?

which takes us back to #8

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sir..

 

Please share the support link again as below link is not working so i could go with the suggested steps.

 

Following the instructions there, I did manage to create a Project using the 2 buttons on the ATmega328PB XPlained mini:

 

https://photos.app.goo.gl/E6Nadw... <-- video of the project in action

 

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmmm ... dunno what's happened to that link; I'll try again:

 

https://photos.app.goo.gl/P5VXQqbBRQdLCPUQA

 

EDIT

 

also fixed the link in #8 - the forum had stuck some spurious junk on the end of the URL

 

sad

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jul 6, 2020 - 09:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have downloaded qtouch library 5.9 and qtouch compressor 5.9.
Whenever i create a code for mutual cap qtouch it comes with error of file missing.

I am really unable to understand how i can generate the code for working on qtouch

Rjchoudhary

Last Edited: Mon. Jul 6, 2020 - 10:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have followed all the instructions you have suggested..but my atmel studio has still same problem

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

in #10, I wrote:
Note that it is a "legacy" tool ...  so maybe it isn't actually (fully) working any more? 

 

also in #10, I further wrote:
as this is a legacy tool, it may well be that it is no longer available at all.

 

Perhaps you'd be better off with START - which is the current tool.

As I showed above, that does work.

 

In #15, I wrote:
Again, you're using an out-of-date tool - is it really worth pursuing? ... Why not just use the current, supported tool?

 

in #17, I wrote:
yet again:

you're using an out-of-date tool - is it really worth pursuing?

 

Why not just use the current, supported tool?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jul 6, 2020 - 10:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What i find in my atmel is qtouch library and compressor 5.9..now what tool i need and from where i can download it please suggest

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rajat choudhary wrote:
compressor 5.9

* Composer

 

..now what tool i need and from where i can download it please suggest

Go on - how many times do you want me to repeat it?

 

See #8

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello sir, here i have attached a file of mutualcap ptc qtouch.it is building with no errors but code is not working when i am uploading it to my controller....can you look into it and suggest me any solution.

Attachment(s): 

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What testing / investigation / debugging have you done to find why it's "not working" ?

 

https://www.avrfreaks.net/commen...

 

I don't have your hardware, so can't test it.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i tried to upload in a hardware which have already configured for mutual touch i just find out the sensor's pin connected on controller and made this code..

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

that doesn't answer the question.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As you suggested me i made the code according to my hardware.....so where i can test this.

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Standard stuff:

  • Connect your debugger.
  • Set breakpoints.
  • Step through the code.
  • Examine variables. memory, etc
  • Use LEDs, printf, etc

 

QTouch specific:

  • Use the QTouch diagnostic tools

 

Again: How To Debug.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I made changes like led on when sensor being touched and its in the same position now(not working) and also i have attached usart to print something but didn't work...

Rjchoudhary

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sir, do you have anything then tell me....please

Rjchoudhary