Skip to main content

Sharp Memory LCD - Arduino Library


This post extends the previous post.

Source Code Released!
http://code.google.com/p/arduino-sharp-memory-lcd-gfx-library/

I've got a little reflow oven simulation running on the LCD. I think its going to be great for the reflow oven project.

The source for the sketch in the video is attached below. The library now does vectors in addition to text and bitmaps. I am now extending the Adafruit GFX library so I can use those vector drawing routines in addition to my PGM space bitmaps. I still need to clean up the unnecessary banging I am doing on one pin. I'll post up the code on the interwebz for all to use once that is cleared up. I need a darn oscilloscope to inspect that pin!

If you need an early copy of the library and you don't know how to contact me, PM me from the youtube video.


#include 
#include "SharpMemoryLcd.h"

SHARPMEMORYLCD lcd;

void setup() {                
  Serial.begin(9600);
  lcd.LcdInitialize();
  lcd.LcdAllClearMode();
  lcd.LcdStartEXTC();
  
}

void loop() {
  lcd.setCursor(1,6);
  lcd.setTextColor(0, 1);
  lcd.setTextSize(1);
  lcd.setTextWrap(1);
  lcd.print("Craftycoder's");
  lcd.setCursor(1,15);
  lcd.print("Sharp Memory");
  lcd.setCursor(1,24);
  lcd.print("LCD Library"); 
  lcd.setCursor(1,33);
  lcd.print("Extends"); 
  lcd.setCursor(1,42);
  lcd.print("Adafruit GFX");  
  lcd.LcdPrintBuffer();
  delay(4000);
  lcd.LcdStopEXTC();
  lcd.LcdAllClearMode();
  lcd.LcdStartEXTC();
  lcd.drawLine(0, 0, 95, 95, 0);
  lcd.fillRect(4, 4, 7, 7, 0);
  lcd.fillCircle(7, 7, 2, 1);
  lcd.LcdPrintBuffer();
  delay(1000);
  lcd.LcdClearBuffer();
  lcd.setCursor(1,2);
  lcd.print("Draw Vectors");
  for(int x=0;x<32;x=x+4) {
    lcd.drawRect(47-x/2, 47-x/2, x, x, 0);
    lcd.drawCircle(75, 75, 20-x, 0);
    lcd.LcdPrintBuffer();
    delay(10);
  }
  delay(5000);
  lcd.invert(1);
  lcd.setCursor(1,11);
  lcd.print("Invert Them");  
  lcd.LcdPrintBuffer();
  delay(5000);  
  lcd.invert(0);
  lcd.LcdStopEXTC();
  lcd.LcdAllClearMode();
  lcd.LcdStartEXTC();
  lcd.setCursor(4,5);
  lcd.print("Reflow Oven");
  lcd.setCursor(4,14);
  lcd.print("Simulation");
  lcd.drawRect(0, 0, 96, 96, 0);
  lcd.drawRect(1, 1, 94, 94, 0);
  lcd.drawRect(2, 2, 92, 92, 0);
  for(int x=3;x<93;x++) {
    lcd.drawPixel(x,95-testTemp(x),0);
    lcd.drawPixel(x,96-testTemp(x),0);
    lcd.LcdPrintBuffer();
    delay(10);
  }
  lcd.setCursor(26,80);
  lcd.print("Remove PCBs");
  lcd.LcdPrintBuffer();
  delay(10000);
  lcd.invert(0);
  lcd.LcdStopEXTC();
  lcd.LcdAllClearMode();
  lcd.LcdStartEXTC();
  lcd.LcdPrintImage();
  delay(1000);
  lcd.LcdStopEXTC();
  lcd.LcdAllClearMode();
  lcd.LcdStartEXTC();
}
int testTemp(int x) {
  if(x<30)
    return x+1;
  if(x<60)
    return 30+((x-30)/2);
  if(x<75)
    return 45+((x-60)*2); 
  if(x<85)   
    return 75;
  if(x<94)
    return 75-((x-85)*3);    
  
}

Comments

Popular posts from this blog

A Capacitive-Touch Janko Keyboard: What I Did at the 2017 Georgia Tech Moog Hackathon

Last weekend (February 10-12, 2017) I made a Janko-layout capacitive-touch keyboard for the Moog Werkstatt at the Georgia Tech Moog Hackathon. The day after (Monday the 13th), I made this short video of the keyboard being played: "Capacitive Touch Janko Keyboard for Moog Werkstatt" (Text from the video doobly doo) This is a Janko-layout touch keyboard I made at the 2017 Moog Hackathon at Georgia Tech, February 10-12. I'm playing a few classic bass and melody lines from popular and classic tunes. I only have one octave (13 notes) connected so far. The capacitive touch sensors use MPR121 capacitive-touch chips, on breakout boards from Adafruit (Moog Hackathon sponsor Sparkfun makes a similar board for the same chip). The example code from Adafruit was modified to read four boards (using the Adafruit library and making four sensor objects and initializing each to one of the four I2C addresses is remarkably easy for anyone with moderate familiarity with C++), and

Freesiders Hackers Collaborate in Medical / Surgical Research

Published in the May issue of the Journal of Foot and Ankle Surgery : " A Novel Combination of Printed 3-Dimensional Anatomic Templates and Computer-assisted Surgical Simulation for Virtual Preoperative Planning in Charcot Foot Reconstruction ." This collaboration of specialties represents an undertaking by members of Freeside Atlanta , Southern Arizona Limb Salvage Alliance , and The Podiatry Institute .  Charcot foot reconstruction remains on of the most challenging procedures in foot and ankle surgery.  These procedures are often lengthy procedures which can be riddled with complications. With the help of Freeside Atlanta Members, institutional researchers used open source Osirix Image viewer and 3D Software such as Newtek's Lightwave or Blender to create simulated surgical reductions as well as 3D printed templates.  Freeside Atlanta members assisted in providing 3D printing solutions and know-how to the project. Experimental test prints were done on a M

Onboard Firmware of the Human Brain

Freesiders are continually tinkering with robotics and other such machinery .  Many of these embedded processors and firmware are becoming open source and every-more diversified in the wake of the modern Maker movement . One notable boost to the hackerspace arsenal is the Arduino (an like platforms).  This offers designers an incredible power to devise not just individual devices but even the emergence of complex, integrated systems . This evolutionary pace of modern technological systems may be significantly faster the biologic system development, but there may be a few well learned tricks yet to be mastered.  It seems that studying how nature has managed to solve many development challenges will aid in designing robotics, where efficiently counts just as much. One  challenge, that is particularly interesting, is data processing.  Artificial intelligence is labored with processing data and producing a meaningful and useful output.  When considering the increase in sensory