Showing posts with label Students. Show all posts
Showing posts with label Students. Show all posts

Wednesday, July 25, 2018

Azure Deployments With Powershell

The aforementioned Azure Powershell files are now located here.    The goal is to determine the relationship between the ARM, parameters, and Template files.  We will review and take it from there.  Yay!

Friday, January 19, 2018

.NET: ASP.NET CORE 2.0

After a long patient wait, it has finally happened – I'm using ASP.NET CORE 2.0 on all my new projects at work and converting some of my old.   I'm very excited!

Why is this an important advancement for us Microsoft developers?   Simply put,  I can now write applications that will run cross-platform.   And I can do it easily.  I'm not so limited to operating systems or mobile vs. Desktop.  I can keep writing in my favorite flavor – C# -- but I also get to stretch out my JavaScript muscles.   I can run Visual Studio on my Windows PC, my Mac, or my Linux box.   In fact, though Visual Studio makes life easier and faster, I don't really even need it.   

I can download the .NET CORE SDK on either OS and I am ready to go.  I can use the same templates used in Visual Studio but just initialize them via the command prompt.  Code can be built and ran from this same prompt.  I can edit the code via any text editor.   To make it sweeter; however, downloading the free editor – Visual Studio Code – I can also walk through code and debug!    

I know, it's been around a while, but in the corporate world, I've gotten started earlier than allot of folks.  I cannot say what this does to my efforts at continuous delivery – I actually started to think that I might permanently end up in the Java world without choice. 

You can read about ASP.NET CORE here!

Tuesday, May 2, 2017

Raspberry Pi: Attach A Sensor To Raspberry Pi and Receive Mobile Alerts

In this particular scenario, my goal was to attach a motion sensing device to Raspberry Pi Zero W and have it send me alerts.   Now that this basic functionality is achieved, I can modify and reuse it as I wish. 

I used the following: 

Hardware: 
  1. Raspberry Pi Zero W 
  1. PIR motion sensor (EMY 5 X HC-SR501 Adjust Ir Pyroelectric Infrared PIR Motion Sensor Detector) 
Software: 
  1. (Operating system: Debian) 
  1. Programming Language:  Node.js 
  1. Communication medium:  IFTTT.com 
STEP ONE:  ATTACHING THE PIR 
This PIR component has three pins (Power, Output, Ground.)  Using female-to-male cables, I attached as follows: 
PIR PINS 
RASPBERRY PI GPIO PINS 
POWER 
PIN 2 (5v) 
OUTPUT 
PIN 7 
GROUND 
PIN 6 

STEP TWO: 
  1. If you don't have one already, set up an account at ifttt.com .  Personally, I do not recommend this site for confidential actions but it is fun to play with! 
  1.  Navigate to "My Applets" and click on "New Applet" 
  1. Click the "Plus" image and you should be taken to a page "Choose a service" 
  1. Search for "web"  and choose "Maker Webhooks" 
  1. Select "Receive a web request" as a trigger 
  1. Enter the following tag:  "motion_detected" to create a trigger 
  1. You should be re-directed to a page that reads "If (webhook) then" Plus sign. 
  1. Select the "SMS" service. 
  1. Select "Send me an SMS" 
  1. Enter your tag  "motion_detected" to create an action and then add the phone number for SMS 
  1. You should receive a special "key".  Save this. 
  1. Review changes and save. 
STEP THREE: INSTALLING SOFTWARE ON PI: 
  1. Create a folder for project and ensure internet is connected. 
  1. Open a terminal window, type the following: 
  1. Test to see if Node.js is installed) 
 Node –v 
  1. If no version is returned or version is below v6, get latest: 
                      curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - 
  1. Once version is downloaded, then install:   
sudo apt-get install –y nodejs 
  1. Test to see if latest version of Node.js is installed: 
Node –v 
  1. Download this code into your folder from here:  pir_motion_trigger.js 
  1. Open code (pir_motion_trigger.js) in text editor.  You will change the following lines of code to customize for your IFTTT applet: 
     // IFTTT data 
     var key = "enter key here" 
     var eventName = "motion_detected" 
  1. Save code and close 
  1. Once again, open a terminal window and navigate to your folder.   
  1. Type the following: 
sudo node pir_motion_trigger.js 
  1. Wait a minute or two then wave your hand in front.  Soon you should get a text message. 

NOTE:  This particular model of PIR has the ability to adjust sensitivity for motion delay and distance.  You can manipulate by adjusting the two yellow/orange screws or programmatically. 

Sunday, April 30, 2017

Raspberry Pi: Remotely Connect To Raspberry Pi From Windows

Remote Desktop Connection:  Connecting one computer to another gaining the ability to take control of the remote computer. 

The Raspberry Pi Zero can be especially difficult to program for Windows users.  The tiny microcomputer runs on a Linux-based operating system.  Hooking up a small computer to an external monitor is not a problem but adding keyboard or mouse can get painful without the proper resources and experience.  Instead,  below is what we can do. 

First, an external monitor and keyboard will be needed for the initial setup.  If you haven't done this,  then there is good documentation here. 

Second, your main PC will need to be on the same network as your Raspberry Pi. On the Pi, you will need to get it's IP Address.  This can be done by opening the command terminal and typing "ifconfig"  This should return a list of network information.  Locate a line for "wlan*" and in here you will jot down the address following the entry "inet6 addr: "    It should look something like:   192.168.1.12.  You will use this address to connect.  Note that your Raspberry Pi will most likely want you to enter UserId and Password. 

Third, follow these well-written instructions here to walkthrough the process:   https://www.raspberrypi.org/documentation/remote-access/vnc/ 

If all works as expected, you will be able to see the desktop of your Raspberry Pi and control it from your PC. 


Sunday, March 19, 2017

Arduino: Part III: First Project Basics

Using the Arduino IDE -- a quick skinny overview:
  1. I have an Arduino Uno, have attached it to my PC via USB port, and opened that IDE:


  2. In the IDE, I navigate to Tools --> Boards --> Select the version of the Arduino being used:


  3. The Arduino IDE comes with some very basic code examples (aka, sketches.):

  4. The bare minimum of a code example will contain a method for "setup()" and an action method for "loop()"

  5. A very basic sketch to test your board is the "Blink" example.  Open this example.


  6. In the top left corner of the application, click the checkmark icon to compile the code and if there are no errors you will see similar to the following:   




  7. Now you can upload the code to the Arduino by "Arrow" icon.  This is a common problem I run into where my Arduino is not registering on the proper port:

  8. avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.
    avrdude done.  Thank you.
    Problem uploading to board. 




  9. If you click on the "Magnifying glass" icon or navigate to Tools -->  Serial Monitor --> click to open an interface that shows communications to the Arduino.  In my scenario, the IDE is looking to "COM3" to find my Arduino.  If I open Windows Device Manager, I can see that it is registering on port "COM4":



  10. To remedy this, I navigate back to the IDE, click Tools --> Ports --> and select "COM4" as my port.

  11. If you don't have the above, or any other error, when you upload your code, you should see the following result and will notice that the Arduino now has the blinking light that you programmed.
avrdude: verifying ...
avrdude: 928 bytes of flash verified
avrdude done.  Thank you.

Arduino: Part II: Tools

Code is usually involved in creating your Arduino project.  You are going to need a piece of software that will take your code, compile it, and then upload it to your Arduino.   This type of software is known as an "Integrated Development Environment (IDE).   Here are some free options:

  1. Arduino IDE:   This is the most simple IDE and I recommend for absolute new starters.  Because the Arduino has more capability to support analog functionality, the most basic code will have one format only -- 1)  a setup code block  and 2) a loop code block.  Not allot of room for error here.
  2. Atmel Studio:  I have not tried this software but it looks like it has potential.  I intend to try it at some point.
  3. Visual Studio Community Edition:  This is the reason I haven't tried Atmel Studio.  I've been using Visual Studio most of my life and, despite my moaning, I love it.  Especially since it has gone open-source, it's not limited just to core Microsoft languages.
  4. Visual Studio Code:  This is a nice light-weight edition from Microsoft.  It's very simplistic, has functionality for many languages.  The only reason I don't use it much is because I'm usually on more complex projects and haven't had time for a learning curve.  Since it seems more lightweight, I predict I'll be using it more in the future.
ARDUINO GOTCHA:
  • Arduino will frequently come out with new IDE builds.   If you go to their website, you will see that you can even get the latest hourly builds.  Don't do this.  Whatever lesson you are following or project you have going is not going to contain builds from the last hour and might break your code.  Stick to the latest solid build that most people are using and keep it that way for a while.

Arduino: Part I: Introducing the Arduino


If you're completely new, a starter kit is a good way to go.  They might seem expensive but actually can cost less than buying all the parts individually.  As a bonus, assure that either the starter kit includes some introductory lessons for you to walk through or that you have located some online.

Amazon usually has good deals on these kits.  Examples:


Otherwise, parts of a good kit might include:  an Arduino board, a breadboard, jumper wires, some LED lights, resistors, capacitors, diodes, random sensors, a servos to start.

Your PC (can be Windows, Mac, Linux) with a USB port. Software to run code.  Code?!  Don't worry, you don't have to be a programmer here.  Let's review a process:

  1. Pull a plan together.  (even if it's just going to instructables.com and turning on some LED lights)
  2. Gather your equipment.
  3. Turn on a computer that has a USB port.
  4. Get some software to interact with your Arduino.  Easiest is here. 
  5. Attach all wires and components per lesson diagram.
  6. Copy paste code from lesson into your software.
  7. Build the code and then push it to the Arduino and watch the results.

HEADS-UP!:

  1. GOTCHA #1:  The lessons.  Sometimes the lessons will have a big in the code or show a wire hooked up to the breadboard in a way that doesn't work for you.   Google your project and error.  Someone has probably already been there and fixed that.
  2. GOTCHA #2:  Your wiring.  If there are no errors but something doesn't work, check how you've set up your components.
  3. GOTCHA #3:  Uploading your code.  It's probably going to happen:  some type of COM port error that will be called out by a process named "avrdude."    I'll try to remember to write  a post for that.
  4. GOTCHA #4:  Powering your project.  If you have too much power going to your Arduino, you can fry it.  To start, try to power your project via your USB port.  Most projects are 3.5V or 5V and batteries can work as well.  But, avoid wall power for a while.  


Friday, March 17, 2017

Raspberry Pi: Super Kit 2

This is a great kit for your Raspberry Pi!

It includes breadboard, sensors, and lessons to get you going!

  Sundfounder Super Kit V2.0 

Technical Details:
Great improvements have been made for the SunFounder Superkit V2.0 for Raspberry Pi based on the previous version. Besides clearer Fritzing breadboard images and schematic diagrams in the manual which is much bigger than ever, code in each experiment is provided in both C and Python for users with different habits. Additionally, inside the case of the Superkit it is divided into 8 grids so you may store the components by category after the experiment is finished.
15 Projects for beginners: 
Lesson 1 Blinking LED 
Lesson 2 Controlling an LED by a Button 
Lesson 3 Flowing LED Lights 
Lesson 4 Breathing LED 
Lesson 5 RGB LED 
Lesson 6 Buzzer 
Lesson 7 How to Drive a DC Motor 
Lesson 8 Rotary Encoder 
Lesson 9 555 Timer 
Lesson 10 Driving LEDs by 74HC595 
Lesson 11 Driving 7-Segment Display by 74HC595 
Lesson 12 Driving Dot-Matrix by 74HC595 
Lesson 13 LCD1602 
Lesson 14 ADXL345 
Advanced application of Raspberry Pi – Controlling an LED Based on Web

Raspberry Pi: Quick Setup

Raspberry Pi 3 Setup
(Targeted for MCM Starter Kit)
  1. There is a setup card in the box.  On one side, setup instructions are fairly clear.  On the other side, there is a link to download PDF instruction manual.  It might be a good idea to download the PDF on your regular PC so that you can refer to it during setup.  Mainly, chapters 1-5
  2. The SD card that comes with the MCM kit is pre-formatted with the operating system (OS). Place this pre-formatted SD micro card into RPi.  This must be in the RPi to boot it up.  
  3. Once everything is up and running, you should have a toolbar at the top of the screen.  On the toolbar, navigate to the Raspberry icon and go into "Preferences" to set time, country, etc.
  4. Next, you will want to get the latest updates:
    1. Click to open up the terminal window and then type the following to update the OS:
      1. sudo apt-get update
      2. sudo apt-get upgrade
    2. Reboot system by going into pi icon --> "Reboot"
  5. The most important part now is to explore and play!


NOTE:  The SD card can be kept in your RPi.  It is safe to update the Rasbian OS frequently as it tends to be stable.  You can also create other SD card variants for different operating systems, special projects, etc.

Installation Help:
https://www.raspberrypi.org/documentation/installation/

http://www.mcmelectronics.com/content/en-US/raspberry-pi-user-guide