Show Posts
Pages: 1 [2] 3 4 ... 228
16  Using Arduino / Project Guidance / Re: 2-fan controller with OLED Display and navigation knob? on: July 16, 2014, 05:22:49 pm
Sorry, not that I know of, but then again I don't have nor have ever used a OLED display before.
17  Using Arduino / Programming Questions / Re: Nontrivial compiling issues on: July 16, 2014, 03:52:03 pm
You downloaded the library but where did you put it?
Also this "LCD12864.h" should be this <LCD12864.h> in the library is not in the same folder as the sketch.
18  Using Arduino / Project Guidance / Re: 2-fan controller with OLED Display and navigation knob? on: July 16, 2014, 03:50:07 pm
Why not use a 5" TFT touch screen? There are plenty on ebay, and they usually work with the UTFT and UTouch libraries. I also have a Library that works with both of them and gives you a wide array of functions you can use.
19  Using Arduino / Displays / Re: Help with Unknown TFT LCD on: July 16, 2014, 09:21:53 am
The things you would need to change are located in the Hardware folder > avr > HW_ATmega32U4, but unless you know what your doing, and/or have the datasheet for that display, you won't be able to change it.

You have a third party display, that is not supported by Henning's original library, so many sellers have modified versions that only work with their displays. You need to try and contact the seller and see exactly what library works.
20  Using Arduino / Programming Questions / Re: Array question on: July 16, 2014, 09:02:16 am
Oh, ok. I will delete my last post.

But that still leaves which 3 LEDs are not coming on.
21  Using Arduino / Programming Questions / Re: Array question on: July 16, 2014, 08:50:10 am
Are you using the arduino pins directly, if so you have not set the pinMode for them in the setup() function.
22  Using Arduino / Programming Questions / Re: Compiling Errors trying to use the TFT-library on: July 16, 2014, 08:45:12 am
Yea, its a mess. The Robot_Control library also has the Adafruit_GFX.h and Adafruit_ST7735.h libraries, but the TFT library is already made from both of them.

Just another issue the Arduino Team needs to fix.
23  Using Arduino / Programming Questions / Re: Compiling Errors trying to use the TFT-library on: July 16, 2014, 08:36:54 am
 smiley
24  Using Arduino / Programming Questions / Re: Xbox 360 wireless controller programming issue on: July 16, 2014, 08:35:31 am
Maybe I misread it, but this seems like a no-brainer.

Use a simple IF statement to see if the Y button is pressed and if so, digitalWrite(circlePin, LOW); digitalWrite(hwb, LOW);
25  Using Arduino / Programming Questions / Re: Compiling Errors trying to use the TFT-library on: July 16, 2014, 08:29:27 am
Take out these:

#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>

Do you still get any errors?
26  Using Arduino / Programming Questions / Re: Compiling Errors trying to use the TFT-library on: July 16, 2014, 08:20:19 am
I do need it because need the functions from it like:
abstanderhalten(); and ebeneber(getd1(),getd2(),getd3());
27  Using Arduino / Programming Questions / Re: Compiling Errors trying to use the TFT-library on: July 16, 2014, 07:45:07 am
Where did you download that adafruit library, because I'm looking that the original library HERE, and see no such variable "newcolor" in this function, Adafruit_ST7735::Color565(uint8_t, uint8_t, uint8_t), in the library.

Could you post your full code.
28  Using Arduino / Programming Questions / Re: Array question on: July 16, 2014, 12:35:09 am
You don't have an index 12, so Red[12](blue and green too) is a random piece of memory. Your range is 0 - 11 and not 0 - 12
29  Using Arduino / Project Guidance / Re: Android tablet as keypad for RFID door entry on: July 15, 2014, 09:11:43 pm
Look in the Examples folder, its called Password.

My apologies, I did not update that sketch in a long time so it is using the old ITDB02 libraries, instead of the UTFT and UTouch libraries.

Here is the fixed version.
Code:

#include <Wire.h>
#include <UTouch.h>
#include <UTFT.h>
#include <TFT_Extension.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
//myGLCD(RS,WR,CS,RST,ALE,mode);
UTFT myGLCD(ITDB32S,A1,A2,A0,A3,A5);   //
UTouch  myTouch(13,10,11,12,A4);
TFT_Extension myTFT(&myGLCD, &myTouch, LANDSCAPE);

char * text[4][3] = {
  {"1","2","3"},
  {"4","5","6"},
  {"7","8","9"},
  {"*","0","#"}
};

char Pass[5];
char master[5] = "2651";
int Pcount=0;
int XC,YC;
int PassCounter=0;
byte orient = LANDSCAPE;

void setup()
{
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.setFont(SmallFont);
  myTouch.InitTouch(LANDSCAPE);
  myTouch.setPrecision(PREC_EXTREME);
  for(int line = 0; line <= 239; line++) // custom background color
  {
    myGLCD.setColor(0, 0, line);//text color White 
    myGLCD.drawLine(0, line, 319, line);
  }
  PassWord_makeButton();
  PassWord_buttonText();
  //RUN();
}

void loop()
{
  myTouch.read();
  int tx = myTouch.TP_X;
  int ty = myTouch.TP_Y;
  XC= constrain (map(tx, 205, 3900,0,239),0,239);
  YC= constrain (map(ty, 300, 3850,0,319),0,319);
  GetNum(XC,YC);
}

void RUN()
{
  //  while(1) // Not using the Loop() function,
  //  {
  //    myTouch.read();
  //    int tx = myTouch.TP_X;
  //    int ty = myTouch.TP_Y;
  //    XC= constrain (map(tx, 205, 3900,0,239),0,239);
  //    YC= constrain (map(ty, 300, 3850,0,319),0,319);
  //    GetNum(XC,YC);
  //  }
}

void PassWord_makeButton()
{
  for(int y = 0; y < 300;y+=100)
  {
    for(int x = 0; x < 200; x+=50)
    {
      drawButton(20+x,90+y,50+x,30+y); // this will draw the button on the screen by so many pixels
    }
  }
  return;
}

void drawButton(int x1, int y1,int x2, int y2)
{
  myGLCD.setColor(170,170,170); // grey
  myGLCD.fillRoundRect(y1-3, x1+3, y2-3, x2+3);//Button Shading 

  myGLCD.setColor(255, 255, 255); // white
  myGLCD.fillRoundRect(y1, x1, y2, x2);// outter button color

  myGLCD.setColor(200,0,0); // red
  myGLCD.fillRoundRect(y1-5, x1+5, y2+5, x2-5);//inner button color
  return;
}

void PassWord_buttonText()
{
  myGLCD.setFont(BigFont);
  myGLCD.setBackColor(200, 0, 0);
  myGLCD.setColor(255,255,255);
  for(int tr = 0; tr < 300; tr+=100)
  {
    for(int tc = 0; tc < 200; tc+=50)
    {
      char *myText = text[tc/50][tr/100];
      myGLCD.print(myText,52+tr,27+tc,0); //this will print the number into the center of the buttons
    }
  }
}

void GetNum(int tx,int ty) {
  char * lastText;
  for(int tr = 0; tr < 300; tr+=100)
  {
    for(int tc = 0; tc < 200; tc+=50)
    {
      char *myText = text[tc/50][tr/100];
      if(myTFT.TouchButton((90+tr),(20+tc),(30+tr),(50+tc),XC,YC)) // this check to see if any of the buttons were pressed, then it sends the corresponding number to the "check" function
      {
        check(*myText);
      }
    }
  }
}


void check(char pass)
{
  myGLCD.setFont(BigFont);
  Pass[Pcount] = pass;  //store incoming numbers in an array
  myGLCD.print(Pass,CENTER, 1); // show the password as it is being entered

  if(Pcount == 3)// only when the array is filled, does it check the numbers
  {
    delay(1000);
    if(!strcmp(Pass, master)) // compare the password to the master password
    {
      myGLCD.print("GOOD",CENTER, 1);
      delay(1000);
      myGLCD.print("    ",CENTER, 1);
    }
    else
    {
      myGLCD.print("FAIL",CENTER, 1);
      delay(1000);
      myGLCD.print("    ",CENTER, 1);
    }
    clearPassword(); // Clear the password
  }

  Pcount++;
  if(Pcount > 3) // this ensure the count does not exceed the maximum lenght of the password
  {
    Pcount = 0;
    PassCounter = 0;
  }
}

void clearPassword()
{
  byte i = 3;
  while(i != 0)
    Pass[i--] = NULL;
}
30  Using Arduino / Displays / Re: Help with Unknown TFT LCD on: July 15, 2014, 03:43:43 pm
What are you trying to do, because you can't remap the pins without changing the hardware.
Pages: 1 [2] 3 4 ... 228