[Libphidget-cvs-commits] CVS: libphidget/src/examples ik2lcd.cc,1.1,1.2
Status: Alpha
Brought to you by:
jstrohm
From: Jack S. <js...@us...> - 2002-12-17 20:28:53
|
Update of /cvsroot/libphidget/libphidget/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv24725/examples Modified Files: ik2lcd.cc Log Message: Added more features to the ik2lcd example. Sends more info to the TextLCD and turns on the same digital out when a digital in turned on. Index: ik2lcd.cc =================================================================== RCS file: /cvsroot/libphidget/libphidget/src/examples/ik2lcd.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ik2lcd.cc 17 Dec 2002 03:09:30 -0000 1.1 --- ik2lcd.cc 17 Dec 2002 20:28:51 -0000 1.2 *************** *** 42,45 **** --- 42,46 ---- // this shows how to overload a digital input to catch change value events + char array[9]="--------"; class CMyDigitalIn : public CDigitalIn { *************** *** 63,69 **** --- 64,78 ---- if (value()) + { + array[cardinal()]='*'; _lcd.sendText("Value:On ",1,0); + interfaceKit().digitalOut(cardinal())->value(true); + } else + { + array[cardinal()]='-'; _lcd.sendText("Value:Off",1,0); + interfaceKit().digitalOut(cardinal())->value(false); + } } }; *************** *** 88,92 **** --- 97,103 ---- CTextLCD lcd(textLCDId); CMyDigitalIn *din[8]; + array[8]=0; + lcd.sendText("Digital:",2,0); lcd.on(); *************** *** 95,99 **** --- 106,113 ---- while (1) + { kit.update(); + lcd.sendText(array,3,0); + } // won't get here |