A lot of people including me has encounter a problem where on UWP apps, if a ListView control is being data binded, it will get a default selected item like this: It not only will display as selected item, it also fires SelectionChanged event. However, if we want to make ListView clickable, a popular way is to write the SelectionChanged event handler like this: private void StationsList_ …
I wrote a post about Raspberry Pi Surveillance Camera with Linux and Azure, it was using an ASP.NET website for displaying the photos. I made an UWP client App these days, you can download from here
https://www.microsoft.com/store/apps/9nblgggzfnv0 (Because WP is already finished, so I don't provide Windows 10 Mobile package)
It doesn't allow upload photos, because the photos should all come …
Today, I was rewriting an old ASP.NET MVC5 Demo project to ASP.NET Core, and found that the way we used to read Web.config by ConfigurationManager.AppSettings[] is no longer working. .NET Core has many new ways to achieve this. I picked one that suitable for my project. Here is how I do it. The Classic ASP.NET Code web.config Controller private static CloudBlobContainer GetBlobContainer() …
Starting from Windows 8, one big feature for Windows Store Apps is to share data using Charm Bar across Apps. Although the Charm Bar is removed in Windows 10, but the API for sharing is still in the fight. For example, in my "Image Portray" App, I can share ink to OneNote or Outlook. Today, I added same capability for my "Shanghai Metro" App. Here's how to do it. First, to share data across …
Because Windows 10 IoT Core is not supporting Pi Camera, I can only use Linux instead. These days, I made a surveillance camera, the functionality is simple, when a person passed by the camera, it will take a picture and upload to Microsoft Azure Storage. It also got a website to remotely view the photos. 1. Hardware A PIR Sensor, a Pi Camera, a couple of jump wires. Connect the Singal port of …
Recently Windows 10 IoT Core Build 14393 is coming, but still without PiCamera support, WTF. So I can only choose Linux for my project. When I was using Windows, I use C# + Azure SDK to upload photos to Microsoft Azure. So how to do it on Linux? After some research, here's how to do it. My system is Raspbian Linux. First, we need to install Azure SDK in SSH Terminal: sudo pip install --pre azure …
Because Windows 10 IoT Core is not yet ready to replace Raspbian, in some case, we have to use Linux. The remote operation on Linux is usually done by SSH. If you want remote desktop like the one on Windows. There are two options: tightvnc or xrdp. I used to use tightvnc, it does not have any problem with daily use. But I have to install a tightvnc client on my PC. However, XRDP can be supported …
I bought a 128x64 0.96 inch OLED display, like this one: The driver chip for this screen is called SSD 1306, typically, this chip will have 2 layouts, SPI or I2C. However, the examples fo how to drive I2C with SSD 1306 is very rare, and they run on Raspbian not Windows. Luckly, with the help from a Microsoft Staff in US, we finally got the code to run the screen on Windows 10 IoT Core. 1. …
In the past few days, I have implemented a device that mimics the remote control door of a garage with a Raspberry Pi and share it with you. First of all, I will introduce the remote control and receiver board I use, this kind of remote control module can be bought everywhere in China, and it basically looks like this. Many roller shutter doors and garage doors use this remote control module. For radio experiments, the non-locking version is purchased, so note that it is best to purchase the antenna at the same time. The antenna is a 50 ohm single-core wire, in fact, it is a copper wire, pay attention to the frequency when buying, the radio license frequency in Chinese mainland is 315MHz
Reed switch is an electronic component to connect / disconnect the switch by magnetic field. When it touchs magnetic field, the two iron sheets inside the tube will clip together, so the switch is connected. The application of Reed Swith: Door light controller: When you open the door, turn the light on. When you close the door, turn off the light. This is simply install a reed switch on your …
One of the commonly used LED Tube driver chip is 74HC595, by using the Chip, you can save GPIO ports. I bought an LED Tube with 595 chip, it only needs 3 GPIO ports to display 4 digits. However, there is no existing posts about how to drive the 74HC595 LED Tube from Windows 10. So, I can only try for myself. …
If you need to precisely control the rotation angle of the equipment, ordinary motors can't do it, usually we use stepper motors. For example, the 28BYJ-48 model is easy to buy. The stepper motor has to be used with the driver board, and the most commonly used is the driver board ULN2003 the chip, as shown in the figure below. However, note that the driver board you buy may not look the same, but it doesn't matter, as long as the chip is written on the ULN2003, you can use it, and their interfaces are the same.
In many buildings, there are sound controlled light in use. When you clap your hands, the light turns on. Now, with Raspberry Pi 3 and Windows 10 IoT, we can make a sound controlled light ourselves.
The sound sensor I use is FC-04. As other sensors, the first step is calibration.
1. Calibration for FC-04 Sound Sensor
In quiet environment. Connect VCC to DC 3.3V,GND to Ground. At that time, the …
I bought a moisture sensor like this recently.
After some research, there seem no articles to indicate how to use it in Windows 10. So I figured out myself.
This sensor has 4 Pins, which are:
PIN
Usage
AO
Analog Out
DO
Digital Out
GND
Ground
VCC
Power
So, let's connect VCC to DC3.3v on RPi, I use PIN 01. Connect GND to any ground header, which I use …
I purchased a GY-30 light sensor recently, this model is also known as "BH1550FVI". There seems no sample for this sensor on Windows 10 yet, so I tried to make one.
The light sensor looks like this:
My board is a Raspberry Pi 3, the GPIO layout is shown in this table:
Because GY-30 is an I2C device, so we can not use GPIO to drive it directly, we must use the I2C ports. In addition, …
For those who have watched the "Big Bang Theory", you would probably remember that those physicists build an Internet controlled lamp. The signal send from their laptop traveled around the world and come back to their house to light up the lamp. Now, with Windows 10 IoT Core and Microsoft Azure, we could also achieve the same thing on a Raspberry Pi 3. First, I strongly recommend you to read …
Once upon a time, all user's avatar used to be square. Since Apple's design, now a lot of apps and websites would use a circular avatar instead of a squre one. This is how we used to make square avatar: Starting from Windows 10, Microsoft became the biggist Apple fans, so they changed avatars to circular in Windows system. So how can we make one in XAML without acutally cropping the …
我们写UWP应用的时候难免遇到未处理的异常,不然你的应用就会在用户面前闪退,非常没有逼格。然而Windows.UI.Xaml.Application的UnhandledException事件里面有个巨坑,就是它不能处理async异步方法里的异常。注释里也没提到这回事: // // Summary: // Occurs when an exception can be handled by app code, as forwarded from a native-level // Windows Runtime error. Apps can mark the occurrence as handled in event data. public event UnhandledExceptionEventHandler UnhandledException; 处理全局异常确实 …