SAMD21 QT1 example - Where these numbers come from

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

Hi, I'm going through the example code for SAMD21 Xplained Pro board with the QT1 mutual capacitance board, and there are a few arbitrary numbers that I couldn't find out where they come from. Hoping someone could point me in the right direction. I posted the example code onto GitHub. The links in this post points there.

 

First one is where do the 0x80 come from for the buttons on line 120? I got that the sensors number (0 and 1) are tied to what's shown in the touch configurator in Harmony3 config, but not the 0x80. Next is the slider_position shifted by 5 bits (line 156), then the wheel position shifted by 2 (line 243).

 

Thanks!

Last Edited: Sun. Jan 2, 2022 - 08:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Answering my own question, the first 0x80 looks to be just for the QT1 with a touch usually registers 133 so 0x80 (128). The other bit shifts looks like they're there to map the outputs to the LEDs.