Beispiel #1
0
//==============================================================================================
//=============================================SETUP LOOP=======================================
//==============================================================================================
void setup() {
    pinMode(RLED, OUTPUT);
    pinMode(GLED, OUTPUT);
    pinMode(BLED, OUTPUT);
    pinMode(wire1, INPUT);
    pinMode(wire2, INPUT);
    pinMode(wire3, INPUT);
    pinMode(wire4, INPUT);
    pinMode(largeKey, INPUT);
    pinMode(smallKey, INPUT);

    TCCR1A |= (1 << COM1A0);
    TCCR1B |= (1 << WGM12) | (1 << CS12);
    TIMSK1 |= (1 << TOIE1);
    sei();

    lcd.begin(16, 2);
    lcd.clear();
    lcd.print("Bomb prop V1.1");
    lcd.setCursor(0,1);
    lcd.print("J McKenna [MMS]");
    for (int i = 0 ; i <= 3 ; i++) {
        delay(500);
        setLED(0);
        delay(500);
        setLED(1);
    }
    lcd.clear();
}
Beispiel #2
0
void loop(){
  if(analogRead(0)<800)err=0;
  while(err!=1 && digitalRead(pinErr)!=HIGH){
    digitalWrite(pinR1, LOW);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("R1 ON");
    delay(5000);
    digitalWrite(pinR2, LOW);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("R2 ON");
    delay(5000);
    //if(analogRead(pinTemp)<=0 && analogRead(pinTemp)>=100) digitalWrite(pinR3, LOW);
    //else err=1;
    if(digitalRead(pinErr)==HIGH) {
      err=1;
      lcd.clear();
      lcd.print("Err R3");
      digitalWrite(pinR1, HIGH);
      digitalWrite(pinR2, HIGH);
      digitalWrite(pinR3, HIGH);
    }
  }
  lcd.setCursor(0,0);
  lcd.print("Error!");
  digitalWrite(pinR1, HIGH);
  digitalWrite(pinR2, HIGH);
  digitalWrite(pinR3, HIGH);

}
Beispiel #3
0
void loop(){
  if(gameFinished == false){
    float time_to = random(1,2); //.. Aantal milliseconde om mee te beginnen
    int i;
    float current_multiplier = 0.98;
    float cashedOutMultiplier;
    int randomNumber = random(0,1000);
    if(randomNumber < 201){
      randomNumber = 0;
    }
    for(i = 0; i <= randomNumber; i++){
      switch (lcd_key){
        case btnSELECT:{
          cashedOut = true;
          cashedOutMultiplier = current_multiplier;
          break;
        }}
        lcd.clear();
        lcd.print("BustaDuino");  // print a simple message on the LCD
        lcd.setCursor(0, 1);
        if(randomNumber > 0){
          current_multiplier = current_multiplier + 0.01;
        }else{
          current_multiplier = 0;
        }
        
        lcd.print(String(current_multiplier) + "x");
        Serial.print(String(current_multiplier) + "x");
        lcd_key = read_LCD_buttons();   // read the buttons
        if(i <= randomNumber && cashedOut == true){
          lcd.clear();
          lcd.print("You Win!");
          lcd.setCursor(0, 1);
          lcd.print(String(cashedOutMultiplier) + "x");
          Serial.print(String(cashedOutMultiplier) + "x");
          gameFinished = true;
          break;
        }else if(i >= randomNumber && cashedOut == false){
          lcd.clear();
          lcd.print("BUSTED!");
          lcd.setCursor(0, 1);
          lcd.print(String(current_multiplier) + "x");
          Serial.print(String(current_multiplier) + "x");
          gameFinished = true;
        }
        delay((time_to/i) * 3000);
    }
  }
}
Beispiel #4
0
void StartSingle() {
	lcd.clear();
	lcd.setCursor(1,0);
	lcd.print("Get Ready in...");
	delay(300);
	for (int i=0; i<5; i++) {
		lcd.setCursor(8,1);
		lcd.print(5-i);
		delay(1000);
	}
	lcd.clear();
	lcd.setCursor(6,0);
	lcd.print("GO!");
	StartTimer();

}
Beispiel #5
0
// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
 
  lcd.clear();
}
Beispiel #6
0
void IntroScreen::begin( LiquidCrystal &_lcd ) {
	_lcd.noBlink();
	_lcd.clear();
	_lcd.print("Time Lapse");
	_lcd.setCursor(0, 1);
	_lcd.print("Controller");
}
//User is chosen, value between 1 and 5
void selectUser() {

 userselected = 1;
 int done = 0;
 lcd.clear();

 while(!done) {
  printUser();
  pressed = btnpressed();
  switch (pressed) {
  case UP :
  if(userselected > 1) userselected--;
  break;
  case DOWN :
  if(userselected < 5) userselected++;
  break;
  case SELECT :
  done = 1;
  break;

  }
  delay(500);
 }


}
void loop() {
   lcd.clear();
  lcd.print("http://powerpacks." );
  lcd.setCursor( 0,1 );
  lcd.print("ArcolaEnergy.com");
  lcd.setCursor( 0,3 );

 lcd.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
  lcd.print(":");
  lcd.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
  lcd.print(":");
  lcd.print(RTC.get(DS1307_SEC,false));//read seconds
  lcd.print("      ");                 // some space for a more happy life
  lcd.print(RTC.get(DS1307_DATE,false));//read date
  lcd.print("/");
  lcd.print(RTC.get(DS1307_MTH,false));//read month
  lcd.print("/");
  lcd.print(RTC.get(DS1307_YR,false)); //read year 
 

digitalWrite( STATUS_OK, HIGH);
digitalWrite( STATUS_BAD, LOW );
  delay( 100 );
  digitalWrite( STATUS_OK, LOW);
digitalWrite( STATUS_BAD, HIGH );
delay( 100 );
}
Beispiel #9
0
bool button_pressed() {
    bool pressed = button.uniquePress();
    if (pressed) {
        lcd.clear();
    }
    return pressed;
}
Beispiel #10
0
void printDateAndTime(LiquidCrystal & lcd, Date & date, Time & time) {
	lcd.clear();
	lcd.setCursor(0,0);
	date.print(lcd);
	lcd.setCursor(0,1);
	time.print(lcd);
}
Beispiel #11
0
void loop() {
  noLight=digitalRead(digitalSignal);//
  lightness=analogRead(analogSignal); // и о его количестве
  // set the cursor to column 0, line 1
  lcd.setCursor(0, 0);
  //вывод сообщения
  Serial.print("There is ");
  
  lcd.clear();
  
  
  if (noLight) {
    Serial.println("1");
    lcd.print("1");
  }
  else { 
    Serial.println("0");
    lcd.print("0");
  }
  Serial.print("value: ");
  Serial.println(lightness);
   
  lcd.setCursor(0, 1);
   //clearLCD();
  lcd.print(lightness);
  
  delay(1000); //задержка 1 сек    
}
void loop() {

   statoPulsante = digitalRead(6);
   if(statoPulsante != precedenteStatoPulsante)
      if (statoPulsante == LOW) {
         risposta = random(8);

         lcd.clear();
         lcd.setCursor(0,0);
         lcd.print("La Palla dice:");
         lcd.setCursor(0,1);

       switch(risposta) {
          case 0: lcd.print("Si"); break;
          case 1: lcd.print("Molto probabilmente"); break;
          case 2: lcd.print("Certamemte"); break;
          case 3: lcd.print("Sembra di si"); break;
          case 4: lcd.print("Insicuro"); break;
          case 5: lcd.print("Domanda ancora"); break;
          case 6: lcd.print("Molto dubbio"); break;
          case 7: lcd.print("NO"); break;
          };
    };
   precedenteStatoPulsante = statoPulsante;   
}
Beispiel #13
0
void setup()
{
    RFID.begin(9600); // start serial to RFID reader
    Serial.begin(9600); // start serial to PC
    lcd.begin(16, 2);
    //lcd output
        lcd.clear();
        lcd.print("There are "); //start printing the result
        lcd.print(space_left); //then how many spaces
        lcd.print("  spaces left."); //words
        lcd.println(" "); //spaces
    
    for (int i = 0; i < 5; i++)
    {
       id_marker[i] = 0;
    }
    
    Serial.println("Ready!");
     
  //sets everything in the array equal to blank
 for(int i=0; i<5; i++)
        {
            id_array[i] = String("");
        }
  
}
Beispiel #14
0
void clr(int delayTime) {
  lcd.clear();
  delay(20);
  lcd.print(timeOutText);
  delay(delayTime);  
  //lcd.print(".");
  //delay(1000);
}
void LcdHandler::refrashScreen(int menuPosittion, double *setParameters, Menu *menu)
{
	lcd.clear();
	lcd.setCursor(0, 0);
	lcd.print(menu->getItem(menuPosittion));
	lcd.setCursor(0, 1);
	lcd.print((int)setParameters[menuPosittion]);
}
Beispiel #16
0
void writeNewMsg(){
  lcd.clear();
  lcd.noCursor();
  lcd.print(currMsg); 
  lastBlink = millis();
  isOn = 1;
  bHaveNewMsg = 0;
  digitalWrite(onOffPin,HIGH);
}
Beispiel #17
0
void checkOnOff(){
  if(isOn){
    if((millis() - lastBlink)  > timeOn){
      digitalWrite(onOffPin, LOW);
      lcd.clear();
      isOn = 0;
    }
  }
}
void Clock::printDateTime(void) {
	lcd.clear();
	lcd.setCursor(0, 0);

	printDate();
	// Start at beginning of second line
	lcd.setCursor(0, 1);

	printTime();
}
Beispiel #19
0
void StatsScreen::drawScreen( LiquidCrystal &_lcd ) {
	_lcd.clear();

	_lcd.setCursor(0, 0);
	_lcd.print("Taken: ");
	_lcd.print(taken);

	_lcd.setCursor(0, 1);
	_lcd.print("Next: ");
}
Beispiel #20
0
/*
	Writing non-variable characters.
*/
void FirstWrite()
{
	lcd.clear();
	for (byte i = 0; i < ROWCOUNT; i++)
	{
		lcd.setCursor(0, i);
		lcd.print(prefix[i]);
		lcd.setCursor(LCDWIDTH - postfix[i].length(), i);
		lcd.print(postfix[i]);
	}
}
//Bin lid open
void open() {
  pos = 140;
  myservo.write(pos);
  selectUser();
  transmituser = userselected;

  delay(1000);
  lcd.clear();
  lcd.setCursor(0, 0);

  //Provides wifi password on LCD
  lcd.print("PASSWORD:");
  lcd.setCursor(0, 1);
  lcd.print("24409193");
  delay(5000);
  lcd.clear();
  lcd.print("ENJOY YOUR WIFI");
  delay(5000);
  lcd.clear();
}
Beispiel #22
0
void EventBusRx(uint8_t uPort, uint8_t uCmd, uint8_t* uuData, uint8_t uLength) 
{
	oLcd.clear();
	delay(1000);
	oLcd.setCursor(0, 0);
	oLcd.print("PORT: ");
	oLcd.print((int) uPort);
	delay(500);
	oLcd.setCursor(0, 1);
	oLcd.print("CMD: ");					
	oLcd.print((int) uCmd);
	delay(500);
	


	switch (uPort)
	{
		case LCD_PORT:
			switch (uCmd)
			{
				case LCD_CMD_CLEAR:
					oLcd.clear();
					break;
				case LCD_CMD_VERS:
					oLcd.clear();
					oLcd.setCursor(0, 0);
					oLcd.print("KUI-team (c)");
					delay(1000);
					oLcd.setCursor(0, 1);
					oLcd.print("Ver. 1.0");					
					delay(100);
					break;
				case LCD_CMD_PRINT:
					oLcd.clear();
					oLcd.setCursor(0, 0);
					for(uint8_t n = 0; n < uLength; n++)
						oLcd.print((char) uuData[n]);					
					break;
			}
	}
}
Beispiel #23
0
void numberDisplay(int number){
  int byteValue;
  if((lcd.print(number1) < 10)){
    lcd.clear();
    lcd.setCursor(0,0);
    if(!isDecimalPointOn){
      lcd.clear();
    lcd.setCursor(0,0);
  			number1 = number1 * 10 + number;
    	}
    if(isDecimalPointOn && (lcd.print(number1) < 10)){
      lcd.clear();
    lcd.setCursor(0,0);
      		i++;
      		number1 = number * pow(10, -i) + number1;
    	}
  
    byteValue = lcd.print(number1, i);

  }
}
void LcdHandler::printHomeScreen()
{
	lcd.clear();
	lcd.setCursor(0, 0);
	lcd.print("Temp: ");
	lcd.print((int)*temp);
	lcd.print(" C");
	lcd.setCursor(0, 1);
	lcd.print("Hum: ");
	lcd.print((int)*hum);
	lcd.print(" %");
}
void trigger() {
  lcd.clear();         // clears the screen and buffer
  lcd.setCursor(3,0);
  lcd.print("Time is up");
  
  lcd.setCursor(1, 1); // set timer position on lcd for end.
  lcd.print("END OF SHOWER");

  turnDownServo();
  delay(1000);
  lcd.display();
}
Beispiel #26
0
void Menux::showMenuOption(LiquidCrystal &lcd) {
	// Se envía al display el título del grupo de MenuOptions	
	lcd.clear();
	if (presentMenuCode == 1) {
		titleMenuOption = "Menu General";
	}
	lcd.setCursor(0, 0);
	lcd.print(titleMenuOption);
	// Se envía al display la MenuOption actual
	lcd.setCursor(0, 1);
	lcd.print(menuOptionList[presentOption].getOptionText());
	return;
}
void HeaterControl::heaterSafety(double currTemp, double setTempPoint,int warnPoint, int maxPoint)
{
  if (currTemp >= warnPoint && currTemp < maxPoint)
  {
    lcd.clear();
    lcd.setCursor(4,0);
    lcd.print("WARNING!");  
    lcd.setCursor(3,1);
    lcd.print("TEMP HIGH!");
    delay(2000);
  }
  else if (currTemp >= maxPoint)
  {
    digitalWrite(heaterPin,LOW);
    lcd.clear();
    lcd.setCursor(2,0);
    lcd.print("HEATER OFF!");
    lcd.setCursor(1,1);
    lcd.print("TEMP TOO HIGH!");
    delay(2000);
  }
}
Beispiel #28
0
void PIDControl::displayTemp(double currTemp, double setTempPoint)
{
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Cur Temp: ");
    lcd.print(currTemp);
    lcd.print(" C");
    lcd.setCursor(0,1);
    lcd.print("Set Temp: ");
    lcd.print(setTempPoint);
    lcd.print(" C");
    delay(2000);
}
Beispiel #29
0
void calibrate_countdown(void) 
{
    lcd.print("Starting rover");
    lcd.display();
    for (int i = 5; i > 0; i--) {
        _count(i*2 - 1);
        delay(1000);
        _count(i*2 - 2);
        humidity();
        moisture();
        delay(1000);
    }
    lcd.clear();
}
void setup()
{
  SIM900.begin(9600);
  Serial.begin(9600);
  lcd.begin(16, 2);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  pinMode(10, OUTPUT);
  lcd.setCursor(3,0);
  lcd.print("CAR THEFT");
  lcd.setCursor(1,1);
  lcd.print("DETECTION SYS");
  delay(2000);
  lcd.clear();
}