How to Use a Screen to Display CPU Temp (not thermistor)?

Check out this battery pack I found:

http://www.amazon.com/10400mah-External … Model+PH20

Romoss PH20 5200MAH for $19.99

Specifically states it can charge and discharge at same time. It also has a spec of 5v@1Amp max output, so that’s enough for a servo + MCU! There’s also a 2k mah version but it’s same price so w/e.

http://www.amazon.com/PowerGen-PGMPP600 … ttery+pack

Powergen PGMPP6000 6000mah $19.99

This one says it can charge/discharge same time too. 5v@1amp max output too. Assuming I can’t find anything saying one is clearly better than the other, I’d just go with the romoss for being thinner and smaller overall.

I see what you mean about usb having it’s own regulator, I was just about to say ‘why dont i use the psu’s 5v rail and put it into the usb hole’ but I recall that even a high quality PSU’s voltage rails will fluctuate ~5%. So I see that usb voltage doesnt fluctuate because it’s regulated.

edit: wait so none of this usb stuff matters because i dont plan to power the servo via usb, right? So like I have my servo + arduino micro MCU powered by the USB battery pack of 5v 1amp output, and that’s that? So the only ‘problem’ might be that the battery pack isn’t charged at the max amperage, but as long as it’s charging it’s okay because I’m not continually open/close/open/closing off it, as well as the 5amp+ back-up power on it (which means essentially if servo = 1amp, that means 5 hours of continual servo power right?)?

The only way this would be an issue is if I was powering servo + MCU off mobo USB header, right?

Am i just super awesome for figuring this out, or an idiot for taking this long. or being wrong :X

Belial88:
edit: wait so none of this usb stuff matters because i dont plan to power the servo via usb, right? So like I have my servo + arduino micro MCU powered by the USB battery pack of 5v 1amp output, and that’s that? So the only ‘problem’ might be that the battery pack isn’t charged at the max amperage, but as long as it’s charging it’s okay because I’m not continually open/close/open/closing off it, as well as the 5amp+ back-up power on it (which means essentially if servo = 1amp, that means 5 hours of continual servo power right?)?

That's about right. You should get way more than 5 hours of un-PC-powered operation as the peak draw periods should be short in duration. Just how much sitting around, doing nothing time you'll have before the small but constant draw by the Micro & servo drains the batts enough to not open the door ... is an open question. It might be a week or several months.

At this point I think you have enough of a plan to proceed ahead, even w/o the battery pack. I would use a spare drive power cable and take the 5v from that to run everything; display, servo and Micro (bypassing the onboard regulator). I would hold off on the batts until you’ve got the whole servo/door thing working. I think there’s enough risk in getting that to work that I’d make sure the present plan survives that battle. Who knows, you might have to do something completely different.

When that part is working, going back to running off the batts is a minor rewiring. Adding the display is another small task, getting “Smartie” working another. Finally I’d add the voltage measuring and calibration, as that’ll be easy to do after all the prior steps.

But get the hardest, most likely to cause change part done, before spending the time and $$s on the other parts of the project. That’s just good project management.

Just how much sitting around, doing nothing time you’ll have before the small but constant draw by the Micro & servo drains the batts enough to not open the door … is an open question. It might be a week or several months.

Well shouldn’t be ever because the PC will at least be on enough to charge it. Or maybe I could just incorporate an SPST switch to completely turn off the MCU for long term storage, like the one on the back of the PSU.

Well I think the servo part is pretty done, I’ve done enough testing with tape and stuff to know it’ll work. But if I plan to run it all off one MCU then that’s why I got the micro, and I got the display at same time because that’ll be next part. All the stuff I’m getting is cheap and returnable anyways.

so basically, we’re all good and the arduino micro is good, right? I’m a little confused when you say bypass the onboard regulator, you mean the usb regulator? in which case, arent you bypassing when you DO use usb, or not use usb?

I’m a little confused on what I (we?) were freaking out about earlier. I’ll be powering the MCU + Servo via USB with a USB battery pack that supplies an output of at least 1amp. And the voltmetering thing will be okay if I have the MCU hooked up on it’s USB port.

and then I’ll buy that battery for ups and I’ll just hook up the red/black lines to my PC PSU’s purple (5vsb) and black lines. I’ll just stick the wire into the purple line on the 24pin and then any black.

edit: small note, since I’ve been reading about shields and trying to learn this stuff quickly (seriously, i’ve been reading like 2-3 hours a day on this stuff for a few weeks now… playing with code and stuff, etc). Is there a problem with the logic level and driver level voltage supplies for the MCU vs servo? Like I was reading about motor shields and stuff, where I heard that like an arduino can only supply ~50mah. So how can I, how AM I, able to use the servo (like with the trinket)? I feel like the more i read the more confused i am.

Belial88:
so basically, we’re all good and the arduino micro is good, right? I’m a little confused when you say bypass the onboard regulator, you mean the usb regulator? in which case, arent you bypassing when you DO use usb, or not use usb?

No I mean the regulator that's [u]on[/u] the Arduino [u]board[/u]. The regulator that takes 6-20v in and makes 5v out. When you bypass it you are feeding 5v into the Arduino at the same place the onboard regulator would have (normally) output 5v..

Belial88:
I’m a little confused on what I (we?) were freaking out about earlier. I’ll be powering the MCU + Servo via USB with a USB battery pack that supplies an output of at least 1amp. And the voltmetering thing will be okay if I have the MCU hooked up on it’s USB port.

My concern was that a normal USB (2.0) port would not supply the peak current demanded by the torquey servo.

Belial88:
and then I’ll buy that battery for ups and I’ll just hook up the red/black lines to my PC PSU’s purple (5vsb) and black lines. I’ll just stick the wire into the purple line on the 24pin and then any black.

Errr, OK. I can't speak to wire color.

Belial88:
edit: small note, since I’ve been reading about shields and trying to learn this stuff quickly (seriously, i’ve been reading like 2-3 hours a day on this stuff for a few weeks now… playing with code and stuff, etc). Is there a problem with the logic level and driver level voltage supplies for the MCU vs servo? Like I was reading about motor shields and stuff, where I heard that like an arduino can only supply ~50mah. So how can I, how AM I, able to use the servo (like with the trinket)? I feel like the more i read the more confused i am.

You have a 5v MCU and 5v servo. You're OK, no logic level translation needed. The brute DC servo power (5v) should never come from the Arduino's onboard regulator. It's too weak to supply the current needed by anything other than a micro-servo.

Well speaking from the trinket because I’m not sure on arduino yet, but I was assuming to hook up my mini-servo & usb battery the same way as the trinket - by plugging into the arduino’s usb line. What would be lacking in current, you say, is if I were to hook up to the arduino’s battery line, as that’s when the regulator comes into play?

So… I am good with the arduino micro + usb battery pack for hs255hb mini servo, lcd 20x4, and voltmetering?

Ah, romoss requires you to push a button to get it to start charging, that’s stupid. So Powergen it is.

Belial88:
So… I am good with the arduino micro + usb battery pack for hs255hb mini servo, lcd 20x4, and voltmetering?

I think so. So long as that battery pack will deliver 1A peak w/o "negotiation", it'll deliver 5v to all those devices, bypassing the Arduino's onboard (and current limited) regulator.

I hooked up a DMM to measure current (10amp setting hole on the red promp, then 200m for knob but i think those just move decimal place) on the servo, while it was hooked up to the USB trinket power and trinket hooked up to USB. It would usually hit ~300mah during free range movement, but it would hit ~800-900mah when stalling out at ~70-80oz of pressure (measured by pushing down on a scale super scientifically).

I read stuff saying you can’t really pull power from the arduino, but I see a bunch of arduino tutorials showing servos just fine. It’s a bit confusing since they might be using stuff like micro servos, which are kinda the exception vs the norm (ie standard servo).

The tutorials are sometimes wrong. Sometimes you can get away with a marginal situation, wondering why your servo twitches occasionally. Proper engineering means you’re sure that’ll work.

FWIW my original concerns re: the mechanics of the door mechanism remain. Get it working, post vid to prove me wrong. :mrgreen:

The mechanics of the door work, I’ve done enough testing to know it swings the door open and close. Right now I need to purchase a different servo arm though, the one I’m using/stock literally is ~5-10* short of 90. I could live with it… but being so close to perfection, I really can’t.

I just got my 20x4 Character LCD RGB Negative. Can I remove the LCD panel from the PCB? I’d rather remove it, and then connect the pcb via wiring, so I can place the lcd somewhere without the ugly green pcb being shown. I see twisted bits of metal on the back, that clearly look like they can be twisted back so as to remove the LCD, but I’m not sure if there’s more connecting it.

Also, is there any fancy wiring like ribbon cable or something back there? I would assume whatever is back there, I can just use simple wiring to connect the lcd panel to the pcb.

http://www.adafruit.com/images/large/20 … ts_LRG.jpg

And when I see tutorials for stuff, most are not with the arduino micro. Is the pinouts the same? I looked up the micro’s pinouts and compared to the pinouts of the LCD arduino adafruit tutorial, the only discriminating pins were for RGB control, needing PWM pins, and it seemed to match what the micro uses (3, 5, 6).

As for LCD smartie, from what I understood of the tutorials it’s literally plug and play, just download lcd smartie, dont even need an arduino code or anything, and it’s up and running.

I’m sure I will need to code for the voltmeter mod though, ie display 2x voltmeter values with ~.01 accuracy on the lcd, as i understand just hook up any analog pin and ground to what i want to voltmeter, and then code which i guess i’ll copy/pasta.

Belial88:
I just got my 20x4 Character LCD RGB Negative. Can I remove the LCD panel from the PCB? I’d rather remove it, and then connect the pcb via wiring, so I can place the lcd somewhere without the ugly green pcb being shown. I see twisted bits of metal on the back, that clearly look like they can be twisted back so as to remove the LCD, but I’m not sure if there’s more connecting it.

I believe there are ~60 connections btw the LCD and it's controller on the PCB. I wouldn't try to seperate them. I'd paint the PCB if it annoys you.

Belial88:
And when I see tutorials for stuff, most are not with the arduino micro. Is the pinouts the same? I looked up the micro’s pinouts and compared to the pinouts of the LCD arduino adafruit tutorial, the only discriminating pins were for RGB control, needing PWM pins, and it seemed to match what the micro uses (3, 5, 6).

You can use most any pins, but some pins are best left free for other functions. I wouldn't use the Tx and Rx pins for example. Perhaps another pin is best used for the servo and not for the LCD.

Belial88:
As for LCD smartie, from what I understood of the tutorials it’s literally plug and play, just download lcd smartie, dont even need an arduino code or anything, and it’s up and running.

My understanding is that there's LCDSmartie code that runs on the Micro, that code may be specific or customized to the number of rows and columns of the display. You will need to meld together into 1 program your servo code and the LCDSmartie code. And then add your ADC code to that mix.

Ah I see there’s code for smartie, I found it. I managed to implement the servo code and lcd example code

// include the library code:
#include <LiquidCrystal.h>
#include <Wire.h>
#include <VarSpeedServo.h>  //variable speed servo library
 
#define REDLITE 3
#define GREENLITE 5
#define BLUELITE 6 
//declare the constants to be used
#define LEDPIN 13            //pin attached to led
#define servoPIN 4          //Servo control line (orange) on Trinket Pin #2
#define SWitchPIN 2         //input from N.O. momentary switch

#define posOpenCMD 2400     //Define Clockwise Servo Limit in usec
#define posCloseCMD 600     //Define CounterClockwise Servo Limit in usec
#define DBdelay 200          //Duration of each button press in ms
#define MAXcnt 3            //Count of Button Presses needed for action
#define fastSPD 100         //speed setting; 1 = slowest, 255 is fastest 
#define slowSPD 30          //Speed Servo/Door opens and closes
 
//declare the variables used
boolean wait = true;        //wait for motion to complete, or don't
boolean doorOPEN = false;   //desired door state set to closed
boolean SWstate = true;     //state of switch, open = TRUE = not pushed
byte SWcnt = 0;             //counter of same consecutive switch readings w/button = pressed

VarSpeedServo myServo; //create a servo object

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
 
// you can change the overall brightness by range 0 -> 255
int brightness = 255;
 
void setup() {
  // set up the LCD's number of rows and columns: 
  lcd.begin(20, 4);
  // Print a message to the LCD.
  lcd.print("RGB 2x2 Display  ");
  lcd.setCursor(0,1);
  lcd.print(" Multicolor LCD ");
  
  pinMode(REDLITE, OUTPUT);
  pinMode(GREENLITE, OUTPUT);
  pinMode(BLUELITE, OUTPUT);

  brightness = 100;
   //set the pins to be ins or outs
  pinMode(LEDPIN, OUTPUT);
  digitalWrite(LEDPIN, LOW);  //turn LED off
  pinMode(servoPIN, OUTPUT);
  pinMode(SWitchPIN, INPUT_PULLUP);

  //CMD the servo to close the door
  myServo.attach(servoPIN);   // Attach the servo
  myServo.slowmove(posCloseCMD, fastSPD); // Tell servo to go to closed position
}

 
 
void loop() {
  for (int i = 0; i < 255; i++) {
    setBacklight(i, 0, 255-i);
    delay(5);
  }
  for (int i = 0; i < 255; i++) {
    setBacklight(255-i, i, 0);
    delay(5);
  }
  for (int i = 0; i < 255; i++) {
    setBacklight(0, 255-i, i);
    delay(5);
  }
}
 
 
 
void setBacklight(uint8_t r, uint8_t g, uint8_t b) {
  // normalize the red LED - its brighter than the rest!
  r = map(r, 0, 255, 0, 100);
  g = map(g, 0, 255, 0, 150);
 
  r = map(r, 0, 255, 0, brightness);
  g = map(g, 0, 255, 0, brightness);
  b = map(b, 0, 255, 0, brightness);
 
  // common anode so invert!
  r = map(r, 0, 255, 255, 0);
  g = map(g, 0, 255, 255, 0);
  b = map(b, 0, 255, 255, 0);
  Serial.print("R = "); Serial.print(r, DEC);
  Serial.print(" G = "); Serial.print(g, DEC);
  Serial.print(" B = "); Serial.println(b, DEC);
  analogWrite(REDLITE, r);
  analogWrite(GREENLITE, g);
  analogWrite(BLUELITE, b);
   //read the switch
  if(digitalRead(SWitchPIN) == LOW){   //see if switch is being pushed
    SWcnt ++;                //SW reads low = pushed, increment debounce counter
    if(SWcnt >= MAXcnt){     //test if switch is really being pushed AND done bouncing
      SWcnt = 0;             //done bouncing, reset counter for next push
      doorOPEN = !doorOPEN;  //reverse desired door state
      if(doorOPEN == true){
        digitalWrite(LEDPIN, HIGH);   //turn LED on
        myServo.slowmove(posOpenCMD, slowSPD);    //tell servo to go to open position
      } 
      else {
        digitalWrite(LEDPIN, LOW);    //turn LED off
        myServo.slowmove(posCloseCMD, slowSPD);   //tell servo to go to closed position
      }
    }
  } 
  else {
    SWcnt = 0;              //switch is released or bouncing
  }
  delay(DBdelay);           //wait for next read of switch
}

I think the real challenge will be the adc and implementing that to the lcd though.

Belial88:
Ah I see there’s code for smartie, I found it. Do I just copy/paste that to the end of the servo code, or do I have to split it up as the define section, void setup section, and void loop section?

I think the real challenge will be the adc and implementing that to the lcd though.

You have to split it up as the define section, void setup section, and void loop sections.

I tried to do the smartie mod:

// include the library code:
#include <LiquidCrystal.h>

// these constants won't change.  But you can change the size of
// your LCD using them:
const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,4,5,6,7);
// RS, RW, Enable, 4,5,6,7 (Refer to the back of your LCD for details)


void setup() { 
  Serial.begin(9600);
  // set up the LCD's number of rows and columns: 
  lcd.begin(numRows, numCols);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("**LCD  SMARTIE**");
  lcd.setCursor(0,1);
  lcd.print("on Arduino");
}

byte serial_getch(){
  
  int incoming;  
  while (Serial.available()==0){}
	// read the incoming byte:
  incoming = Serial.read();

  return (byte) (incoming &0xff);
}

void loop(){

  byte rxbyte;
  byte temp;

  rxbyte = serial_getch();

  if (rxbyte == 254) //Matrix Orbital uses 254 prefix for commands
  {
    switch (serial_getch())
    {
    case 66: //backlight on (at previously set brightness)
      // not implemented				

      break;
    case 70: //backlight off
      // not implemented				
      break;
    case 71:  //set cursor position
      temp = (serial_getch() - 1);  //get column byte
      switch (serial_getch())  //get row byte
      {
        //line 1 is already set up
      case 2:
        temp += 0x40;
        break;
      case 3:
        temp += 0x14;
        break;
      case 4:
        temp += 0x54;
        break;
      default:
        break;
      }
      lcd.command(0b10000000 + temp);
      break;
    case 72:  //cursor home (reset display position)
      lcd.command(2);
      break;
    case 74:  //show underline cursor
      lcd.command(0b00001110);
      break;
    case 75:  //underline cursor off
    case 84:  //block cursor off
      lcd.command(0b00001100);
      break;
    case 76:  //move cursor left
      lcd.command(16);
      break;
    case 77:  //move cursor right
      lcd.command(20);
      break;
    case 78:  //define custom char
      lcd.command(64 + (serial_getch() * 8));  //get+set char address
      for (temp = 7; temp != 0; temp--)
      {
        lcd.print(serial_getch()); //get each pattern byte
      }
      break;
    case 83:  //show blinking block cursor
      lcd.command(0b00001111);
      break;
    case 86:  //GPO OFF
      //implement later
      break;
    case 87:  //GPO ON
      /*temp = serial_getch();
       				if (temp == 1)
       				{
       					GPO1 = GPO_ON;
       				}*/
      break;
    case 88:  //clear display, cursor home
      lcd.command(1);
      break;
    case 152: //set and remember (doesn't save value, though)
    case 153: //set backlight brightness
      //not implemented
      break;

      //these commands ignored (no parameters)
    case 35: //read serial number
    case 36: //read version number
    case 55: //read module type
    case 59: //exit flow-control mode
    case 65: //auto transmit keypresses
    case 96: //auto-repeat mode off (keypad)
    case 67: //auto line-wrap on
    case 68: //auto line-wrap off
    case 81: //auto scroll on
    case 82: //auto scroll off
    case 104: //init horiz bar graph
    case 109: //init med size digits
    case 115: //init narrow vert bar graph
    case 118: //init wide vert bar graph
      break;
    default:
      //all other commands ignored and parameter byte discarded
      temp = serial_getch();  //dump the command code
      break;
    }
    return;
  } //END OF COMMAND HANDLER

  //change accented char to plain, detect and change descenders
  //NB descenders only work on 5x10 displays. This lookup table works
  //  with my DEM-20845 (Display Elektronik GmbH) LCD using KS0066 chip.
  switch (rxbyte)
  {
    //chars that have direct equivalent in LCD charmap
    /*		case 0x67: //g
     			rxbyte = 0xE7;
     			break;
     		case 0x6A: //j
     			rxbyte = 0xEA;
     			break;
     		case 0x70: //p
     			rxbyte = 0xF0;
     			break;
     		case 0x71: //q
     			rxbyte = 0xF1;
     			break;
     		case 0x79: //y
     			rxbyte = 0xF9;
     			break;
     */  case 0xE4: //ASCII "a" umlaut
    rxbyte = 0xE1;
    break;
  case 0xF1: //ASCII "n" tilde
    rxbyte = 0xEE;
    break;
  case 0xF6: //ASCII "o" umlaut
    rxbyte = 0xEF; //was wrong in v0.86
    break;
  case 0xFC: //ASCII "u" umlaut
    rxbyte = 0xF5;
    break;

    //accented -> plain equivalent
    //and misc symbol translation
  case 0xA3: //sterling (pounds)
    rxbyte = 0xED;
    break;
    /*		case 0xB0: //degrees symbol
     			rxbyte = 0xDF;
     			break;
     */  case 0xB5: //mu
    rxbyte = 0xE4;
    break;
  case 0xC0: //"A" variants
  case 0xC1:
  case 0xC2:
  case 0xC3:
  case 0xC4:
  case 0xC5:
    rxbyte = 0x41;
    break;
  case 0xC8: //"E" variants
  case 0xC9:
  case 0xCA:
  case 0xCB:
    rxbyte = 0x45;
    break;
  case 0xCC: //"I" variants
  case 0xCD:
  case 0xCE:
  case 0xCF:
    rxbyte = 0x49;
    break;
  case 0xD1: //"N" tilde -> plain "N"
    rxbyte = 0x43;
    break;
  case 0xD2: //"O" variants
  case 0xD3:
  case 0xD4:
  case 0xD5:
  case 0xD6:
  case 0xD8:
    rxbyte = 0x4F;
    break;
  case 0xD9: //"U" variants
  case 0xDA:
  case 0xDB:
  case 0xDC:
    rxbyte = 0x55;
    break;
  case 0xDD: //"Y" acute -> "Y"
    rxbyte = 0x59;
    break;
    /*		case 0xDF: //beta  //mucks up LCDSmartie's degree symbol??
     			rxbyte = 0xE2;
     			break;
     */  case 0xE0: //"a" variants except umlaut
  case 0xE1:
  case 0xE2:
  case 0xE3:
  case 0xE5:
    rxbyte = 0x61;
    break;
  case 0xE7: //"c" cedilla -> "c"
    rxbyte = 0x63;
    break;
  case 0xE8: //"e" variants
  case 0xE9:
  case 0xEA:
  case 0xEB:
    rxbyte = 0x65;
    break;
  case 0xEC: //"i" variants
  case 0xED:
  case 0xEE:
  case 0xEF:
    rxbyte = 0x69;
    break;
  case 0xF2: //"o" variants except umlaut
  case 0xF3:
  case 0xF4:
  case 0xF5:
  case 0xF8:
    rxbyte = 0x6F;
    break;
  case 0xF7: //division symbol
    rxbyte = 0xFD;
    break;
  case 0xF9: //"u" variants except umlaut
  case 0xFA:
  case 0xFB:
    rxbyte = 0x75;
    break;
  default:
    break;
  }

  lcd.print(rxbyte);  //otherwise a plain char so we print it to lcd
  return;


}

and can’t get it to work. First I went by the same wiring I had as followed by the adafruit tutorial, and the screen read ‘lcd smartie’ like it says in the code but i couldnt get lcd smartie to work (instead of text, its all 1234234123123, and it’d change only when text changed), then i rewired it to be exactly like in the tutorial for lcd smartie and i just get no text at all.

Could it be because I dont use a resistor as the lcd smartie guide says to? The adafruit guide says there’s already a resistor in there.

http://waihung.net/lcd-smartie-through-arduino/

http://waihung.net/wp-content/uploads/2 … ie_sch.png

Belial88:
First I went by the same wiring I had as followed by the adafruit tutorial, and the screen read ‘lcd smartie’ like it says in the code but i couldnt get lcd smartie to work (instead of text, its all 1234234123123, and it’d change only when text changed), then i rewired it to be exactly like in the tutorial for lcd smartie and i just get no text at all.

Could it be because I dont use a resistor as the lcd smartie guide says to? The adafruit guide says there’s already a resistor in there?

My gut says the resistor isn't a problem even though I don't know what it's supposed to do. What's the function of that display pin that it's supposed to be connected to ?

I’d go back to the wiring that made ‘lcd smartie’ appear. Then it’s a matter of getting software, on the PC and on the Arduino, to talk to each other. How does the LCDsmartie setup the virtual COM port it uses ? Is it the same asthe Arduino IDE uses to program the Arduino ? Or do you have to switch USB ports ? How familiar are you with terminal emulator programs on the PC, like the old HyperTerminal or TerraTerm or PuTTY or my fav, RealTerm ? My thinking is to make up a simple LCDsmartie message using one of them to get the PC to Arduino ‘channel’ working, and then figure out why the PC end of the LCDsmartie program isn’t working.

BTW did the LCD display … exactly …

LCD SMARTIE

on Arduino

The basic Hitachi LCD display has 14 pins.

The pinout was written on clay tablets by the ancients and will never change.

Backlights were added a few decades ago.

Originally they were two pins that were separate from the 14 pins.

Then they started making them pins 15 & 16 on the main connector.

Sometimes they had just the LED, sometimes a dropping resistor also.

Eventually RGB backlight was added.

This appeared as pins 15, 16, 17, 18 on the main connector.

The pin out and whether dropping resistors are needed do not seem to be standardized.

(The picture of the 16 pin LCD has an LED backlight that requires an external resistor.)

Renate:
The pinout was written on clay tablets by the ancients and will never change.

Aaaah but did them damn ancients ever put in clay their init sequence timing ? :mrgreen:

BTW did the LCD display … exactly …

LCD SMARTIE

on Arduino

Yes, I believe so. The pin that the resistor is on is for the backlight, on my RGB display it’d make it red so I’m pretty sure it’d set it to pin#18 on lcd for blue (tried both though).

So the way I was able to get ‘LCD SMartie / On Arduino’ displayed was by using the adafruit tutorials pinout, and changed the pin assignment to what I was using. But what I did this time, was put RW on a pin, and assign it according to his comments (// RS, RW, Enable, 4,5,6,7 (Refer to the back of your LCD for details)). Now I don’t know why in his code he only has 6 variables instead of the 7 he says in his comments, but I put my pin outs on my arduino for those 7 now and trying to get it work that way.

So far it’s just tons of numbers when i launch smartie but i’ll work on it.

got this to work: http://www.instructables.com/id/Arduino … nitor-LCD/

a dude’s custom program to show cpu/ram, but it has very limited options so i dont like it (no temps, which is what i ultimately want, and the adc values). However a bit buggy since it’s only for a 16x2 i assume, lots of weird text and doesnt play well with the 20x4 format, but it does show the cpu and ram usage.

edit: ugggh i just have no clue what’s going wrong.

// include the library code:
#include <LiquidCrystal.h>

// these constants won't change.  But you can change the size of
// your LCD using them:
const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12,6,11,5,4,3,2);
// RS, RW, Enable, 4,5,6,7 (Refer to the back of your LCD for details)


void setup() { 
  Serial.begin(9600);
  // set up the LCD's number of rows and columns: 
  lcd.begin(numRows, numCols);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("**LCD  SMARTIE**");
  lcd.setCursor(0,1);
  lcd.print("on Arduino");
}

byte serial_getch(){
  
  int incoming;  
  while (Serial.available()==0){}
	// read the incoming byte:
  incoming = Serial.read();

  return (byte) (incoming &0xff);
}

void loop(){

  byte rxbyte;
  byte temp;

  rxbyte = serial_getch();

  if (rxbyte == 254) //Matrix Orbital uses 254 prefix for commands
  {
    switch (serial_getch())
    {
    case 66: //backlight on (at previously set brightness)
      // not implemented				

      break;
    case 70: //backlight off
      // not implemented				
      break;
    case 71:  //set cursor position
      temp = (serial_getch() - 1);  //get column byte
      switch (serial_getch())  //get row byte
      {
        //line 1 is already set up
      case 2:
        temp += 0x40;
        break;
      case 3:
        temp += 0x14;
        break;
      case 4:
        temp += 0x54;
        break;
      default:
        break;
      }
      lcd.command(0b10000000 + temp);
      break;
    case 72:  //cursor home (reset display position)
      lcd.command(2);
      break;
    case 74:  //show underline cursor
      lcd.command(0b00001110);
      break;
    case 75:  //underline cursor off
    case 84:  //block cursor off
      lcd.command(0b00001100);
      break;
    case 76:  //move cursor left
      lcd.command(16);
      break;
    case 77:  //move cursor right
      lcd.command(20);
      break;
    case 78:  //define custom char
      lcd.command(64 + (serial_getch() * 8));  //get+set char address
      for (temp = 7; temp != 0; temp--)
      {
        lcd.print(serial_getch()); //get each pattern byte
      }
      break;
    case 83:  //show blinking block cursor
      lcd.command(0b00001111);
      break;
    case 86:  //GPO OFF
      //implement later
      break;
    case 87:  //GPO ON
      /*temp = serial_getch();
       				if (temp == 1)
       				{
       					GPO1 = GPO_ON;
       				}*/
      break;
    case 88:  //clear display, cursor home
      lcd.command(1);
      break;
    case 152: //set and remember (doesn't save value, though)
    case 153: //set backlight brightness
      //not implemented
      break;

      //these commands ignored (no parameters)
    case 35: //read serial number
    case 36: //read version number
    case 55: //read module type
    case 59: //exit flow-control mode
    case 65: //auto transmit keypresses
    case 96: //auto-repeat mode off (keypad)
    case 67: //auto line-wrap on
    case 68: //auto line-wrap off
    case 81: //auto scroll on
    case 82: //auto scroll off
    case 104: //init horiz bar graph
    case 109: //init med size digits
    case 115: //init narrow vert bar graph
    case 118: //init wide vert bar graph
      break;
    default:
      //all other commands ignored and parameter byte discarded
      temp = serial_getch();  //dump the command code
      break;
    }
    return;
  } //END OF COMMAND HANDLER

  //change accented char to plain, detect and change descenders
  //NB descenders only work on 5x10 displays. This lookup table works
  //  with my DEM-20845 (Display Elektronik GmbH) LCD using KS0066 chip.
  switch (rxbyte)
  {
    //chars that have direct equivalent in LCD charmap
    /*		case 0x67: //g
     			rxbyte = 0xE7;
     			break;
     		case 0x6A: //j
     			rxbyte = 0xEA;
     			break;
     		case 0x70: //p
     			rxbyte = 0xF0;
     			break;
     		case 0x71: //q
     			rxbyte = 0xF1;
     			break;
     		case 0x79: //y
     			rxbyte = 0xF9;
     			break;
     */  case 0xE4: //ASCII "a" umlaut
    rxbyte = 0xE1;
    break;
  case 0xF1: //ASCII "n" tilde
    rxbyte = 0xEE;
    break;
  case 0xF6: //ASCII "o" umlaut
    rxbyte = 0xEF; //was wrong in v0.86
    break;
  case 0xFC: //ASCII "u" umlaut
    rxbyte = 0xF5;
    break;

    //accented -> plain equivalent
    //and misc symbol translation
  case 0xA3: //sterling (pounds)
    rxbyte = 0xED;
    break;
    /*		case 0xB0: //degrees symbol
     			rxbyte = 0xDF;
     			break;
     */  case 0xB5: //mu
    rxbyte = 0xE4;
    break;
  case 0xC0: //"A" variants
  case 0xC1:
  case 0xC2:
  case 0xC3:
  case 0xC4:
  case 0xC5:
    rxbyte = 0x41;
    break;
  case 0xC8: //"E" variants
  case 0xC9:
  case 0xCA:
  case 0xCB:
    rxbyte = 0x45;
    break;
  case 0xCC: //"I" variants
  case 0xCD:
  case 0xCE:
  case 0xCF:
    rxbyte = 0x49;
    break;
  case 0xD1: //"N" tilde -> plain "N"
    rxbyte = 0x43;
    break;
  case 0xD2: //"O" variants
  case 0xD3:
  case 0xD4:
  case 0xD5:
  case 0xD6:
  case 0xD8:
    rxbyte = 0x4F;
    break;
  case 0xD9: //"U" variants
  case 0xDA:
  case 0xDB:
  case 0xDC:
    rxbyte = 0x55;
    break;
  case 0xDD: //"Y" acute -> "Y"
    rxbyte = 0x59;
    break;
    /*		case 0xDF: //beta  //mucks up LCDSmartie's degree symbol??
     			rxbyte = 0xE2;
     			break;
     */  case 0xE0: //"a" variants except umlaut
  case 0xE1:
  case 0xE2:
  case 0xE3:
  case 0xE5:
    rxbyte = 0x61;
    break;
  case 0xE7: //"c" cedilla -> "c"
    rxbyte = 0x63;
    break;
  case 0xE8: //"e" variants
  case 0xE9:
  case 0xEA:
  case 0xEB:
    rxbyte = 0x65;
    break;
  case 0xEC: //"i" variants
  case 0xED:
  case 0xEE:
  case 0xEF:
    rxbyte = 0x69;
    break;
  case 0xF2: //"o" variants except umlaut
  case 0xF3:
  case 0xF4:
  case 0xF5:
  case 0xF8:
    rxbyte = 0x6F;
    break;
  case 0xF7: //division symbol
    rxbyte = 0xFD;
    break;
  case 0xF9: //"u" variants except umlaut
  case 0xFA:
  case 0xFB:
    rxbyte = 0x75;
    break;
  default:
    break;
  }

  lcd.print(rxbyte);  //otherwise a plain char so we print it to lcd
  return;


}

pinned correctly, i set it all to 16x2 to be consistent but i can do 20x4 as well with no luck. Matrix.dll, Com6,9600 in settings for lcd smartie. just number mass.

edit2: okay, so I saw some guy, deep in a comment on a thread, say that he just had a mass of numbers. The op replied that they used an older version of IDE, ie 0023. Well, arduino ide 0023 doesn’t have the micro or leonardo, ie the only atmega32u4 controllers. so… hopefully that isn’t the answer

okay got it to work… using arduino 1.0.1, there’s no micro but there’s the leonardo. Then, i saw someone post this deep in a forum, about changing lcd.print(rxbyte) to lcd.write(rxbyte) and it worked, just like it did for the OP.

Now, to actually display cpu temps. I’d prefer to use hwinfo, and not motherboardmonitor which is an awful program.

edit: err its impossible!