Pages: [1]   Go Down
Author Topic: Playing with Nokia LCD 3310  (Read 714 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Newbie
*
Karma: 5
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I spent some hours in playing with the Nokia LCD and some input devices, so I wanted to share that funny thing.
What you need:

- Breadboard
- Arduino (I used a nano)
- Nokia 3310 LCD
- DS1307 RTC
- 10kOhm poti
- Photoresistor and a 620ohm Resi.
- Some jumper wires

Attach all components like described in the links in the code or Arduino Playground and you should get this funny stuff working well.

Code:
/* Playing with Nokia LCD 3310 by ReDiculum Jan. 2014

Use at your own risk
*/

//https://code.google.com/p/pcd8544/
#include <PCD8544.h>

//https://github.com/davidhbrown/RealTimeClockDS1307
#include <Wire.h>
#include <RealTimeClockDS1307.h>

static PCD8544 lcd;

void setup() {
   lcd.begin(84, 48);
}

void loop() {
  // Potentiometer on A3
  lcd.setCursor(0,0); lcd.clearLine();
  int potValue = map(analogRead(3),0,1023,0,100);
  lcd.print("Poti: ");
  lcd.print(potValue);
  lcd.print("% ");
  drawBar(0, map(potValue,0,100,403,420));
  
  // Phototransistor on A6
  lcd.setCursor(0,2); lcd.clearLine();
  int phoValue = map(analogRead(6),0,1023,100,0);
  lcd.print("Phot: ");
  lcd.print(phoValue);
  lcd.print("% ");
  drawBar(2, map(phoValue,0,100,403,420));

  // RealTimeClock on A4+5
  lcd.setCursor(0,4); lcd.clearLine();
  lcd.print("Time: ");
  RTC.readClock();
  lcd.print(RTC.getHours());  lcd.print(":");
  lcd.print(RTC.getMinutes());  lcd.print(":");
  lcd.print(RTC.getSeconds());
}

void drawBar(int line, int val) {
  for (int i = 403; i <= val; i++) {
    lcd.setCursor(i,line);
    lcd.drawColumn(0,8);
  }    
}



Poti playing


Photoresi playing
« Last Edit: January 10, 2014, 11:37:30 am by rediculum » Logged

Regards
ReDiculum

Project:
LASERino

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have tried that display and it went bad after a week.
Others have had them turn bad after a day.

The construction is not good.and the rubberstrip on the back looses contact after a while.

If yours work then great.
Its fun to play with.
Logged

Pages: [1]   Go Up
Jump to: