0

2.8" TFT Shield with UNO_Olimex EKG Shield
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

2.8" TFT Shield with UNO_Olimex EKG Shield

by asteroid on Tue Oct 22, 2013 10:13 pm

I am using a 2.8" TFT Shield with an Arduino UNO which works fine and I am able to run the graphics test no problem. However, when an Olimex EKG Shield is interposed between the two, the TFT shield is no longer able to find the driver ( ILI9325 ). All the pins appear to run straight up from the Arduino board, through the Olimex to the TFT. I do not understand why the TFT can no longer see the driver when moved to its new location. I appreciate your time and consideration. Thank you.

asteroid
 
Posts: 295
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by franklin97355 on Wed Oct 23, 2013 1:14 am

Check the schematics. The two shields are using the same pins for two different things. The TFT shield uses digital pins D3 to D13 and analog pins A0 to A3.

franklin97355
 
Posts: 19965
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by asteroid on Fri Oct 25, 2013 1:03 pm

UNO_Olimex_TFT.tiff
UNO_Olimex_TFT.tiff (59 KiB) Viewed 1152 times
The solution is to change jumper settings on the Olimex EKG Shield: AIN_SEL set to A5 (pins 11,12) and have voltage jumper set to 5V.

asteroid
 
Posts: 295
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by asteroid on Fri Nov 01, 2013 11:18 pm


asteroid
 
Posts: 295
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by adafruit_support_bill on Sat Nov 02, 2013 7:28 am

Nice looking project! :D

adafruit_support_bill
 
Posts: 71424
Joined: Sat Feb 07, 2009 10:11 am

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by asteroid on Sat Nov 02, 2013 9:50 am

<Nice looking project!

Thank you. Display of ecg data used to be difficult for me. The addition of Adafruit's 2.8" TFT Touch Shield with accompanying libraries now makes it almost trivial.

asteroid
 
Posts: 295
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by 927465 on Fri Jul 24, 2015 10:11 am

Does anyone have a link to the code(or anyones code) for this project? I have all the parts and I would love to try it out but I was hoping to get the code but I can't find a link?

927465
 
Posts: 3
Joined: Fri Jul 24, 2015 10:08 am

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by franklin97355 on Fri Jul 24, 2015 12:34 pm

Here is some code and instructions for the shield https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/

franklin97355
 
Posts: 19965
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by 927465 on Fri Jul 24, 2015 1:13 pm

Sorry I have the general olimex ecg code already, I was looking for the code that sends the ECG signal to the TFT. I know I could figure out what the code should be if I spent a bit of time on it, I was just hoping that the code would be available already(saving me valuable time). Many Thanks, for your time.

927465
 
Posts: 3
Joined: Fri Jul 24, 2015 10:08 am

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by asteroid on Fri Jul 24, 2015 10:25 pm

Arduino sketch follows:

Code: Select all | TOGGLE FULL SIZE
// ************************************************************ //
// *  This source code is provided by the author "AS IS",       * //
// *  without warranty of any kind, either express or implied.  * //
// ************************************************************ //

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

// 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

// Determined by AIN_SEL setting on Olimex
const int analogInPin = A5;
// Longer loop time -> more beats per screen
const int LoopTime = 5000;
//const int LoopTime = 10000;

unsigned long LoopTimer = 0;

int counter = 0;
int sensorValue = 0;
float x1, y1, x2, y2;
const float spacing = 0.5;

void setup()
{
  Serial.begin(9600);
  tft.begin();
  tft.fillScreen(BLUE);
  // origin = left,top landscape
  tft.setRotation(1);
}

void loop()
{
  if (micros() > LoopTimer)
  {
   LoopTimer += LoopTime;
   sensorValue = analogRead(analogInPin); 
   Serial.println(sensorValue);   
   sensorValue = sensorValue >> 3;
   if (counter > tft.width()/spacing) { counter = 0; tft.fillScreen(BLUE); }
   if (counter == 0) { x1 = 0; y1 = tft.height() - sensorValue; }
   if (counter > 0) {
     x2 = counter*spacing;
     // Change origin to left, bottom
     y2 = tft.height() - sensorValue;
     tft.drawLine(x1, y1, x2, y2, WHITE);
     x1 = x2;
     y1 = y2;
    }
   counter++;
  }
}

asteroid
 
Posts: 295
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

by 927465 on Mon Jul 27, 2015 7:59 am

Thanks loads, this has saved me a lot of time. I really appreciate it!

927465
 
Posts: 3
Joined: Fri Jul 24, 2015 10:08 am

Please be positive and constructive with your questions and comments.