UPDATE TERBARU !!!
Sehubungan dengan banyaknya kegiatan, Workshop Arduino mengalami perubahan jadwal,pelaksanaannya menjadi
Tanggal: 19,24,26,28 dan 31 Januari 2012
Waktu : 15.00 - 18.00
/* Universal Gas Sensors using QM-NG1 By :Aan Darmawan date : 31 July 2011 Blog : http://valfa.blogspot.com/2011/08/sensor-gas-universal.html The circuit: * LCD RS pin4 to digital pin 12 * LCD Enable pin6 to digital pin 11 * LCD D4 pin11 to digital pin 5 * LCD D5 pin12 to digital pin 4 * LCD D6 pin13 to digital pin 3 * LCD D7 pin14 to digital pin 2 * LCD R/W pin5 to ground * LCD Vcc pin2 to +5V * LCD Vss pin1 to ground * LCD Vee pin3 to ground * Speaker connected to pin 10 * Sensor Gas Output connected to Analog 0 */ // include the library code: #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); const int inAnalog=A0; float hasil; void setup() { // Serial.begin(9600); // set up the LCD's number of columns and rows: pinMode(13,OUTPUT); digitalWrite(13,LOW); lcd.begin(16, 2); // Print a message to the LCD. lcd.print("Deteksi Gas...."); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): hasil=analogRead(inAnalog); // Serial.println(hasil,BYTE); hasil=hasil/1024*100; lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(hasil); lcd.print(" % "); if(hasil>=30.00){ digitalWrite(13,HIGH); tone(10,1000); // speaker connect to pin 10 tone 1KHz delay(1000); } else { digitalWrite(13,LOW); noTone(10); // tone at pin 10 off } delay(100); }
/* Password for electronics key by: Aan Darmawan date : July 2011 web: http://valfa.blogspot.com */ // include the library code: #include <LiquidCrystal.h> #include <Keypad.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); const byte ROWS = 4; //four rows const byte COLS = 4; //four columns const int nada[8]={ 131,175,262,349,523,698,1047,1397}; char keys[ROWS][COLS] = { { '1','2','3','A' } , { '4','5','6','B' } , { '7','8','9','C' } , { '*','0','#','D' } }; char berita[16]={ ' ',' ',' ',' ', ' ',' ',' ',' ', ' ',' ',' ',' ', ' ',' ',' ',' '}; char tampil[16]={ ' ',' ',' ',' ', ' ',' ',' ',' ', ' ',' ',' ',' ', ' ',' ',' ',' '}; byte rowPins[ROWS] = { 14,15,16,17}; //connect to the row pinouts of the keypad byte colPins[COLS] = { 9, 8, 7, 6}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); byte k=4,n=0; String jawab,kunci="123456"; void setup() { pinMode(13,OUTPUT); pinMode(10,OUTPUT); digitalWrite(13,LOW); lcd.begin(16, 2); lcd.print("Password:"); } void loop() { //check key pressed char key = keypad.getKey(); if (key != NO_KEY){ berita[n]=key; tampil[n]='*'; tone(10, nada[k],250); n++; if(n>15){ for(n=1;n<=15;n++)berita[n-1]=berita[n]; n=15; berita[n]=' '; } lcd.setCursor(0, 1); lcd.print(tampil); noTone(4); } if(key=='#'){ // jawaban 6 digit pertama yang masuk dipindah ke string for(n=0;n<6;n++)jawab+=berita[n]; if(jawab==kunci){ digitalWrite(13,HIGH); lcd.setCursor(0, 1); lcd.print("Access Granted !"); tone(10, nada[7],1000); } else { lcd.setCursor(0, 1); lcd.print("Access Denied ! "); tone(10, nada[1],500); } delay(1500); for(n=0;n<=15;n++){ berita[n]=' '; tampil[n]=' '; } lcd.setCursor(0, 1); lcd.print(tampil); n=0; jawab=String(); } else digitalWrite(13,LOW); delay(100); }
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib #include <Wire.h> #include "RTClib.h" RTC_DS1307 RTC; void setup () { Serial.begin(57600); Wire.begin(); RTC.begin(); if (! RTC.isrunning()) { Serial.println("RTC is NOT running!"); // following line sets the RTC to the date & time this sketch was compiled RTC.adjust(DateTime(__DATE__, __TIME__)); } } void loop () { DateTime now = RTC.now(); Serial.print(now.year(), DEC); Serial.print('/'); Serial.print(now.month(), DEC); Serial.print('/'); Serial.print(now.day(), DEC); Serial.print(' '); Serial.print(now.hour(), DEC); Serial.print(':'); Serial.print(now.minute(), DEC); Serial.print(':'); Serial.print(now.second(), DEC); Serial.println(); Serial.print(" since midnight 1/1/1970 = "); Serial.print(now.unixtime()); Serial.print("s = "); Serial.print(now.unixtime() / 86400L); Serial.println("d"); // calculate a date which is 7 days and 30 seconds into the future DateTime future (now.unixtime() + 7 * 86400L + 30); Serial.print(" now + 7d + 30s: "); Serial.print(future.year(), DEC); Serial.print('/'); Serial.print(future.month(), DEC); Serial.print('/'); Serial.print(future.day(), DEC); Serial.print(' '); Serial.print(future.hour(), DEC); Serial.print(':'); Serial.print(future.minute(), DEC); Serial.print(':'); Serial.print(future.second(), DEC); Serial.println(); Serial.println(); delay(3000); }