2.8" TFT Shield with UNO_Olimex EKG Shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
asteroid
 
Posts: 300
Joined: Tue Oct 22, 2013 9:10 pm

2.8" TFT Shield with UNO_Olimex EKG Shield

Post by asteroid »

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.

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by Franklin97355 »

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.

User avatar
asteroid
 
Posts: 300
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by asteroid »

UNO_Olimex_TFT.tiff
UNO_Olimex_TFT.tiff (59 KiB) Viewed 1431 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.

User avatar
asteroid
 
Posts: 300
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by asteroid »


User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by adafruit_support_bill »

Nice looking project! :D

User avatar
asteroid
 
Posts: 300
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by asteroid »

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

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

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by 927465 »

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?

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by Franklin97355 »

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

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

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by 927465 »

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.

User avatar
asteroid
 
Posts: 300
Joined: Tue Oct 22, 2013 9:10 pm

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by asteroid »

Arduino sketch follows:

Code: Select all

// ************************************************************ //
// *  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++;
  }
}

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

Re: 2.8" TFT Shield with UNO_Olimex EKG Shield

Post by 927465 »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”