College Senior Project

Hi i have two questions I need help with

I'm doing a senior project that consist of hydrogen gas and water for school, and I need help with finding pressure and water level sensors for my project. Im using the Arduino 1280 Mega and a GLCD ks0108.
Im thinking about using a FSR sensor but Im not sure if this would work Hydrogen gas or water pressure, and I need some guidance on what sensors are best for this project.

Im also new to programming and just recently I tried to create my own code to display something on the LCD screen like just one word but I keep running into errors but I don't understand what the error messages are asking me to do. so I want to know is there a guide somewhere online that lets you know what error codes mean for the Arduino language?

Quick search at Parallax found these;
VTI SCP1000 30-120 kPa Pressure Sensor ($30USD):
http://www.parallax.com/Store/Sensors/PressureFlexRPM/tabid/177/CategoryID/52/List/0/SortField/0/Level/a/ProductID/591/Default.aspx
"Application Ideas: Pressure chamber sensor"

eTape Liquid Level Sensor ($40USD):
http://www.parallax.com/Store/Sensors/PressureFlexRPM/tabid/177/CategoryID/52/List/0/SortField/0/Level/a/ProductID/590/Default.aspx

Not sure if this is for a pressure chamber or not, but both have data sheets at the bottom right of their respective pages if that helps.

so I want to know is there a guide somewhere online that lets you know what error codes mean for the Arduino language?

I am not aware of one. Basically the errors mean what they say. A thing to note though is that an error is raised not where the error actually is but at the point where the compiler gets confused.

So the big beginner mistake is to leave the semi colon off the end of a line. However, the compiler will only complain about things on the line after the missing semi colon.

It's the same sort of story with unmatched brackets, the real error could be there are too few '(' rather than too many ')'

thanks guys for your help

Hi again Arduino forum,

I have just bought 2 FSR sensors for my project and Im trying to get the output results of the sensors to show on the GLCD kS0108 display I have. but Im not sure what the command line code to output the results to the GLCD KS0108 instead of the computer display monitor.

Have you seen this:-
http://www.arduino.cc/playground/Code/GLCDks0108

thanks for that link Grumpy, but Im still having problems with converting this program code for the FSR sensor to be outputted on to the GLCD screen:

/* FSR simple testing sketch. 

Connect one end of FSR to power, the other end to Analog 0.
Then connect one end of a 10K resistor from Analog 0 to ground 

For more information see www.ladyada.net/learn/sensors/fsr.html */

int fsrPin = 0;     // the FSR and 10K pulldown are connected to a0
int fsrReading;     // the analog reading from the FSR resistor divider

void setup(void) {
  // We'll send debugging information via the Serial monitor
  Serial.begin(9600);   
}

void loop(void) {
  fsrReading = analogRead(0);  
  
  Serial.print("Analog reading = ");
  Serial.print(fsrReading);     // the raw analog reading
  
  // We'll have a few threshholds, qualitatively determined
  if (fsrReading < 10) {
    Serial.println(" - No pressure");
  } else if (fsrReading < 200) {
    Serial.println(" - Light touch");
  } else if (fsrReading < 500) {
    Serial.println(" - Light squeeze");
  } else if (fsrReading < 800) {
    Serial.println(" - Medium squeeze");
  } else {
    Serial.println(" - Big squeeze");
  }
  delay(1000);
}

But here is my entire code for my project that I modified but still cant get the FSR sensor to show up on the screen and the code compiles without any errors:

#include <ArduinoIcon.h>
#include <Arial14.h>
#include <ks0108.h>
#include <ks0108_Arduino.h>
#include <ks0108_Mega.h>
#include <ks0108_Panel.h>
#include <ks0108_Sanguino.h>
#include <SystemFont5x7.h>



int fsrPin = 0;     // the FSR and 10K pulldown are connected to a0
int fsrReading;     // the analog reading from the FSR resistor divider


void setup() {
  // We'll send debugging information via the Serial monitor
  GLCD.Init(9600);  

  

  
GLCD.Init(NON_INVERTED);// initialise the library
GLCD.ClearScreen();//clears screen
GLCD.DrawBitmap(ArduinoIcon, 32, 0, BLACK); //draw the bitmap at the given x,y position
delay(1000);
GLCD.ClearScreen();//clears screen
GLCD.SelectFont(System5x7);  // select fixed width system font 

   GLCD.ClearScreen();
  GLCD.CursorTo(3,2);
  GLCD.Puts("Hydrogen");
  delay(3000);
  GLCD.CursorTo(4,10);
  GLCD.Puts("Powered");
  delay(3000);
  GLCD.CursorTo(3,6);
  GLCD.Puts("Vehicle");
  delay(3000);
   GLCD.ClearScreen();
  
}




void loop(void) {

   char fsrReading = analogRead(0);  
  
  GLCD.Puts("Analog reading = ");
  GLCD.PrintNumber(fsrReading);     // the raw analog reading
  
  // We'll have a few threshholds, qualitatively determined
  if (fsrReading < 10) {
    GLCD.Puts(" - No pressure");
  } else if (fsrReading < 200) {
    GLCD.Puts(" - Light touch");
  } else if (fsrReading < 500) {
    GLCD.Puts(" - Light squeeze");
  } else if (fsrReading < 800) {
    GLCD.Puts(" - Medium squeeze");
  } else {
    GLCD.Puts(" - Big squeeze");
  }
  delay(1000);

  
  
  
}
   char fsrReading = analogRead(0);

Have you any idea what kind of value analogRead returns? Hint: It isn't a character.

  GLCD.PrintNumber(fsrReading);     // the raw analog reading

I seriously doubt that a function called PrintNumber expects a char input.

ok Paul I changed the code and nothing shows up from the FSR sensor

#include <ArduinoIcon.h>
#include <Arial14.h>
#include <ks0108.h>
#include <ks0108_Arduino.h>
#include <ks0108_Mega.h>
#include <ks0108_Panel.h>
#include <ks0108_Sanguino.h>
#include <SystemFont5x7.h>



int fsrPin0;     // the FSR and 10K pulldown are connected to a0
int fsrReading;     // the analog reading from the FSR resistor divider


void setup() {
 // We'll send debugging information via the Serial monitor
  GLCD.Init(9600);   
  
GLCD.Init(NON_INVERTED);// initialise the library
GLCD.ClearScreen();//clears screen
GLCD.DrawBitmap(ArduinoIcon, 32, 0, BLACK); //draw the bitmap at the given x,y position
delay(1000);
GLCD.ClearScreen();//clears screen
GLCD.SelectFont(System5x7);  // select fixed width system font 

   GLCD.ClearScreen();
  GLCD.CursorTo(3,2);
  GLCD.Puts("Hydrogen");
  delay(3000);
  GLCD.CursorTo(4,10);
  GLCD.Puts("Powered");
  delay(3000);
  GLCD.CursorTo(3,6);
  GLCD.Puts("Vehicle");
  delay(3000);
   GLCD.ClearScreen();
  
}




void loop(void) {

   fsrReading = analogRead(0);  
  
  GLCD.Puts("Analog reading = ");
  (fsrReading);     // the raw analog reading
  
  // We'll have a few threshholds, qualitatively determined
  if (fsrReading < 10) {
    GLCD.Puts(" - No pressure");
  } else if (fsrReading < 200) {
    GLCD.Puts(" - Light touch");
  } else if (fsrReading < 500) {
    GLCD.Puts(" - Light squeeze");
  } else if (fsrReading < 800) {
    GLCD.Puts(" - Medium squeeze");
  } else {
    GLCD.Puts(" - Big squeeze");
  }
  delay(1000);

  
  
  
}
GLCD.Puts("Analog reading = ");
  (fsrReading);     // the raw analog reading

Is not right, it will not do anything with the value it is just in brackets.

and the code compiles without any errors:

The fact it compiles just means you haven confused it with a syntax error, it doesn't mean it will do anything.