Show Posts
Pages: [1] 2 3 ... 10
1  Forum 2005-2010 (read only) / Troubleshooting / Re: Help needed for interfacing a car with Arduino on: May 12, 2009, 06:36:31 pm
i DID make a car sensor sheild, but its not for  sale cuz i dont have enough money to make more + im 11 >_>
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial input to LCD problem on: April 20, 2009, 07:15:52 pm
try printing"   hello world"

maby you have to put 3 or 4 or 5 spaces before your print smiley
3  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial input to LCD problem on: April 20, 2009, 06:17:33 pm
and if that dont work, tell me what you mean by (overwriting its self)
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial input to LCD problem on: April 20, 2009, 06:14:37 pm
Quote
My problem is that it seems to overwrite itself sometimes


try inserting lcd.clear();

in some cases that might help smiley

Try This, I Think I Fixed It For You smiley-razz



Code:
#include <LCD4Bit.h>

LCD4Bit lcd = LCD4Bit(2);


int x = 0;
int i =0;
int button = 13;
char g[53]="";
char u[25]="";
char ut[25]="";
char l[25]="";
char lt[25]="";
char b[25]="                       ";
int scrolled=0;


void setup()
{
  lcd.init();
  Serial.begin(19200);
}

void loop()
{
lcd.clear();
  // Serial data waiting?
  if (Serial.available())
  {
    delay(100);
    
    // Read in the serial data to g
    while(Serial.available()>0)
    {
      g[x]=Serial.read();
      x++;
    }
    x=0;
    char ch = g[x];
    
    // Begin filling the upper temp, until the % character
    while (g[x] != '%')
    {
      ut[x-1]=g[x];
      x++;
    }
    
    // Was that actually wanted data?
    if (g[0] != '$')
    {
      // If not, clear the upper temp
      for(int i = 0; i < 25; i++)
      {
        ut[i]=' ';
      }
    }
    
    // Fill the rest to the lower temp until ^ character
    while(g[x+1] != '^')
    {
      x++;
      lt[i]=g[x];
      i++;
    }
    x=0;
    i=0;
    
    // Clear g
    for(int i = 0; i < 53; i++)
    {
      g[i]=' ';
    }
  
    // Upper temp not empty?
    if (ut[0] != ' ')
    {
      // Clear upper line
      lcd.cursorTo(1,0);
      delay(1);
      lcd.printIn(b);
      delay(10);
      // Print new data
      lcd.cursorTo(1,0);
      delay(1);
      lcd.printIn(ut);
      delay(10);
      // Save temp
      for(int i = 0; i < 25; i++)
      {
        u[i]=ut[i];
        ut[i]=' ';
      }
    }
    
    // Lower temp not empty?
    if (lt[0] != ' ')
    {
      // Clear lower line
      lcd.cursorTo(2,0);
      delay(1);
      lcd.printIn(b);
      delay(10);
      // Print new data
      lcd.cursorTo(2,0);
      delay(1);
      lcd.printIn(lt);
      delay(10);
      // Save temp
      for(int i = 0; i < 25; i++)
      {
        l[i]=lt[i];
        lt[i]=' ';
      }
    }
  }
  
  // Otherwise, check if we should be scrolling
  while(!(Serial.available() > 0))
  {
lcd.clear();
    delay(1500);
    // Scroll if the string is off the screen
    if((u[16] != ' ')||(u[17] != ' ')||(l[16] != ' ')||(l[17] != ' '))
    {
      lcd.leftScroll(10,750);
      scrolled=1;
    }
    // If scrolled, redraw the text
    if (scrolled == 1)
    {
      lcd.clear();
      lcd.cursorTo(1,0);
      lcd.printIn(u);
      delay(1);
      lcd.cursorTo(2,0);
      lcd.printIn(l);
      scrolled=0;
    }
  }
}
 

5  Forum 2005-2010 (read only) / Syntax & Programs / Re: problem with lcds on: April 07, 2009, 12:49:34 pm
great, now nothing will show up >_>
6  Forum 2005-2010 (read only) / Syntax & Programs / problem with lcds on: April 07, 2009, 08:07:34 am
i connected  my lcd 100% correct, it works but then all of a sudden it displayed: iuhhgfbbbssqaaqaqzzbd  o

the program is the lcd example hello, word
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Virtual latching relay on: April 02, 2009, 08:07:33 am
huh >smiley-grin

i am still kinda new to arduino, but i dont understand...
8  Forum 2005-2010 (read only) / Syntax & Programs / Virtual latching relay on: March 30, 2009, 11:49:22 am
Code:

//z-parakeet inc.'s Fire Alarm Sketch
#include <LiquidCrystal.h>
// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

int ledPin = 13; // choose the pin for the LED
int buzzerPin = 9; //buzzer/alertor
int inputPin = 8;               // choose the input pin (for a pushbutton)
int val = 0;            // variable for reading the pin status
int truPin = 7;
int Alarms = 6;
int sil = 0;
void setup() {

 pinMode(buzzerPin, OUTPUT);   //declare BUZZER or allertor as a output!
 pinMode(ledPin, OUTPUT);      // declare LED as output
 pinMode(inputPin, INPUT);  // declare pushbutton as input
 pinMode(truPin, OUTPUT);
 pinMode(Alarms, OUTPUT);
     digitalWrite(buzzerPin, HIGH);
     digitalWrite(ledPin, HIGH);
     digitalWrite(truPin, HIGH);
       lcd.print("System Loading");
       lcd.print(".");
       delay(1000);
       lcd.print("..");
               delay(1000);
       lcd.print("...");
   delay(1000);
     lcd.print("System Stats: Standby");
   digitalWrite(buzzerPin, LOW);
   digitalWrite(ledPin, LOW);
   digitalWrite(truPin, LOW);
delay(2000);
}


 

void loop(){
 val = digitalRead(inputPin);  // read input value
 delay(0); //used to be a delay, but changed cuz of my update!
 if (val == HIGH) {      // check if the input is HIGH
 lcd.print("ALERT! TROUBLE OR FIRE");
   digitalWrite(truPin, HIGH);
   digitalWrite(ledPin, HIGH);  // turn LED ON
   delay(50);
   digitalWrite(ledPin, LOW);
   delay(50);
   digitalWrite(buzzerPin, HIGH);
     lcd.print("CHECK PULL STATIONS");
   delay(50);
   lcd.print("OR TEST SWITCH");
   digitalWrite(buzzerPin, LOW);
   delay(50);
   digitalWrite(Alarms, HIGH);
 } else {
     lcd.print("Standby.");
   digitalWrite(ledPin, LOW); // turn LED OFF
   digitalWrite(truPin, LOW);
   digitalWrite(Alarms, LOW);
  
 }
}




ive been posting that alot, but i need to know how to have it once the button is activated, it wont stop till i press the reset button on the arduino duemilinove.
9  Forum 2005-2010 (read only) / Syntax & Programs / Re: It Dont Work Right :( on: March 30, 2009, 10:58:02 am
follower, i was grounded, but here my school dont block this so horah smiley-grin


anyways thanks for the help every1 smiley-grin ;D ;D ;D ;D ;D ;D
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: It Dont Work Right :( on: March 27, 2009, 11:53:50 pm
this thread is about helping me, shoo
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: It Dont Work Right :( on: March 27, 2009, 11:47:43 pm
bump.
12  Forum 2005-2010 (read only) / Syntax & Programs / It Dont Work Right :( on: March 27, 2009, 11:17:27 pm
Quote

 
//z-parakeet inc.'s Fire Alarm Sketch
#include <LiquidCrystal.h>
// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

int ledPin = 13; // choose the pin for the LED
int buzzerPin = 9; //buzzer/alertor
int inputPin = 8;               // choose the input pin (for a pushbutton)
int val = 0;            // variable for reading the pin status
int truPin = 7;
int Alarms = 6;
int sil = 0;
void setup() {

  pinMode(buzzerPin, OUTPUT);   //declare BUZZER or allertor as a output!
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);  // declare pushbutton as input
  pinMode(truPin, OUTPUT);
  pinMode(Alarms, OUTPUT);
      digitalWrite(buzzerPin, HIGH);
      digitalWrite(ledPin, HIGH);
      digitalWrite(truPin, HIGH);
        lcd.print("System Loading");
        lcd.print(".");
        delay(1000);
        lcd.print("..");
                delay(1000);
        lcd.print("...");
    delay(1000);
      lcd.print("System Stats: Standby");
    digitalWrite(buzzerPin, LOW);
    digitalWrite(ledPin, LOW);
    digitalWrite(truPin, LOW);
delay(2000);
}


  

void loop(){
  val = digitalRead(inputPin);  // read input value
  delay(0); //used to be a delay, but changed cuz of my update!
  if (val == HIGH) {      // check if the input is HIGH
  lcd.print("ALERT! TROUBLE OR FIRE");
    digitalWrite(truPin, HIGH);
    digitalWrite(ledPin, HIGH);  // turn LED ON
    delay(50);
    digitalWrite(ledPin, LOW);
    delay(50);
    digitalWrite(buzzerPin, HIGH);
      lcd.print("CHECK PULL STATIONS");
    delay(50);
    lcd.print("OR TEST SWITCH");
    digitalWrite(buzzerPin, LOW);
    delay(50);
    digitalWrite(Alarms, HIGH);
  } else {
      lcd.print("Standby.");
    digitalWrite(ledPin, LOW); // turn LED OFF
    digitalWrite(truPin, LOW);
    digitalWrite(Alarms, LOW);
    
  }
}



 

Theres The Code.
The Problem Is That The Alarm Sounds When Button Is Not Pressed, When Pressed, Nothing Happens, alarm still sounds.

Circuit:


i got it when the alarm led wuz off, but the 6th led on the led chanel wuz the trouble/alarm led :-?
13  Forum 2005-2010 (read only) / Syntax & Programs / Re: how good are you??? on: March 27, 2009, 01:50:24 pm
kk
14  Forum 2005-2010 (read only) / Syntax & Programs / how good are you??? on: March 27, 2009, 01:31:02 pm
i can means i can program...
15  Forum 2005-2010 (read only) / Syntax & Programs / Re: it no workie on: March 27, 2009, 01:32:51 pm
http://www.kevboards.proboards.com






durrrr
i got my arduino on mar 18, im still new darnit
Pages: [1] 2 3 ... 10