Pages: [1]   Go Down
Author Topic: Analogue input Help!!! please!!!!!!!  (Read 612 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have just done a lux meter with a graphical display (KS108) and I want to include a temperature meter into it, but I have no free analogue inputs...
what can  i do? one of the analogue inputs is used for my lux reading (a5) and the rest are taken for the screen.

Kind Regards

Poli
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have just done a lux meter with a graphical display (KS108) and I want to include a temperature meter into it, but I have no free analogue inputs...
what can  i do? one of the analogue inputs is used for my lux reading (a5) and the rest are taken for the screen.

Kind Regards

Poli

Cross-posting won't help your cause...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Red Sea, Saudi Arabia
Offline Offline
God Member
*****
Karma: 11
Posts: 579
..On The Red Sea
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Look at DS18B20  .. takes only 1 Digital input.
Logged

Regards, Terry King  ..On the Red Sea at KAUST.edu.sa
terry@yourduino.com  LEARN! DO! (Arduino Boards, Sensors, Parts @ http://yourduino.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using that, but as I said I ran out of analogue inputs, I have A5 for the LDR reading and the rest for the GLCD

Regards
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12456
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ds18b20 doesn't need an analog input. .... Please read the datasheet.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 360
I'm 15. I like making things. I like breaking things better.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why are you using analog pins for a glcd?
Logged

Alice asked the Chesire Cat, who was sitting in a tree, "What road do I take?"
The cat asked, "Where do you want to go?"
"I don't know," Ali

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

because the wireing diagram says so... have you got another wireing diagram that doesnt use analogue input ports?

Regards
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I dont think you can do that tho...
there I am attaching the code I am using...
do you change the pin number definitions in the code like a normal 16x2 lcd or I have to change it from the library I am using? I need help on this please!
Code:
#include <ks0108.h> //  library for LCD
#include "SystemFont5x7.h"   // we need this for character display, included with ks0108.h download
int LDRPINA5 = 5;
int LDRREADING5;
float Resistance = 10.0;
int val = 0;

void setup()
{
 
GLCD.Init(NON_INVERTED);   // load the GLCD library
GLCD.ClearScreen();
GLCD.SelectFont(System5x7);  // choose font to use (note this needs to match the #include above
  countdown(4);
  GLCD.ClearScreen();
GLCD.DrawRect(0, 0, 127, 63,BLACK);
GLCD.CursorTo(1, 1);
// set cursor to top left of LCD (uses character coordinates
// not pixel coordinates
GLCD.Puts("   Welcome To The"); // sends strings to LCD. Does not wrap to next line!
GLCD.CursorTo(1, 2);
GLCD.Puts("#AMAZING LUX METER#");
GLCD.CursorTo(0, 3);
GLCD.Puts("Project Developed by:");
GLCD.CursorTo(1, 4);
GLCD.Puts("Sixto Llorens Zabala");
GLCD.CursorTo(1, 5);
GLCD.Puts("Student No: 08154978");
delay(900);
GLCD.ClearScreen();
GLCD.DrawRect(0, 0, 127, 63,BLACK);
GLCD.CursorTo(1, 1);
GLCD.Puts("Lux Given in Lumens:"); // sends strings to LCD. Does not wrap to next line!
GLCD.CursorTo(1, 3);
GLCD.Puts("       LUX\t=  ");
}
void loop(void)
{
  GLCD.DrawRect(0, 0, 127, 63,BLACK);
GLCD.CursorTo(1, 1);
  GLCD.Puts("Lux Given in Lumens:"); // sends strings to LCD. Does not wrap to next line!
GLCD.CursorTo(1, 3);
GLCD.Puts("       LUX\t=  ");
LDRREADING5 = analogRead(5);
float Vout5=(LDRREADING5);
float lux5=((Vout5));
GLCD.CursorTo(12,3);
GLCD.PrintNumber(lux5);
delay(1000);
GLCD.ClearScreen();
GLCD.CursorTo(12,3);
delay(20);


}

void countdown(int count){
  while(count--){  // do countdown 
    GLCD.CursorTo(10,3);   // first column, second row (offset is from 0)
    GLCD.PutChar(count + '0');
    delay(1000); 
  }
}

Thanks in advance
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

anyone?
Logged

Pages: [1]   Go Up
Jump to: