Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gwens committed Nov 3, 2016
0 parents commit 95ccf21
Show file tree
Hide file tree
Showing 450 changed files with 158,447 additions and 0 deletions.
27 changes: 27 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Freeware License, some rights reserved

Copyright (c) 2016 Charles Bell

Permission is hereby granted, free of charge, to anyone obtaining a copy
of this software and associated documentation files (the "Software"),
to work with the Software within the limits of freeware distribution and fair use.
This includes the rights to use, copy, and modify the Software for personal use.
Users are also allowed and encouraged to submit corrections and modifications
to the Software for the benefit of other users.

It is not allowed to reuse, modify, or redistribute the Software for
commercial use in any way, or for a user�s educational materials such as books
or blog articles without prior permission from the copyright holder.

The above copyright notice and this permission notice need to be included
in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#Apress Source Code

This repository accompanies [*Windows 10 for the Internet of Things*](http://www.apress.com/9781484221075) by Charles Bell (Apress, 2016).

![Cover image](9781484221075.jpg)

Download the files as a zip using the green button, or clone the repository to your machine using Git.

##Releases

Release v1.0 corresponds to the code in the published book, without corrections or updates.

##Contributions

See the file Contributing.md for more information on how you can contribute to this repository.
34 changes: 34 additions & 0 deletions Source_Ch03/blink_me.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#
# Windows 10 for the IOT
#
# Raspberry Pi Python GPIO Example
#
# This script blinks an LED placed with the negative lead on pin 6 (GND)
# and the pin 7 connected to a 220 resitor, which is connected to the
# positive lead on the LED.
#
# Created by Dr. Charles Bell
#
import RPi.GPIO as GPIO # Raspberry Pi GPIO library
import sys # System library
import time # Used for timing (sleep)

ledPin = 7 # Set LED positive pin to pin 7 on GPIO
GPIO.setmode(GPIO.BOARD) # Setup the GPIO
GPIO.setup(ledPin, GPIO.OUT) # Set LED pin as output
GPIO.output(ledPin, GPIO.LOW) # Turn off the LED pin

print("Let blinking commence!")

for i in range(1,20):
GPIO.output(ledPin, GPIO.HIGH) # Turn on the LED pin
time.sleep(0.25)
sys.stdout.write(".")
sys.stdout.flush()
GPIO.output(ledPin, GPIO.LOW) # Turn off the LED pin
time.sleep(0.25)

GPIO.cleanup() # Shutdown GPIO

print("\nThanks for blinking!")
43 changes: 43 additions & 0 deletions Source_Ch04/temperature/ConsoleApplication.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// Windows 10 for the IOT
//
// Example C++ console application to demonstrate how to build
// Windows 10 IOT Core applications.
//
// Created by Dr. Charles Bell
//
#include "pch.h"

using namespace std;

int main(int argc, char **argv)
{
double fahrenheit = 0.0;
double celsius = 0.0;
double temperature = -.0;
char scale{ 'c' };

cout << "Welcome to the temperature conversion application.\n";
cout << "Please choose a starting scale (F) or (C): ";
cin >> scale;
if ((scale == 'c') || (scale == 'C')) {
cout << "Converting value from Celsius to Fahrenheit.\n";
cout << "Please enter a temperature: ";
cin >> celsius;
fahrenheit = ((9.0 / 5.0) * celsius) + 32.0;
cout << celsius << " degrees Celsius = " << fahrenheit <<
" degrees Fahrenheit.\n";
}
else if ((scale == 'f') || (scale == 'F')) {
cout << "Converting value from Fahrenheit to Celsius.\n";
cout << "Please enter a temperature: ";
cin >> fahrenheit;
celsius = (5.0 / 9.0) * (fahrenheit - 32.0);
cout << fahrenheit << " degrees Fahrenheit = " << celsius <<
" degrees Celsius.\n";
}
else {
cout << "\nERROR: I'm sorry, I don't understand '" << scale << "'.";
return -1;
}
}
6 changes: 6 additions & 0 deletions Source_Ch04/temperature/pch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// pch.cpp
// Include the standard header and generate the precompiled header.
//

#include "pch.h"
8 changes: 8 additions & 0 deletions Source_Ch04/temperature/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// pch.h
// Header for standard system include files.
//

#pragma once

#include <iostream>
35 changes: 35 additions & 0 deletions Source_Ch04/temperature/temperature.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "temperature", "temperature.vcxproj", "{243E8ED0-58CF-4322-BB7D-D52E70352608}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|ARM.ActiveCfg = Debug|ARM
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|ARM.Build.0 = Debug|ARM
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|ARM.Deploy.0 = Debug|ARM
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|x64.ActiveCfg = Debug|x64
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|x64.Build.0 = Debug|x64
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|x86.ActiveCfg = Debug|Win32
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Debug|x86.Build.0 = Debug|Win32
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Release|ARM.ActiveCfg = Release|ARM
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Release|ARM.Build.0 = Release|ARM
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Release|x64.ActiveCfg = Release|x64
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Release|x64.Build.0 = Release|x64
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Release|x86.ActiveCfg = Release|Win32
{243E8ED0-58CF-4322-BB7D-D52E70352608}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading

0 comments on commit 95ccf21

Please sign in to comment.