Monthly Archives: December 2013

Senheng Online Store

Senheng  as one of the leading electrical appliances store in Malaysia, and known to have a sucky website since day 1. Now, they finally had revamp it with new features like e-commerce system, responsive design, better product catalogue, new layout, using cdn… But sadly, it is still full with bugs and errors. senheng error For example, the promotion page have connection to db error msg. senheng messy   An e-commerce page that’s messy and long way scrolling down, more like a spoiled layout. responsive design   And a responsive design page that doesn’t looks good on small screen. IT is crucial in today retail business, looks at example like wallmart and dell, or even china gome. I likes some of senheng concept such as modern looking store & nationwide free delivery, and is always looking forward hoping to see they get serious in online store. As the best company to work for in Asia year 2013, senheng might have a happy to work in environment, but for sure, their IT staff still have many rooms of improvement.      

Sending IR signal with Arduino

Pre requisite I assume you have already know how to receive IR signal with arduino. If not, you may read this. You need Download Arduino-IRremote-master from git hub, move to library folder under arduino. Also make sure you are using Arduino 1.0.5, latest beta 2.x not working with this IR library. sku_266569_2 I got my IR emitter module from 37-in-1 sensor module kit at dx.com. This kit includes a IR emitter and IR receiver, along with many other sensors and controller, but without the mp3 remote controller. At the time of writing, dx.com have a new product pack where it comes with a mp3 remote controller, infrared receiver module and an extra infrared emitter module (for sending). The price is only usd 5.80. Construct the circuit It is very simple, just connect your emitter module, the  – pin to GND (ground), S pin to pin 3 on arduino. Leave the center pin unconnected. The following code will send the signal in NEC hex format of value ‘0xFF18E7’, which is equal to button 2 of the mp3 controller. To test it You will need 2 arduino board to test run it. One board for the sending, another for the receiving. Like this photo shows: 20131208_170614 p/s: I added a LED on the receiving board to acknowledge my transmission successful. My sender board is an identical Arduino Uno but with an Ethernet shield on top of it. Notice how i place my emitter and receiver module facing each other openly, without blocking. How about both on the same board? I tried to put both sending and receiving module together on one Arduino board, hopping the sending signal can be received by the same board simultaneously, but failed. It seems like due to the single threaded nature of Arduino processor, we cant do these 2 things at the same time. Googling reveal similar questions without answer: http://forum.arduino.cc/index.php?topic=28745.0 Please let me know if you found ways to do this 😉

Receive IR value with Arduino

You need Download Arduino-IRremote-master from git hub, move to library folder under arduino. Also make sure you are using Arduino 1.0.5, latest beta 2.x not working with this IR library. I am using infrared receiver module manufactured by keyes, come together with an IR mp3 remote control and a nomral LED, purchase from dx.com at usd4. At the time of writing, dx.com have a new product pack where it comes with a slightly different mp3 remote controller, same infrared receiver module and an extra infrared emitter module (for sending). The price is only usd5.8. Validate IR remote control is working Human can’t see IR light with naked eye. How can we validate the remote control is actually functioning? Fortunately, you can check infra-red with a smart phone camera. Latest iphone have IR filter so it will fail, but I tested on samsung galaxy s3 and works. 20131208_001119 20131208_001241 The IR receiver According to dx.com spec, the receiver sensor adopt HX1838, high sensitivity; Working voltage: 5V; Testing distance: 5~8m; Construct the circuit The circuit is very simple. sketch.modified 20131208_133548 Once you have IRremote library installed, your will beable to get the example thru arduino ide interface. Open File->Examples->IRremote->IRRecvDemo I enhanced it by adding a function decodeSignal to transform IR value into meaningful value like button 1, 2, 3, power, mute…  

Monetizing win phone 8 app with Microsoft pubCenter

Ok, there are many online tutorial out there if you google, and they will guide you step by step from installing the Microsoft advertising SDK for win phone 8, register account at pubcenter… until getting the ads display on your app. For example, like this one: http://msdn.microsoft.com/en-us/library/advertising-mobile-windows-phone-8-adcontrol-walkthrough-api(v=msads.20).aspx However, I followed this tutorial but ads is not showing in my app. Something wrong. The debug output shows an exception message: Thanks to Chia Shaw Chyn that highlighted it could be a missing capabilities issue. So i hook up a function onto this adControl object to track down the detail when error occurred. Ok… now it output debug msg like: To add missing capabilities, Goto Solution->project->properties->WMAppManifest.xml->Capabilities (tab), make sure you have the following ticks:
  • ID_CAP_IDENTITY_DEVICE
  • ID_CAP_IDENTITY_USER
  • ID_CAP_MEDIALIB_AUDIO
  • ID_CAP_MEDIALIB_PHOTO
  • ID_CAP_MEDIALIB_PLAYBACK
  • ID_CAP_NETWORKING
  • ID_CAP_PHONEDIALER
  • ID_CAP_WEBBROWSERCOMPONENT
BOLD: are the one that the tutorial missed and is important to make sure they are ticked. For you who are interested, the complete code for my MainPage.xaml.cs is as below:  

Completely turnoff UAC on win8 pro

The good looking interface doesn’t seems to work for me as it still keep prompting me action whenever a new app/software to install/uninstall. The better way to turn it off all for once is at control panel -> Administrative Tools -> Local Security Policy On the left pane, browse for Local Policies -> Security Options Scroll to the bottom and you will find a list of User Account Control related settings. Don’t ask me what they do and how it affect when disable/enabled it, you can click the item and read at explanation tab. Yes, it is complicated and it’s just another god damn things that M$ did to makes everyone life miserable. Please take note your metro app will get affected after turning UAC off in this method. http://social.technet.microsoft.com/Forums/windows/en-US/60d3a7af-cd21-4ea4-ac97-ebfab2aa6ed4/apps-not-allowed-when-uac-is-disabled?forum=w8itprogeneral

Reading multiple digital Input

Reading multiple digital input is not much different than reading single digital input. First, construct this circuit. sketch_bb Then, use this little piece of coding: Done! Note: You must resistor with push button or else it wont works. t Some Photos: WP_20131201_18_01_03_Pro