نمایش نتایج: از 1 به 6 از 6
Like Tree2 لایک
  • 2 Post By pcminister

موضوع: راه اندازی کی پد خازنی xd-62b ttp229

  1. #1
    Junior Member
    تاریخ عضویت
    Jan 2015
    نوشته ها
    5

    راه اندازی کی پد خازنی xd-62b ttp229

    سلام

    من توی بخش راهنما تاپیکی پیدا نکردم بنابر این تاپیکیدم!

    به شدت این کی پد روی اعصاب بود اما بالاخره حل شد. ضمنا رابطش i2c نیست.

    کد:
    //Test program for TTP229-B 16 capacitive keys module //The module works with a basic serial interface : // The arduino sends a clock on the SCL pin and retrieves a bit from the SDO // pin for each clock step //When delivered, the module is only capable of 8 keys, single touch, active low //To access options, it is necessary to solder pins on the the P1 and P2 headers // and use straps to enable the different functions //P1 : 3 enables the 16 keys mode //P1 : 2 enables active high mode //P1 : 4 and P2 : 5 : multitouch mode : if both are strapped, full 16 keys // multitouch is enabled //The GetKeys function retrieves all 16 keys. // Bit 15 is key 1 and bit 0 is key 15 //If the 8 keys mode is enabled, then the two bytes of the integer // have the same value //The module has to be wired to the following Arduino pins : // TTP Arduino // VCC 5V // GND GND // SCL D13 (or modify the CLOCK define) // SDO D12 (or modify the KEYS define) #define KEYS 12 #define CLOCK 13 unsigned int keys = 0; void setup() { Serial.begin(9600); pinMode(KEYS, INPUT); pinMode(CLOCK, OUTPUT); delay(100); } unsigned int GetKeys() { keys = 0; byte currbit = LOW; delay(3); //after 2ms without clock, the TTP229 resets, //so, this ensures to get the 16 keys in the expected order for (byte i=0;i<16;i++) { digitalWrite(CLOCK,HIGH); delayMicroseconds(10); digitalWrite(CLOCK,LOW); delayMicroseconds(10); currbit = digitalRead(KEYS); if (currbit==HIGH) { //= If active High is set. Otherwise, invert the test keys=keys*2+1; } else { keys=keys*2; } } return keys; } void loop() { Serial.println(GetKeys(), BIN); delay(100); }
    توجه داشته باشید این کد خیلی پیشرفته نیست و فقط با توجه به کلیدی که فشار میدید 0 و 1 نمایش میده!

    فقط میتونید با این متوجه بشید که سالمه. همین.

  2. #2
    Senior Member
    تاریخ عضویت
    Jan 2015
    محل سکونت
    ایران
    نوشته ها
    238
    دوست من وجود پایه scl و sdo به مناب ارتباط I2C هت.
    شما تونستید مستقیم هم راه بندلزید

  3. #3
    Junior Member
    تاریخ عضویت
    Jan 2015
    نوشته ها
    5
    اصلا پایه هایی که توی برنامه ازشون نام برده شده که i2c نیستن!

    اگر هم i2c باشه به نظر من خیلی عالیه که با پینهای دیگه هم جواب میده.

    شما اینو باید ببینی و باهاش کار کنی که ببینی چجوری راه میوفته.

    Scl , sda ؟ یا sd0

    من چون تخصص ندارم فقط به گذاشتن دیتاشیت بسنده میکنم:
    TTP229.pdf

  4. #4
    Junior Member
    تاریخ عضویت
    Feb 2015
    نوشته ها
    2
    مستقیم یعنی چه؟!

  5. #5
    Junior Member
    تاریخ عضویت
    Nov 2013
    محل سکونت
    GB
    نوشته ها
    6

    کی پد لمسی

    نقل قول نوشته اصلی توسط aiohalaziz نمایش پست ها
    مستقیم یعنی چه؟!
    کی پد لمسی خازنی

  6. #6
    Junior Member
    تاریخ عضویت
    Nov 2013
    محل سکونت
    GB
    نوشته ها
    6
    کی پد لمسی خازنی
    سید محمد رضا حاجی میرزایی
    رباتیک موسسه آموزش عالی خاوران مشهد

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •  

SEO by vBSEO