Go Down

Topic: Analogue input Help!!! please!!!!!!! (Read 795 times) previous topic - next topic

poli

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

cr0sh


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...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Terry King

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

poli

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

robtillaart

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

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

bilbo

Why are you using analog pins for a glcd?
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

poli

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

Regards

poli

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: [Select]

#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


Go Up