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

Atlanta Cosplay Meetup: Group Build Update #3

It's been a while since we posted a progress report for the Atlanta Cosplay Meetup's ongoing project, and with Dragon Con right around the corner, we're nearing the finish line. Let's take a look and see what's been going on the last few months! Check out our previous progress reports here: Progress update #1 Progress update #2 Read on to see where we're at now...

Build Out 12-5 Photo Recap

Freeside just finished our Build Out for the end of 2015 and we got a lot of work done. Let's see what all we accomplished.