logo
Welcome, Guest. Please Login or Register.
21. December 2024, 18:58:44


Home Help Search Login RegisterWIKIUHSDR Download

Amateurfunk Sulingen
Diskussions- und Newsboard des DARC-Ortsverbandes I40  |  allgemeine Kategorie  |  Selbstbauprojekte (Moderator: DF8OE)  |  Topic: Hilfe Umprogrammiereung Smart IC Tester <- zurück vorwärts ->
Pages: [1] Go Down Print
   Author  Topic: Hilfe Umprogrammiereung Smart IC Tester  (Read 8507 times)
BO_Andy
Urgestein
*****

Offline

Posts: 726



Ich bin schon Groß und kann Alleine Laufen

View Profile E-Mail
Hilfe Umprogrammiereung Smart IC Tester
« on: 30. May 2021, 15:02:49 »

Hallo ihr lieben ich suche jemanden der mir helfen kann denn Code für das denn Smart ic Tester anzupasse so das man nicht nur ICs mit 14 und 16 Pins Testen kann. ich habe hier ist meine Überarbeitung

Quote:
//LED
#include <FastLED.h>

#define LED_PIN    46
#define NUM_LEDS    2
#define BRIGHTNESS  200
#define LED_TYPE    WS2812B

#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];

//TFT
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
#include <TouchScreen.h> //Touch Screen Library

#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // LCD RESET goes to Analog 4

#define YP A3  // must be an analog pin, use "An" notation!
#define XM A2  // must be an analog pin, use "An" notation!
#define YM 9  // can be a digital pin
#define XP 8  // can be a digital pin

#define TS_MINX 150
#define TS_MINY 120
#define TS_MAXX 920
#define TS_MAXY 940

#define MINPRESSURE 10
#define MAXPRESSURE 1000

// Assign human-readable names to some common 16-bit color values:
#define BLACK  0x0000
#define BLUE    0x001F
#define RED    0xF800
#define GREEN  0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE  0xFFFF

//TFT initialization
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

Adafruit_GFX_Button buttons[12];

//SD CARD
#include <SPI.h>
#include <SD.h>

#define chipSelect 10

//Pin Definitions
  int pin8[8] = {30, 32, 34, 36, 37, 35, 33, 31};
int pin10[10] = {30, 32, 34, 36, 38, 39, 37, 35, 33, 31};
int pin12[12] = {30, 32, 34, 36, 38, 40, 41, 39, 37, 35, 33, 31};
int pin14[14] = {30, 32, 34, 36, 38, 40, 42, 43, 41, 39, 37, 35, 33, 31};
int pin16[16] = {30, 32, 34, 36, 38, 40, 42, 44, 45, 43, 41, 39, 37, 35, 33, 31};
int pin18[18] = {30, 32, 34, 36, 38, 40, 42, 44, 50, 47, 45, 43, 41, 39, 37, 35, 33, 31};
int pin20[20] = {30, 32, 34, 36, 38, 40, 42, 44, 50, 42, 49, 47, 45, 43, 41, 39, 37, 35, 33, 31};

//Database File name
#define fname "database.txt"

//Structure Definiton for IC
typedef struct {
  String num;
  String name;
} IC;

//Function Headers
boolean testIC(String buffer, int pins);
void autoSearchResult(int mode, String number = "", String name = "", int count = 0);
void manualSearchResult(String number, String name, int status);

int screenStatus = 0, lastStatus = 0;
int *pin, pinCount = 0;

void(* resetFunc) (void) = 0;

void setup() {
  Serial.begin(9600);

  delay( 1000 ); // power-up safety delay
  FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.setBrightness(  BRIGHTNESS );

  //TFT setup
  tft_init();

  //SD Card Setup
  SD_init();

}

void loop() {

  digitalWrite(13, HIGH);
  TSPoint p = ts.getPoint();
  digitalWrite(13, LOW);
  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);

  if (p.z > MINPRESSURE && p.z < MAXPRESSURE)
  {
    //Serial.println("Z: " + String(p.z) + " X: " + String(p.x) + " Y: " + String(p.y));
    // scale from 0->1023 to tft.width
    p.x = map(p.x, TS_MINX, TS_MAXX, tft.height(), 0);
    p.y = map(p.y, TS_MINY, TS_MAXY, 0, tft.width());

    //Swapping for Set Rotation 3
    p.x = p.x + p.y;
    p.y = p.x - p.y;
    p.x = p.x - p.y;

    delay(10);
    Serial.println("(" +  String(p.x) + " , " + String(p.y) + " , " + String(p.z) + ")");

    if (screenStatus == 0)
      screenStatus = 1;

    else if (screenStatus == 1)
    {
      if (buttons
  • .contains(p.x, p.y))
          {
            Serial.println("AUTO MODE");
            screenStatus = 2;
          }
          else if (buttons[1].contains(p.x, p.y))
          {
            Serial.println("MANUAL MODE");
            screenStatus = 3;
          }
        }
        else if (screenStatus == 2)
        {
          if (buttons
  • .contains(p.x, p.y))
          {
            Serial.println("8 Pin Selected");
            screenStatus = 21;
            pinCount = 8;
          }
          else if (buttons[1].contains(p.x, p.y))
          {
            Serial.println("10 Pin Selected");
            screenStatus = 21;
            pinCount = 10;
          }
          if (buttons[2].contains(p.x, p.y))
          {
            Serial.println("12 Pin Selected");
            screenStatus = 21;
            pinCount = 12;
          }
          else if (buttons[3].contains(p.x, p.y))
          {
            Serial.println("14 Pin Selected");
            screenStatus = 21;
            pinCount = 14;
          }
          if (buttons[4].contains(p.x, p.y))
          {
            Serial.println("16 Pin Selected");
            screenStatus = 21;
            pinCount = 16;
          }
          else if (buttons[5].contains(p.x, p.y))
          {
            Serial.println("18 Pin Selected");
            screenStatus = 21;
            pinCount = 18;
          }
          if (buttons[6].contains(p.x, p.y))
          {
            Serial.println("20 Pin Selected");
            screenStatus = 21;
            pinCount = 20;
          }
        }
        else if (screenStatus == 3)
        {
          if (buttons
  • .contains(p.x, p.y))
          {
            Serial.println("Entering Keypad Mode");
            screenStatus = 30;
          }
        }
      }

      pinMode(XM, OUTPUT);
      digitalWrite(XM, LOW);
      pinMode(YP, OUTPUT);
      digitalWrite(YP, HIGH);

      if (screenStatus != lastStatus)
      {
        switch (screenStatus)
        {
          case 0: startScreen();
            break;
          case 1: modeScreen();
            break;
          case 2: autoScreen();
            break;
          case 21: autoSearch(pinCount);
            break;
          case 3: manualScreen();
            break;
          case 30: String number = getIC();
            manualSearch(number);
            break;
        }
        lastStatus = screenStatus;
      }
      delay(5);
    }

    void getTouch()
    {
      boolean status = false;
      while (1)
      {
        digitalWrite(13, HIGH);
        TSPoint q = ts.getPoint();
        digitalWrite(13, LOW);
        pinMode(XM, OUTPUT);
        pinMode(YP, OUTPUT);

        if (q.z > MINPRESSURE && q.z < MAXPRESSURE)
        {
          status = true;
          break;
        }
        delay(10);
      }

      pinMode(XM, OUTPUT);
      digitalWrite(XM, LOW);
      pinMode(YP, OUTPUT);
      digitalWrite(YP, HIGH);
    }


  • Original link zum Projekt
    https://github.com/akshaybaweja/Smart-IC-Tester
    Logged
    BO_Andy
    Urgestein
    *****

    Offline

    Posts: 726



    Ich bin schon Groß und kann Alleine Laufen

    View Profile E-Mail
    Re:Hilfe Umprogrammiereung Smart IC Tester
    « Reply #1 on: 30. May 2021, 15:08:15 »

    Ich gehe davon aus das ich irgendwo in denn bereich eine Fehler habe
     
    Quote:
    {
          if (buttons
  • .contains(p.x, p.y))
          {
            Serial.println("8 Pin Selected");
            screenStatus = 21;
            pinCount = 8;
          }
          else if (buttons[1].contains(p.x, p.y))
          {
            Serial.println("10 Pin Selected");
            screenStatus = 21;
            pinCount = 10;
          }
          if (buttons[2].contains(p.x, p.y))
          {
            Serial.println("12 Pin Selected");
            screenStatus = 21;
            pinCount = 12;
          }
          else if (buttons[3].contains(p.x, p.y))
          {
            Serial.println("14 Pin Selected");
            screenStatus = 21;
            pinCount = 14;
          }
          if (buttons[4].contains(p.x, p.y))
          {
            Serial.println("16 Pin Selected");
            screenStatus = 21;
            pinCount = 16;
          }
          else if (buttons[5].contains(p.x, p.y))
          {
            Serial.println("18 Pin Selected");
            screenStatus = 21;
            pinCount = 18;
          }
          if (buttons[6].contains(p.x, p.y))
          {
            Serial.println("20 Pin Selected");
            screenStatus = 21;
            pinCount = 20;
          }
  • « Last Edit: 31. May 2021, 10:29:33 by BO_Andy » Logged
    BO_Andy
    Urgestein
    *****

    Offline

    Posts: 726



    Ich bin schon Groß und kann Alleine Laufen

    View Profile E-Mail
    Re:Hilfe Umprogrammiereung Smart IC Tester
    « Reply #2 on: 31. May 2021, 17:48:13 »

    Ich glaube ich habe es hin bekommen jetzt nur noch gucken ob alles geht
     16224832214125566537333690873373.jpg
    Logged

    BO_Andy
    Urgestein
    *****

    Offline

    Posts: 726



    Ich bin schon Groß und kann Alleine Laufen

    View Profile E-Mail
    Re:Hilfe Umprogrammiereung Smart IC Tester
    « Reply #3 on: 31. May 2021, 17:52:08 »

    Hier noch ein Bild von Menü ich bin jetzt noch an überlegen ob ich es noch weiter mache bis 28 Pins

     16224835078669182761758816606064.jpg
    Logged

    BO_Andy
    Urgestein
    *****

    Offline

    Posts: 726



    Ich bin schon Groß und kann Alleine Laufen

    View Profile E-Mail
    Re:Hilfe Umprogrammiereung Smart IC Tester
    « Reply #4 on: 01. June 2021, 03:40:53 »

    Es Scheint soweit alles zu Funktionieren bei intresse würde ich die ZiP Datei hier im bereich mit zur Verfügung stellen

    LG BO_Andy
    Logged
    Pages: [1] Go Up Print 
    Diskussions- und Newsboard des DARC-Ortsverbandes I40  |  allgemeine Kategorie  |  Selbstbauprojekte (Moderator: DF8OE)  |  Topic: Hilfe Umprogrammiereung Smart IC Tester <- zurück vorwärts ->
    Jump to: 


    Login with username, password and session length

     Es wird die Verwendung von Browsern die auf der "Blink"-Engine basieren und mindestens
    1024x768 Pixel Bildschirmauflösung für die beste Darstellung empfohlen
     
    Amateurfunk Die Beiträge sind, sofern nicht anders vermerkt, unter der folgenden Lizenz veröffentlicht:
    GNU Free Documentation License 1.3 GNU Free Documentation License 1.3
    verbindet!
    Powered by MySQL Powered by PHP Diskussions- und Newsboard des DARC-Ortsverbandes I40 | Powered by YaBB SE
    © 2001-2004, YaBB SE Dev Team. All Rights Reserved.
    - modified by Andreas Richter (DF8OE)
    Impressum & Disclaimer
    Valid XHTML 1.0! Valid CSS!