Forum Members section Show your controller New build.

New build.


Post Number:#1 Post Wed Sep 17, 2014 4:36 am
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

ok so this all fairly new to me, from programing to writing code to building so I will be asking alot of Questions :-\ . First can feduino be connected to a PC power supply, I am planning to use the power supply for most of if not the whole controller system plus LED lighting. I want to mount the unit in a small ATX pc case, along with relay switch boards and led drivers I will have six 50w 5 channel led pucks, 4 ac power heads, 2 heaters, 1 aquanitics 1/4 horse chiller, 1 asm g3 skimmer, two colling fans (one top of tank, one top of sump. both are 12v dc), 6 fans 12v for leds, and 1 return pump reeflo snapper/dart hybrid. please any help will be greatly appreciated.
Happy reefing to all.
Christopher Kindig

Post Number:#2 Post Wed Sep 17, 2014 9:28 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

First can feduino be connected to a PC power supply


Yes, you can use 12V or 5V.

With 12V the regulator will heating a bit, maybe need a small fan to cooling it.

The 5V can be connected directly on pin 5V but, you need of a good power supply because it bypasses the regulator, also haven't protection to polarity inverted. On this case you'll supply dosing pumps with 12V from PC power supply.

4 ac power heads


Ferduino haven't code to control AC stream pumps.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Wed Sep 17, 2014 5:21 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America


Post Number:#4 Post Fri Sep 19, 2014 8:06 am
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

Hi Fernando.

I would like some info on how to connect the 16 relay 120v board to ferduino, plus I pulled a bonehead move and ordered a TFT touch screen 4.3 display and does not have a shield can I still use it or do I have to have the shield? As far as the relay board, I should connect to analog pins so it is off and on only no PWM correct? Thanks for your help and time in advance, look forword to getting this up and running.
Happy reefing to all.
Christopher Kindig

Post Number:#5 Post Fri Sep 19, 2014 9:52 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I pulled a bonehead move and ordered a TFT touch screen 4.3 display and does not have a shield can I still use it or do I have to have the shield?


I think that this TFT is compatible with the pinout of Ferduino Mega, no need shield. But the program will not fill all the TFT.

As far as the relay board, I should connect to analog pins so it is off and on only no PWM correct?


It's right but, to a relay board of 16 channels is better use the pins available on connector DB25. This pins are controlled by PCF8575 so will not spend pins on Atmega 2560.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#6 Post Fri Sep 19, 2014 2:30 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

You can use an adapter like this.

Image


Or this

Image


On this case the pinout on connector 2x13 isn't compatible with the relay board so, you need cut the cable to adjust it.

If you have the board powered with 12V, this voltage will be available on connector DB25 on pins called V = VIN. You can use this 12V to supply the relay board.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Fri Sep 19, 2014 10:53 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America


Post Number:#8 Post Fri Sep 19, 2014 11:40 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Maybe you can find on links above.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#9 Post Sun Sep 21, 2014 8:45 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America


Post Number:#10 Post Tue Sep 23, 2014 4:26 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

plan to use the 16 port relay board to control the ac pumps, as well as all other ac components.





AC wave pump gone, got an MP-40. :D
Happy reefing to all.
Christopher Kindig

Post Number:#11 Post Tue Sep 23, 2014 4:34 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Ferduino can't control a Vortech MP-40.

Buy a Jebao WP-40.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#12 Post Tue Sep 23, 2014 8:55 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

Hi!

Ferduino can't control a Vortech MP-40.

Buy a Jebao WP-40.

Best regards.



sorry was excited it is jebao wp-40, also I am having a problem getting my display to come up on ferduino board. I am getting this message. So this my seem like an odd question, how do you declare in the scope?


This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Mega 2560 or Mega ADK"
UTFT_Demo_480x272:22: error: 'ITDB43' was not declared in this scope
Happy reefing to all.
Christopher Kindig

Post Number:#13 Post Tue Sep 23, 2014 10:59 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil


Post Number:#14 Post Wed Sep 24, 2014 8:04 am
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

I tried the new and still had just a white screen, is there some thing that i am doing wrong? I tried the Ferduino code first, then the UTFT code that manufacture suggested, then the code that came from the link, they all said same thing. UTFT not declaired. Like I had mentioned before I am very new to writing code. @-) Also I watched your you tube video and followed start to finish on my desktop and was able to copy your file to Arduino and delete origonal, then inserted linked code in environment.
Happy reefing to all.
Christopher Kindig

Post Number:#15 Post Wed Sep 24, 2014 9:53 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Try send the example of calibration using the library UTFT above.

I'm not sure if this TFT is compatible with the board.

If you have a TFT shield can try use it.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#16 Post Wed Sep 24, 2014 11:48 am
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

I will send once I get up this afternoon, I just ordered the shield last night it will take a fe days to get to me. Also can you tell where tofind the 40 pin adapter and cable that you used on your build thanks for your time and help, when I get a little extra I will donate. You have helped so many people you should be proud of your accomplishments. ^:)^
Happy reefing to all.
Christopher Kindig

Post Number:#17 Post Wed Sep 24, 2014 11:12 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

// UTFT_Demo_480x272 (C)2014 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of how to use most of the functions
// of the library with a supported display modules.
//
// This demo was made for modules with a screen resolution
// of 480x272 pixels.
//
// This program requires the UTFT library.
//

#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Set the pins to the correct ones for your development shield
// ------------------------------------------------------------
// Arduino Uno / 2009:
// -------------------
// Standard Arduino Uno/2009 shield            : <display model>,A5,A4,A3,A2
// DisplayModule Arduino Uno TFT shield        : <display model>,A5,A4,A3,A2
//
// Arduino Mega:
// -------------------
// Standard Arduino Mega/Due shield            : <display model>,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Mega      : <display model>,38,39,40,41
//
// Remember to change the model parameter to suit your display module!
UTFT myGLCD(ITDB43,38,39,40,41);

void setup()
{
  randomSeed(analogRead(0));
 
// Setup the LCD
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
}

void loop()
{
  int buf[478];
  int x, x2;
  int y, y2;
  int r;

// Clear the screen and draw the frame
  myGLCD.clrScr();

  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, 479, 13);
  myGLCD.setColor(64, 64, 64);
  myGLCD.fillRect(0, 258, 479, 271);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1);
  myGLCD.setBackColor(64, 64, 64);
  myGLCD.setColor(255,255,0);
  myGLCD.print("<http://electronics.henningkarlsen.com>", CENTER, 259);

  myGLCD.setColor(0, 0, 255);
  myGLCD.drawRect(0, 14, 479, 257);

// Draw crosshairs
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(239, 15, 239, 256);
  myGLCD.drawLine(1, 135, 478, 135);
  for (int i=9; i<470; i+=10)
    myGLCD.drawLine(i, 133, i, 138);
  for (int i=15; i<256; i+=10)
    myGLCD.drawLine(237, i, 241, i);

// Draw sin-, cos- and tan-lines 
  myGLCD.setColor(0,255,255);
  myGLCD.print("Sin", 5, 15);
  for (int i=1; i<478; i++)
  {
    myGLCD.drawPixel(i,135+(sin(((i*1.13)*3.14)/180)*95));
  }
 
  myGLCD.setColor(255,0,0);
  myGLCD.print("Cos", 5, 27);
  for (int i=1; i<478; i++)
  {
    myGLCD.drawPixel(i,135+(cos(((i*1.13)*3.14)/180)*95));
  }

  myGLCD.setColor(255,255,0);
  myGLCD.print("Tan", 5, 39);
  for (int i=1; i<478; i++)
  {
    myGLCD.drawPixel(i,135+(tan(((i*1.13)*3.14)/180)));
  }

  delay(2000);
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(239, 15, 239, 256);
  myGLCD.drawLine(1, 135, 478, 135);

// Draw a moving sinewave
  x=1;
  for (int i=1; i<(478*20); i++)
  {
    x++;
    if (x==479)
      x=1;
    if (i>479)
    {
      if ((x==239)||(buf[x-1]==135))
        myGLCD.setColor(0,0,255);
      else
        myGLCD.setColor(0,0,0);
      myGLCD.drawPixel(x,buf[x-1]);
    }
    myGLCD.setColor(0,255,255);
    y=135+(sin(((i*1.65)*3.14)/180)*(90-(i / 100)));
    myGLCD.drawPixel(x,y);
    buf[x-1]=y;
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some filled rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillRect(150+(i*20), 46+(i*20), 210+(i*20), 106+(i*20));
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some filled, rounded rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillRoundRect(330-(i*20), 46+(i*20), 270-(i*20), 106+(i*20));
  }
 
  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some filled circles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillCircle(180+(i*20),75+(i*20), 30);
  }
 
  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some lines in a pattern
  myGLCD.setColor (255,0,0);
  for (int i=15; i<256; i+=5)
  {
    myGLCD.drawLine(1, i, (i*1.88)-10, 256);
  }
  myGLCD.setColor (255,0,0);
  for (int i=256; i>15; i-=5)
  {
    myGLCD.drawLine(478, i, (i*1.88)-11, 15);
  }
  myGLCD.setColor (0,255,255);
  for (int i=256; i>15; i-=5)
  {
    myGLCD.drawLine(1, i, 491-(i*1.88), 15);
  }
  myGLCD.setColor (0,255,255);
  for (int i=15; i<256; i+=5)
  {
    myGLCD.drawLine(478, i, 490-(i*1.88), 256);
  }
 
  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some random circles
  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=32+random(416);
    y=45+random(178);
    r=random(30);
    myGLCD.drawCircle(x, y, r);
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some random rectangles
  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(476);
    y=16+random(239);
    x2=2+random(476);
    y2=16+random(239);
    myGLCD.drawRect(x, y, x2, y2);
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

// Draw some random rounded rectangles
  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(476);
    y=16+random(239);
    x2=2+random(476);
    y2=16+random(239);
    myGLCD.drawRoundRect(x, y, x2, y2);
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(476);
    y=16+random(239);
    x2=2+random(476);
    y2=16+random(239);
    myGLCD.drawLine(x, y, x2, y2);
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,256);

  for (int i=0; i<10000; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    myGLCD.drawPixel(2+random(476), 16+random(239));
  }

  delay(2000);

  myGLCD.fillScr(0, 0, 255);
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRoundRect(160, 70, 319, 169);
 
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("That's it!", CENTER, 93);
  myGLCD.print("Restarting in a", CENTER, 119);
  myGLCD.print("few seconds...", CENTER, 132);
 
  myGLCD.setColor(0, 255, 0);
  myGLCD.setBackColor(0, 0, 255);
  myGLCD.print("Runtime: (msecs)", CENTER, 243);
  myGLCD.printNumI(millis(), CENTER, 258);
 
  delay (1000);





this is the code that came up from the link that you gave me. any time I try to load it, it says 'ITDB43' was not declared in this scope

-------------------------------- Last edited Wed Sep 24, 2014 7:21 pm --------------------------------

// UTouch_Calibration (C)2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program can be used to calibrate the touchscreen
// of the display modules.
// This program requires the UTFT library and a touch
// screen module that is compatible with UTFT.
//
// It is assumed that the display module is connected to an
// appropriate shield or that you know how to change the pin
// numbers in the setup.
//
// Instructions will be given on the display.
//

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

// Define the orientation of the touch screen. Further
// information can be found in the instructions.
#define TOUCH_ORIENTATION  PORTRAIT

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Uncomment the next two lines for the Arduino 2009/UNO
//UTFT        myGLCD(ITDB24D,19,18,17,16);   // Remember to change the model parameter to suit your display module!
//UTouch      myTouch(15,10,14,9,8);

// Uncomment the next two lines for the Arduino Mega
UTFT        myGLCD(ITDB43,38,39,40,41);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(6,5,4,3,2);

uint32_t cx, cy;
uint32_t rx[10], ry[10];
uint32_t clx, crx, cty, cby;
float px, py;
int dispx, dispy, text_y_center;
uint32_t calx, caly, cals;
char buf[13];

void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);

  myTouch.InitTouch(TOUCH_ORIENTATION);
  myTouch.setPrecision(PREC_LOW);
  dispx=myGLCD.getDisplayXSize();
  dispy=myGLCD.getDisplayYSize();
  text_y_center=(dispy/2)-6;
}

void drawCrossHair(int x, int y)
{
  myGLCD.drawRect(x-10, y-10, x+10, y+10);
  myGLCD.drawLine(x-5, y, x+5, y);
  myGLCD.drawLine(x, y-5, x, y+5);
}

void readCoordinates()
{
  int iter = 2000;
  int cnt = 0;
  uint32_t tx=0;
  uint32_t ty=0;
  boolean OK = false;
 
  while (OK == false)
  {
    myGLCD.setColor(255, 255, 255);
    myGLCD.print("*  PRESS  *", CENTER, text_y_center);
    while (myTouch.dataAvailable() == false) {}
    myGLCD.print("*  HOLD!  *", CENTER, text_y_center);
    while ((myTouch.dataAvailable() == true) && (cnt<iter))
    {
      myTouch.read();
      tx += myTouch.TP_X;
      ty += myTouch.TP_Y;
      cnt++;
    }
    if (cnt>=iter)
    {
      OK = true;
    }
    else
    {
      tx = 0;
      ty = 0;
      cnt = 0;
    }
  }

  cx = tx / iter;
  cy = ty / iter;

}

void calibrate(int x, int y, int i)
{
  myGLCD.setColor(255, 255, 255);
  drawCrossHair(x,y);
  myGLCD.setBackColor(255, 0, 0);
  readCoordinates();
  myGLCD.setColor(255, 255, 255);
  myGLCD.print("* RELEASE *", CENTER, text_y_center);
  myGLCD.setColor(80, 80, 80);
  drawCrossHair(x,y);
  rx[i]=cx;
  ry[i]=cy;
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
  }
}

void waitForTouch()
{
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
  }
  while (myTouch.dataAvailable() == false) {}
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
  }
}

void toHex(uint32_t num)
{
  buf[0] = '0';
  buf[1] = 'x';
  buf[10] = 'U';
  buf[11] = 'L';
  buf[12] = 0;
  for (int zz=9; zz>1; zz--)
  {
    if ((num & 0xF) > 9)
      buf[zz] = (num & 0xF) + 55;
    else
      buf[zz] = (num & 0xF) + 48;
    num=num>>4;
  }
}

void startup()
{
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, dispx-1, 13);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.drawLine(0, 14, dispx-1, 14);
  myGLCD.print("UTouch Calibration", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);

  if (dispx==220)
  { 
    myGLCD.print("Use a stylus or something", LEFT, 30);
    myGLCD.print("similar to touch as close", LEFT, 42);
    myGLCD.print("to the center of the", LEFT, 54);
    myGLCD.print("highlighted crosshair as", LEFT, 66);
    myGLCD.print("possible. Keep as still as", LEFT, 78);
    myGLCD.print("possible and keep holding", LEFT, 90);
    myGLCD.print("until the highlight is", LEFT, 102);
    myGLCD.print("removed. Repeat for all", LEFT, 114);
    myGLCD.print("crosshairs in sequence.", LEFT, 126);
    myGLCD.print("Touch screen to continue", CENTER, 162);
  }
  else
  {
    myGLCD.print("INSTRUCTIONS", CENTER, 30);
    myGLCD.print("Use a stylus or something similar to", LEFT, 50);
    myGLCD.print("touch as close to the center of the", LEFT, 62);
    myGLCD.print("highlighted crosshair as possible. Keep", LEFT, 74);
    myGLCD.print("as still as possible and keep holding", LEFT, 86);
    myGLCD.print("until the highlight is removed. Repeat", LEFT, 98);
    myGLCD.print("for all crosshairs in sequence.", LEFT, 110);

    myGLCD.print("Further instructions will be displayed", LEFT, 134);
    myGLCD.print("when the calibration is complete.", LEFT, 146);

    myGLCD.print("Do NOT use your finger as a calibration", LEFT, 170);
    myGLCD.print("stylus or the result WILL BE imprecise.", LEFT, 182);

    myGLCD.print("Touch screen to continue", CENTER, 226);
  }

  waitForTouch();
  myGLCD.clrScr();
}

void done()
{
  myGLCD.clrScr();
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, dispx-1, 13);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.drawLine(0, 14, dispx-1, 14);
  myGLCD.print("UTouch Calibration", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
 
  if (dispx==220)
  { 
    myGLCD.print("To use the new calibration", LEFT, 30);
    myGLCD.print("settings you must edit the", LEFT, 42);
    myGLCD.setColor(160, 160, 255);
    myGLCD.print("UTouchCD.h", LEFT, 54);
    myGLCD.setColor(255, 255, 255);
    myGLCD.print("file and change", 88, 54);
    myGLCD.print("the following values. The", LEFT, 66);
    myGLCD.print("values are located right", LEFT, 78);
    myGLCD.print("below the opening comment.", LEFT, 90);
    myGLCD.print("CAL_X", LEFT, 110);
    myGLCD.print("CAL_Y", LEFT, 122);
    myGLCD.print("CAL_S", LEFT, 134);
    toHex(calx);
    myGLCD.print(buf, 75, 110);
    toHex(caly);
    myGLCD.print(buf, 75, 122);
    toHex(cals);
    myGLCD.print(buf, 75, 134);
  }
  else
  { 
    myGLCD.print("CALIBRATION COMPLETE", CENTER, 30);
    myGLCD.print("To use the new calibration", LEFT, 50);
    myGLCD.print("settings you must edit the", LEFT, 62);
    myGLCD.setColor(160, 160, 255);
    myGLCD.print("UTouchCD.h", LEFT, 74);
    myGLCD.setColor(255, 255, 255);
    myGLCD.print("file and change", 88, 74);
    myGLCD.print("the following values.", LEFT, 86);
    myGLCD.print("The values are located right", LEFT, 98);
    myGLCD.print("below the opening comment in", LEFT, 110);
    myGLCD.print("the file.", LEFT, 122);
    myGLCD.print("CAL_X", LEFT, 150);
    myGLCD.print("CAL_Y", LEFT, 162);
    myGLCD.print("CAL_S", LEFT, 174);

    toHex(calx);
    myGLCD.print(buf, 75, 150);
    toHex(caly);
    myGLCD.print(buf, 75, 162);
    toHex(cals);
    myGLCD.print(buf, 75, 174);
  }
 
}

void loop()
{
  startup();
 
  myGLCD.setColor(80, 80, 80);
  drawCrossHair(dispx-11, 10);
  drawCrossHair(dispx/2, 10);
  drawCrossHair(10, 10);
  drawCrossHair(dispx-11, dispy/2);
  drawCrossHair(10, dispy/2);
  drawCrossHair(dispx-11, dispy-11);
  drawCrossHair(dispx/2, dispy-11);
  drawCrossHair(10, dispy-11);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("***********", CENTER, text_y_center-12);
  myGLCD.print("***********", CENTER, text_y_center+12);

  calibrate(10, 10, 0);
  calibrate(10, dispy/2, 1);
  calibrate(10, dispy-11, 2);
  calibrate(dispx/2, 10, 3);
  calibrate(dispx/2, dispy-11, 4);
  calibrate(dispx-11, 10, 5);
  calibrate(dispx-11, dispy/2, 6);
  calibrate(dispx-11, dispy-11, 7);
 
  if (TOUCH_ORIENTATION == LANDSCAPE)
    cals=(long(dispx-1)<<12)+(dispy-1);
  else
    cals=(long(dispy-1)<<12)+(dispx-1);

  if (TOUCH_ORIENTATION == PORTRAIT)
    px = abs(((float(rx[2]+rx[4]+rx[7])/3)-(float(rx[0]+rx[3]+rx[5])/3))/(dispy-20));  // PORTRAIT
  else
    px = abs(((float(rx[5]+rx[6]+rx[7])/3)-(float(rx[0]+rx[1]+rx[2])/3))/(dispy-20));  // LANDSCAPE

  if (TOUCH_ORIENTATION == PORTRAIT)
  {
    clx = (((rx[0]+rx[3]+rx[5])/3));  // PORTRAIT
    crx = (((rx[2]+rx[4]+rx[7])/3));  // PORTRAIT
  }
  else
  {
    clx = (((rx[0]+rx[1]+rx[2])/3));  // LANDSCAPE
    crx = (((rx[5]+rx[6]+rx[7])/3));  // LANDSCAPE
  }
  if (clx<crx)
  {
    clx = clx - (px*10);
    crx = crx + (px*10);
  }
  else
  {
    clx = clx + (px*10);
    crx = crx - (px*10);
  }
 
  if (TOUCH_ORIENTATION == PORTRAIT)
    py = abs(((float(ry[5]+ry[6]+ry[7])/3)-(float(ry[0]+ry[1]+ry[2])/3))/(dispx-20));  // PORTRAIT
  else
    py = abs(((float(ry[0]+ry[3]+ry[5])/3)-(float(ry[2]+ry[4]+ry[7])/3))/(dispx-20));  // LANDSCAPE

  if (TOUCH_ORIENTATION == PORTRAIT)
  {
    cty = (((ry[5]+ry[6]+ry[7])/3));  // PORTRAIT
    cby = (((ry[0]+ry[1]+ry[2])/3));  // PORTRAIT
  }
  else
  {
    cty = (((ry[0]+ry[3]+ry[5])/3));  // LANDSCAPE
    cby = (((ry[2]+ry[4]+ry[7])/3));  // LANDSCAPE
  }
  if (cty<cby)
  {
    cty = cty - (py*10);
    cby = cby + (py*10);
  }
  else
  {
    cty = cty + (py*10);
    cby = cby - (py*10);
  }
 
  calx = (long(clx)<<14) + long(crx);
  caly = (long(cty)<<14) + long(cby);
  if (TOUCH_ORIENTATION == LANDSCAPE)
    cals = cals + (1L<<31);

  done();
  while(true) {}
}






and I get the same error with this one.


Board: "Arduino Mega 2560 or Mega ADK"
UTouch_Calibration:31: error: 'ITDB43' was not declared in this scope
Happy reefing to all.
Christopher Kindig

Post Number:#18 Post Thu Sep 25, 2014 9:58 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Put the new UTFT in libraries folder.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#19 Post Fri Sep 26, 2014 1:38 am
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

Just like file swap for ferduino code?

-------------------------------- Last edited Thu Sep 25, 2014 9:39 pm --------------------------------

Just like file swap for ferduino code?
Happy reefing to all.
Christopher Kindig

Post Number:#20 Post Fri Sep 26, 2014 8:24 am
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

Ok so I figured out it was something that I was doing wrong but I still get just a white screen so I am going to whait for the shild to get to me then try again. Thank you for your help Fernando.

-------------------------------- Last edited Fri Sep 26, 2014 4:24 am --------------------------------

Ok so I figured out it was something that I was doing wrong but I still get just a white screen so I am going to whait for the shild to get to me then try again. Thank you for your help Fernando.
Happy reefing to all.
Christopher Kindig

Next



Return to Show your controller





Who is online

Users viewing this topic: No registered users and 1 guest

cron