HELLO, I AM Min Maung

Follow me on Twitter at @IAmMinMaung

Follow Me

Leave a mCookie Out for Santa

Ever want to know when Santa is in the house? Why not set up a trap? You can do it with a mCookie, a stackable microcontroller. The goal behind this is when Santa climbs down the chimney or makes some noise while everyone is sleeping, it will trigger an alarm.

 

Earlier in the year there was a Kickstarter campaign by Microduino to create a stackable Arduino called mCookie. It is a great educational starter kit to get anyone into the world of Microcontrollers. It is mounted via magnets, so when magnets line up and snap together you know you have good connection between modules. Due to this there is no need to learn to solder as long as you get the right modules for what you need. If you want to build an IoT project, you can do so by using a Wi-Fi or a Bluetooth module. It is great for getting kids involved in this too, because you can connect these mCookies to Lego blocks. Here is a video of what mCookie can do.

 

mCookie uses Arduino IDE. The core of the mCookie is an Arduino Leonardo, so if you already have it installed you are good to go. If you do not, you can grab it from here.  You can find many more tutorials here.  For the demo, you will be combining “Sound Detection Sensor” tutorial and “The Use of Buzzer” tutorial.

 

We need to detect when Santa is making noise from eating cookies too loud, the buzzer tutorial is key to getting this to work. It uses analog pins. All that is required to read the analog pin is this command: analogRead(mic_pin). You will need to figure out how loud your existing environment is to set a base threshold. If the noise you make is louder than the threshold then you will execute the buzzer alarm using the code from the buzzer tutorial. Once you are done coding, all you need to do at this point is to put the Lego pieces together to hide the electronics. The end product should look like this in my video.

 

The code for this whole setup looks like this:

 

 


#define buzzer_pin 6 //Define buzzer driving pin 
#define mic_pin A0
 
int sensorValue;
int buzzerRingAmount = 1;
int buzzerCount =0;
void setup()
{
  pinMode(buzzer_pin,OUTPUT);
  Serial.begin(9600);
  pinMode(mic_pin, INPUT);
}
 
void loop()
{
   sensorValue = analogRead(mic_pin);
  // print out the value you read:
  Serial.print("Sound:");
  Serial.println(sensorValue);
  if(sensorValue>50){
    alarm();
  }
  delay(100);        // delay in between reads for stability
}
void alarm(){
  buzzerCount = 0;
  while(buzzerCount<buzzerringamount){ 200hz="" 2s.="" 5ms.="" 800hz="" a="" circular="" for="" frequency="" from="" highest="" i="200;i<=1000;i++)" in="" increase="" int="" lasts="" manner.="" n0.4="" output="" port.="" the="" to="" void="">=200;i--)
  {
    tone(buzzer_pin,i);
    delay(10); //The frequency lasts for 10ms. 
  }
}



#define buzzer_pin 6 //Define buzzer driving pin 
#define mic_pin A0
 
int sensorValue;
int buzzerRingAmount = 1;
int buzzerCount =0;
void setup()
{
  pinMode(buzzer_pin,OUTPUT);
  Serial.begin(9600);
  pinMode(mic_pin, INPUT);
}
 
void loop()
{
   sensorValue = analogRead(mic_pin);
  // print out the value you read:
  Serial.print("Sound:");
  Serial.println(sensorValue);
  if(sensorValue>50){
    alarm();
  }
  delay(100);        // delay in between reads for stability
}
void alarm(){
  buzzerCount = 0;
  while(buzzerCount<buzzerringamount){ 200hz="" 2s.="" 5ms.="" 800hz="" a="" circular="" for="" frequency="" from="" highest="" i="200;i<=1000;i++)" in="" increase="" int="" lasts="" manner.="" n0.4="" output="" port.="" the="" to="" void="">=200;i--)
  {
    tone(buzzer_pin,i);
    delay(10); //The frequency lasts for 10ms. 
  }
}

STAMP CAMP 3D!

Join author/illustrator, Sean Archer, and robot building mastermind, Min Maung, on a 3D printing imagination adventure! Campers of any age will learn about 3D printing in easy to understand language. They’ll hear about the process of going from page to print, and see how Sean and Min created a series of rubber stamps for the c2e2 conference in April 2015. Then Sean will guide all of the campers in creating their own outstanding designs. The group will vote, and the top five (one from each age group) will have their stamp designs printed to take home and stamp everything within arm’s reach. Every camper who attends will receive a 3D printed stamp to remember their time at That Conference.

 

 

 

A Jumpstart on Deploying Xamarin Based Applications Using Existing Windows Phone Code

It is of no surprise that we would like to write code once and deploy everywhere. The time where an application is available exclusively to mobile platform is over. With that said, we can either develop for each of the three major platforms, or start investing in multiplatform deployment tools. In this article we will focus on using Portable Class Libraries (PCLs) to help speed up mobile development and consuming them in Xamarin projects.

Portable Class Library is a project type available in Visual Studio. The goal of using PCLs is to put as much of reusable logic into this as possible. What does that mean? You will want to put in your business logic as well as how you get data into this project. Here are the steps:

  1. Create New Project

     

     

  2. After creating the project go into the properties and change the target.


     

     

     

     

 

The key to using PCLs efficiently is determined here. You will want to go with the lowest common denominator. For example, if you choose Windows 8.1 and Windows Phone 8.1 you will not get data annotations because Windows Phone 8.1 will not support data annotations even though Windows 8.1 will. You can check out support features for .Net Framework, Windows Store, Windows Phone Store, Windows Phone Silverlight, Silverlight, and Xbox 360 here: https://msdn.microsoft.com/en-us/library/gg597391%28v=vs.110%29.aspx

Portable class libraries are available as a project type in Xamarin Studio, even if you are using the Starter Edition (Free). Using Xamarin Studio you can follow similar process:

 

 

 

Once you have your PCL coded, you can now add it to your Android or iOS Xamarin project. Now add the PCL as a reference in your mobile project.

 

 

Now you can use that reference in your code. You can use the same library for your Windows Phone apps, Windows Store apps, Xamarin Android app, and Xamarin iOS app. It sure beats having to rewrite the same code over and over again in multiple projects. This will leave one more time to focus on making richer UX designs.

 

 

You can download the demo project here: http://1drv.ms/1QmPWtd