The document discusses using the Particle Photon command line interface (CLI) to program the Photon chip. It describes blinking an LED, reading a light sensor value, and exporting sensor data to IFTTT and a Blynk dashboard. It also covers interfacing the Photon with an Arduino over I2C to control an LED based on button presses in the Blynk app communicated through the Photon.
The Ring programming language version 1.7 book - Part 82 of 196Mahmoud Samir Fayed
This document provides information about distributing Ring applications using the Ring2EXE tool. Ring2EXE can generate executable files for Windows, Linux, macOS, and mobile devices from Ring source code. It works by first compiling the Ring code to a Ring object file, then embedding that object file into a C program along with the Ring runtime library to generate an executable. Options allow controlling library inclusion and target platform. Examples demonstrate building console, GUI, game, and mobile applications using Ring2EXE.
This document discusses various approaches to building high performance Java applications for handling IoT workloads. It begins by noting that vanilla Java can handle 10,000 requests per second per CPU core. It then discusses blocking and non-blocking IO approaches, highlighting several non-blocking frameworks like Netty. The document also summarizes the architecture and performance of the Blynk IoT platform, which uses a non-blocking architecture with batches, no synchronization, and in-memory structures to achieve high throughput. Finally, it outlines different versions of the Blynk platform with increasing scale and resilience.
Android Things - The IoT platform from GoogleEmmanuel Obot
Android Things - The IoT platform from Google, it's easy to learn.
Follow the presentation and learn.
With Android things base project to remotely control appliances and monitor or get alert of an intruder via mobile phone.
The document describes a lab setup containing a Biclops pan-tilt unit with a Microsoft Kinect mounted on top. It provides instructions for installing and configuring the necessary ROS packages and libraries to control the Biclops unit and access the Kinect functionality. This includes creating a Biclops ROS package, services for homing the unit, modeling the unit in URDF, and implementing teleoperation of the unit using keyboard keys. It also provides instructions for installing Kinect drivers and libraries on Linux.
Contiki is an open source operating system for the Internet of Things. Contiki connects tiny low-cost, low-power microcontrollers to the Internet.
the presentation explains how to install the simulator, teach the reader some concepts of contiki OS, goes through API used in platform specific examples, and most importantly explains some example(Blinking example, Light and temperature sensor web demo).
The document describes a tutorial for creating an arcade shooter game simulator called Shoot-A-Pi using the Eclipse Kura IoT application framework on a Raspberry Pi. The tutorial will cover setting up the hardware, creating OSGi bundles to interface with sensors and actuators, implementing the game logic, and deploying the bundles to the Raspberry Pi. Attendees will work through building the game over the course of the tutorial session.
The document provides an introduction and overview of connecting Intel Edison devices to the DeviceHub IoT platform. It discusses:
1) Setting up a DeviceHub account and adding a project and device.
2) Installing necessary libraries on the Intel Edison like libmraa to control GPIO pins and connect to WiFi/MQTT.
3) Examples of sending sensor data from the Edison to DeviceHub including string, analog, and digital values and viewing the data in real-time graphs on the DeviceHub dashboard.
This document provides an overview of OpenFrameworks for Flash developers. It includes:
1. An introduction to OpenFrameworks and how it can be used to create C++ applications with less hassle than traditional methods.
2. A breakdown of the basic structure of an OpenFrameworks application including the main classes and functions.
3. Step-by-step explanations of three example OpenFrameworks projects that create circles, an animation, and particles.
4. Additional resources for learning more about OpenFrameworks, creative coding, and getting involved in the OpenFrameworks community.
The Ring programming language version 1.7 book - Part 82 of 196Mahmoud Samir Fayed
This document provides information about distributing Ring applications using the Ring2EXE tool. Ring2EXE can generate executable files for Windows, Linux, macOS, and mobile devices from Ring source code. It works by first compiling the Ring code to a Ring object file, then embedding that object file into a C program along with the Ring runtime library to generate an executable. Options allow controlling library inclusion and target platform. Examples demonstrate building console, GUI, game, and mobile applications using Ring2EXE.
This document discusses various approaches to building high performance Java applications for handling IoT workloads. It begins by noting that vanilla Java can handle 10,000 requests per second per CPU core. It then discusses blocking and non-blocking IO approaches, highlighting several non-blocking frameworks like Netty. The document also summarizes the architecture and performance of the Blynk IoT platform, which uses a non-blocking architecture with batches, no synchronization, and in-memory structures to achieve high throughput. Finally, it outlines different versions of the Blynk platform with increasing scale and resilience.
Android Things - The IoT platform from GoogleEmmanuel Obot
Android Things - The IoT platform from Google, it's easy to learn.
Follow the presentation and learn.
With Android things base project to remotely control appliances and monitor or get alert of an intruder via mobile phone.
The document describes a lab setup containing a Biclops pan-tilt unit with a Microsoft Kinect mounted on top. It provides instructions for installing and configuring the necessary ROS packages and libraries to control the Biclops unit and access the Kinect functionality. This includes creating a Biclops ROS package, services for homing the unit, modeling the unit in URDF, and implementing teleoperation of the unit using keyboard keys. It also provides instructions for installing Kinect drivers and libraries on Linux.
Contiki is an open source operating system for the Internet of Things. Contiki connects tiny low-cost, low-power microcontrollers to the Internet.
the presentation explains how to install the simulator, teach the reader some concepts of contiki OS, goes through API used in platform specific examples, and most importantly explains some example(Blinking example, Light and temperature sensor web demo).
The document describes a tutorial for creating an arcade shooter game simulator called Shoot-A-Pi using the Eclipse Kura IoT application framework on a Raspberry Pi. The tutorial will cover setting up the hardware, creating OSGi bundles to interface with sensors and actuators, implementing the game logic, and deploying the bundles to the Raspberry Pi. Attendees will work through building the game over the course of the tutorial session.
The document provides an introduction and overview of connecting Intel Edison devices to the DeviceHub IoT platform. It discusses:
1) Setting up a DeviceHub account and adding a project and device.
2) Installing necessary libraries on the Intel Edison like libmraa to control GPIO pins and connect to WiFi/MQTT.
3) Examples of sending sensor data from the Edison to DeviceHub including string, analog, and digital values and viewing the data in real-time graphs on the DeviceHub dashboard.
This document provides an overview of OpenFrameworks for Flash developers. It includes:
1. An introduction to OpenFrameworks and how it can be used to create C++ applications with less hassle than traditional methods.
2. A breakdown of the basic structure of an OpenFrameworks application including the main classes and functions.
3. Step-by-step explanations of three example OpenFrameworks projects that create circles, an animation, and particles.
4. Additional resources for learning more about OpenFrameworks, creative coding, and getting involved in the OpenFrameworks community.
The document provides an overview of developing a GUI application using PyQt. It discusses installing PyQt and using Qt Designer to visually design interfaces. Automatically generated UI code can be extended by adding logic with signals and slots. A basic "Hello World" example is shown to demonstrate creating a window and label. Signal/slot connections allow button clicks to call functions. The document also outlines a project for a control software using PyQt, describing the hardware integration and features like dragging logic blocks, running/stopping projects, and viewing input/output statuses.
First day of slides for @GAFFTA workshop http://www.gaffta.org/2012/07/24/hacking-the-kinect-with-openframeworks/
Part 1 of the live stream : http://www.youtube.com/watch?v=WXfy8Cuje-0&feature=plcp
Part 2 of the live stream :
http://www.youtube.com/watch?v=I80FsOlMPj8&feature=plcp
This document provides an introduction to getting started with Internet of Things (IoT) development using an ESP8266 microcontroller board. It discusses what IoT is, common IoT architecture and tools, and demonstrates controlling an on-board LED from a Blynk mobile app. The demo connects an ESPectro Core board to the Blynk server and mobile app, allowing the LED to be toggled via a virtual button. Overall, the document offers a high-level overview of IoT and a simple first project to build an IoT device with an ESP8266 and Blynk.
This document provides an overview and agenda for pcDuino, an open source hardware and software platform. It describes how pcDuino combines the processing power of a mini PC with Arduino compatibility. Users can program pcDuino using Arduino IDE, Python, Java, Go and other languages. It also supports IDEs like Cloud 9 and programming via Ubuntu, Android, and command line. Example projects are showcased using sensors, shields and programming interfaces.
This document describes the design of a smart home system using Internet of Things devices. The system will use a Particle Photon microcontroller to connect various sensors in the home, like temperature sensors and light sensors, to a cloud server. The server will then interface with a mobile app to allow remote monitoring and control of devices in the home. Sensors will be installed in both the home and an attached greenhouse to monitor and control temperature, humidity, lighting, and other functions through the mobile app over the internet.
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docxfelicidaddinwoodie
15LLP108_Demo4_LedBlinking.pdf
1. Introduction
In Demo3, we have learned how to read sensor values of light, temperature and humidity of a node
and output these values to the console. In this demonstration, we will use the code from Demo3 and
learn how to turn on/off the LEDs and make them blinking regularly on the sensor node XM1000,
meanwhile to count how many times the LED has blinked and output the count to the console.
2. Timer
In order to make the blue LED on the XM1000 sensor node to blink in every half second (i.e. On 0.5S
and Off 0.5S), we also need a timer. Follow the instructions in Demo3 for configure and reset a timer.
We aslo need to create an infinite while() loop so that it runs our functions repeatedly, such as
counting the times the LED has blinked, output the counter’s value and actually turn on or off the
LEDs to make it blinking.
Please follow timer and while() loop structure in Demo3.
3. LED Blinking
To get access to the LED functionalities in Contiki, we need to include the LED header file in the
source code:
#include "leds.h" // file is in directory /home/user/contiki/core/dev
After the process begin, we have to initialise the LEDs on the sensor node by calling the following
function:
leds_init(); // Initialise the LEDs
And finally we can turn on, off, or blink the LEDs by the following functions:
void leds_on(unsigned char leds);
void leds_off(unsigned char leds);
void leds_toggle(unsigned char leds);
void leds_invert(unsigned char leds);
For example, if you want to blink the Blue LED, yon need to call the toggle function as:
void leds_toggle(LEDS_BLUE); // Toggle the blue LED
4. Exercise
Modify the program from Demo3 with periodic timer to make the BLUE led blinking in every half
second, also to count the blinking times and output the counted number to the console.
Can your change the code so that the BLUE LED is lighted for 1 second and off for 0.5 second
periodically?
15LLP108 – Internet of Things and Applications
Lab Session 2: Demo 4 – LED Blinking
Prepared by Xiyu Shi
5. Source code
Here is the source code for reference
#include "contiki.h"
#include "leds.h"
#include <stdio.h> /* for printf() */
static struct etimer timer;
/*____________________________________________________*/
PROCESS(led_blinking_process, "LED Blinking Process");
PROCESS(LED_process, "LED process");
AUTOSTART_PROCESSES(&LED_process);
/*____________________________________________________*/
PROCESS_THREAD(LED_process, ev, data)
{
static int count = 0;
PROCESS_BEGIN();
etimer_set(&timer, CLOCK_CONF_SECOND/2); // 0.5S timer
leds_init(); // intialise the LEDs
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev==PROCESS_EVENT_TIMER); // wait for timer event
count++; // count the blinking times
process_start(&led_blinking_process, NULL); // to blink the BLUE Led
printf("Count: %d\n", count); // output the counte ...
Introduction to IPython & Jupyter NotebooksEueung Mulyana
The document discusses IPython and the Jupyter Notebook. IPython is an interactive shell for Python that provides features like command history, tab completion, object introspection, and support for parallel computing. It has three main components: an enhanced interactive Python shell, a two-process communication model that allows clients to connect to a computation kernel, and architecture for interactive parallel computing. The Jupyter Notebook provides a browser-based notebook interface that allows code, text, plots and other media to be combined. IPython QtConsole provides a graphical interface for IPython with features like inline figures and multiline editing.
This document provides an overview of six programming robotics simulation labs using Webots. Lab 1 introduces how to use Webots and program basic robot controllers. Lab 2 programs a robot to detect colors. Lab 3 adds a camera to a robot to make it aware of product colors. Lab 4 explains how two robots were synchronized in an IPR collaboration. Lab 5 changes where a cube is thrown by a Kuka robot. Lab 6 programs an ABB IRB120 robot to draw a square instead of a circle.
The document describes using an IP core in a Xilinx FPGA design. Specifically, it discusses:
1) Creating an adder/subtractor IP core using the Xilinx CORE Generator.
2) Connecting the IP core as a component in a top-level VHDL file.
3) Synthesizing and programming the design onto a Spartan 3E FPGA board to test the four-bit adder/subtractor functionality.
This document provides instructions for exercises using an IoT Agent to connect devices to the FIWARE platform. It outlines 10 exercises of increasing difficulty:
1. Set up a Python environment and test connectivity to FIWARE services.
2. Discover available device models and create a virtual temperature sensor.
3. Send sensor observations and read them back.
4. Create additional sensor types using different models.
5. Create a new device model.
6. Create an actuator device and send/receive commands.
7. Connect a physical device by creating a model, registering it, and sending data.
8. Additional exercises include building apps on top of context data or visualizing data.
Creating a Smart Alarm System with Raspberry Pi and Google Cloud Pub/SubXinYingLim12
A talk on how to use create an alarm system by setting Raspberry Pi to post a message on Cloud Pub/Sub if alarm is triggered. This is a hands-on workshop where participants build the circuit on the Raspberry Pi and use the free tier of Cloud Pub/Sub to set up the messaging system. This talk was given as part of the Road to DevFest '19 Brunei series, on the 31st October 2019
This document provides instructions for generating patterns on LEDs using an 8051 microcontroller. It describes using ports on the 8051 as output ports to interface with LEDs. A delay subroutine is created using loops to generate delays. The code is tested using Proteus simulation software. The document also provides steps for programming the 8051 chip using a SmartPro programmer and debugging techniques for microcontroller programs. The lab tasks involve blinking LEDs in different patterns with a 100ms delay between patterns.
Artificial Neural Networks on a Tic Tac Toe console applicationEduardo Gulias Davis
The document discusses building a Tic Tac Toe game console application using artificial neural networks and PHP. It covers setting up the Symfony Console component, an overview of ANN concepts like activation functions and learning types, using the FANN library for PHP, and includes code examples of implementing the game.
This document provides a step-by-step tutorial for scripting with Python in PowerFactory. It begins with an introduction to importing a sample project and creating a Python command object to contain Python scripts. Basic examples are shown for accessing PowerFactory functions like working with parameters and objects, executing calculations, and plotting results. More advanced topics are then introduced. The tutorial focuses on PowerFactory-specific scripting methods and assumes basic Python knowledge. Example scripts are provided and discussed to demonstrate executing a load flow calculation, accessing network objects and their parameters, and the anatomy of a Python command object.
IoT with Raspberry pi using node-red
This PPT includes steps for analyzing your sensor data on Thingspeak, twitter, IBM Watson IoT demo Cloud and cayenne cloud by myDevices.
Robotics/.DS_Store
__MACOSX/Robotics/._.DS_Store
Robotics/__pycache__/finch.cpython-34.pyc
__MACOSX/Robotics/__pycache__/._finch.cpython-34.pyc
Robotics/__pycache__/finch.cpython-35.pyc
__MACOSX/Robotics/__pycache__/._finch.cpython-35.pyc
Robotics/__pycache__/finchconnection.cpython-34.pyc
__MACOSX/Robotics/__pycache__/._finchconnection.cpython-34.pyc
Robotics/__pycache__/finchconnection.cpython-35.pyc
__MACOSX/Robotics/__pycache__/._finchconnection.cpython-35.pyc
__MACOSX/Robotics/.___pycache__
Robotics/Finch Python API Description.pdf
Finch Python Package Description
Description of Files
finch.py – Contains the Finch API functions for controlling Finch
finchconnection.py – Contains low level functions for sending and receiving data over USB, used by
finch.py
hidapi32/64.dll, libhidapi.dylib, libhidapi32/64.so, libhidapipi.so – compiled C libraries used by
finchconnection.py to scan for USB devices (specifically, the Finch) and open a connection. dll files are
for Windows, dylib is for OSX, and so is for Linux.
accelerationExampleOne.py, accelerationExampleTwo.py, dance.py, wanderer.py, alarm.py,
lapswimmer.py, musicexample.py, racedriver.py, tapExample.py, testfinchfunctions.py – Example
Python programs, open them for more information on what each one does.
notes.py – helper class used by musicexample.py to simplify playing lots of notes on the Finch buzzer.
Finch API
General
close – closes the connection to the Finch
Usage: call this when your program is exiting to cleanly close the Finch connection. This will shut off the
motors and then send the Finch back to idle mode (color changing)
halt – convenience function to shut off the Finch LED and finch motors
Usage: call whenever you wish the Finch to stop moving and turn off its LED with one function call. Will
not shut off the buzzer.
Outputs
led – controls the Finch beak color
Usage: hex triplet string: finch.led(‘#0000FF’) or 0-255 RGB values: finch.led(0, 0, 255). The first value
indicates the red intensity, second is green, third is blue.
wheels – Controls the power sent to the left and right wheels
Usage: values must range from -1.0 to 1.0 for each wheel, use left=right=0.0 to stop. Examples:
finch.wheels(1.0, 1.0) # full forward
finch.wheels(-1.0, -1.0) # full reverse
finch.wheels(0.7, -0.3) # 70% forward on left wheel, 30% reverse on right wheel
buzzer – outputs sound over the Finch buzzer
Usage: pass two parameters, duration in seconds followed by frequency in Hertz. Frequencies between
20 and 20,000 are audible. Example (plays 440 Hz note for ½ second): finch.buzzer(0.5, 440).
Note that this function does not delay program execution; to delay, use buzzer_with_delay. If two
buzzer functions are called one after the other, only the second will play. For example, the following will
only play a single 880 Hz note:
finch.buzzer(0.5, 220)
finch.buzzer(0.5, 880)
buzzer_with_delay – outputs sound over the ...
This document provides a guide to using Bluetooth networking with ESP32 for IoT devices. It includes 3 chapters: an introduction to Bluetooth networking and the EspBlufi app, APIs for development on ESP32 and EspBlufi, and examples of connecting ESP32 to a phone in station mode and as a softAP. The guide outlines how to set up ESP32 for Bluetooth networking, scan and connect devices with EspBlufi, configure ESP32 as a station or softAP, and view connection status.
The document discusses software architecture patterns and principles. It provides examples of how to apply Model-View-Controller (MVC), client-server, and other patterns to Android and web application development. Key strategies mentioned include refactoring existing code, separating concerns, and using patterns like observer and strategy to reduce coupling between architectural components.
The document provides an overview of developing a GUI application using PyQt. It discusses installing PyQt and using Qt Designer to visually design interfaces. Automatically generated UI code can be extended by adding logic with signals and slots. A basic "Hello World" example is shown to demonstrate creating a window and label. Signal/slot connections allow button clicks to call functions. The document also outlines a project for a control software using PyQt, describing the hardware integration and features like dragging logic blocks, running/stopping projects, and viewing input/output statuses.
First day of slides for @GAFFTA workshop http://www.gaffta.org/2012/07/24/hacking-the-kinect-with-openframeworks/
Part 1 of the live stream : http://www.youtube.com/watch?v=WXfy8Cuje-0&feature=plcp
Part 2 of the live stream :
http://www.youtube.com/watch?v=I80FsOlMPj8&feature=plcp
This document provides an introduction to getting started with Internet of Things (IoT) development using an ESP8266 microcontroller board. It discusses what IoT is, common IoT architecture and tools, and demonstrates controlling an on-board LED from a Blynk mobile app. The demo connects an ESPectro Core board to the Blynk server and mobile app, allowing the LED to be toggled via a virtual button. Overall, the document offers a high-level overview of IoT and a simple first project to build an IoT device with an ESP8266 and Blynk.
This document provides an overview and agenda for pcDuino, an open source hardware and software platform. It describes how pcDuino combines the processing power of a mini PC with Arduino compatibility. Users can program pcDuino using Arduino IDE, Python, Java, Go and other languages. It also supports IDEs like Cloud 9 and programming via Ubuntu, Android, and command line. Example projects are showcased using sensors, shields and programming interfaces.
This document describes the design of a smart home system using Internet of Things devices. The system will use a Particle Photon microcontroller to connect various sensors in the home, like temperature sensors and light sensors, to a cloud server. The server will then interface with a mobile app to allow remote monitoring and control of devices in the home. Sensors will be installed in both the home and an attached greenhouse to monitor and control temperature, humidity, lighting, and other functions through the mobile app over the internet.
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docxfelicidaddinwoodie
15LLP108_Demo4_LedBlinking.pdf
1. Introduction
In Demo3, we have learned how to read sensor values of light, temperature and humidity of a node
and output these values to the console. In this demonstration, we will use the code from Demo3 and
learn how to turn on/off the LEDs and make them blinking regularly on the sensor node XM1000,
meanwhile to count how many times the LED has blinked and output the count to the console.
2. Timer
In order to make the blue LED on the XM1000 sensor node to blink in every half second (i.e. On 0.5S
and Off 0.5S), we also need a timer. Follow the instructions in Demo3 for configure and reset a timer.
We aslo need to create an infinite while() loop so that it runs our functions repeatedly, such as
counting the times the LED has blinked, output the counter’s value and actually turn on or off the
LEDs to make it blinking.
Please follow timer and while() loop structure in Demo3.
3. LED Blinking
To get access to the LED functionalities in Contiki, we need to include the LED header file in the
source code:
#include "leds.h" // file is in directory /home/user/contiki/core/dev
After the process begin, we have to initialise the LEDs on the sensor node by calling the following
function:
leds_init(); // Initialise the LEDs
And finally we can turn on, off, or blink the LEDs by the following functions:
void leds_on(unsigned char leds);
void leds_off(unsigned char leds);
void leds_toggle(unsigned char leds);
void leds_invert(unsigned char leds);
For example, if you want to blink the Blue LED, yon need to call the toggle function as:
void leds_toggle(LEDS_BLUE); // Toggle the blue LED
4. Exercise
Modify the program from Demo3 with periodic timer to make the BLUE led blinking in every half
second, also to count the blinking times and output the counted number to the console.
Can your change the code so that the BLUE LED is lighted for 1 second and off for 0.5 second
periodically?
15LLP108 – Internet of Things and Applications
Lab Session 2: Demo 4 – LED Blinking
Prepared by Xiyu Shi
5. Source code
Here is the source code for reference
#include "contiki.h"
#include "leds.h"
#include <stdio.h> /* for printf() */
static struct etimer timer;
/*____________________________________________________*/
PROCESS(led_blinking_process, "LED Blinking Process");
PROCESS(LED_process, "LED process");
AUTOSTART_PROCESSES(&LED_process);
/*____________________________________________________*/
PROCESS_THREAD(LED_process, ev, data)
{
static int count = 0;
PROCESS_BEGIN();
etimer_set(&timer, CLOCK_CONF_SECOND/2); // 0.5S timer
leds_init(); // intialise the LEDs
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev==PROCESS_EVENT_TIMER); // wait for timer event
count++; // count the blinking times
process_start(&led_blinking_process, NULL); // to blink the BLUE Led
printf("Count: %d\n", count); // output the counte ...
Introduction to IPython & Jupyter NotebooksEueung Mulyana
The document discusses IPython and the Jupyter Notebook. IPython is an interactive shell for Python that provides features like command history, tab completion, object introspection, and support for parallel computing. It has three main components: an enhanced interactive Python shell, a two-process communication model that allows clients to connect to a computation kernel, and architecture for interactive parallel computing. The Jupyter Notebook provides a browser-based notebook interface that allows code, text, plots and other media to be combined. IPython QtConsole provides a graphical interface for IPython with features like inline figures and multiline editing.
This document provides an overview of six programming robotics simulation labs using Webots. Lab 1 introduces how to use Webots and program basic robot controllers. Lab 2 programs a robot to detect colors. Lab 3 adds a camera to a robot to make it aware of product colors. Lab 4 explains how two robots were synchronized in an IPR collaboration. Lab 5 changes where a cube is thrown by a Kuka robot. Lab 6 programs an ABB IRB120 robot to draw a square instead of a circle.
The document describes using an IP core in a Xilinx FPGA design. Specifically, it discusses:
1) Creating an adder/subtractor IP core using the Xilinx CORE Generator.
2) Connecting the IP core as a component in a top-level VHDL file.
3) Synthesizing and programming the design onto a Spartan 3E FPGA board to test the four-bit adder/subtractor functionality.
This document provides instructions for exercises using an IoT Agent to connect devices to the FIWARE platform. It outlines 10 exercises of increasing difficulty:
1. Set up a Python environment and test connectivity to FIWARE services.
2. Discover available device models and create a virtual temperature sensor.
3. Send sensor observations and read them back.
4. Create additional sensor types using different models.
5. Create a new device model.
6. Create an actuator device and send/receive commands.
7. Connect a physical device by creating a model, registering it, and sending data.
8. Additional exercises include building apps on top of context data or visualizing data.
Creating a Smart Alarm System with Raspberry Pi and Google Cloud Pub/SubXinYingLim12
A talk on how to use create an alarm system by setting Raspberry Pi to post a message on Cloud Pub/Sub if alarm is triggered. This is a hands-on workshop where participants build the circuit on the Raspberry Pi and use the free tier of Cloud Pub/Sub to set up the messaging system. This talk was given as part of the Road to DevFest '19 Brunei series, on the 31st October 2019
This document provides instructions for generating patterns on LEDs using an 8051 microcontroller. It describes using ports on the 8051 as output ports to interface with LEDs. A delay subroutine is created using loops to generate delays. The code is tested using Proteus simulation software. The document also provides steps for programming the 8051 chip using a SmartPro programmer and debugging techniques for microcontroller programs. The lab tasks involve blinking LEDs in different patterns with a 100ms delay between patterns.
Artificial Neural Networks on a Tic Tac Toe console applicationEduardo Gulias Davis
The document discusses building a Tic Tac Toe game console application using artificial neural networks and PHP. It covers setting up the Symfony Console component, an overview of ANN concepts like activation functions and learning types, using the FANN library for PHP, and includes code examples of implementing the game.
This document provides a step-by-step tutorial for scripting with Python in PowerFactory. It begins with an introduction to importing a sample project and creating a Python command object to contain Python scripts. Basic examples are shown for accessing PowerFactory functions like working with parameters and objects, executing calculations, and plotting results. More advanced topics are then introduced. The tutorial focuses on PowerFactory-specific scripting methods and assumes basic Python knowledge. Example scripts are provided and discussed to demonstrate executing a load flow calculation, accessing network objects and their parameters, and the anatomy of a Python command object.
IoT with Raspberry pi using node-red
This PPT includes steps for analyzing your sensor data on Thingspeak, twitter, IBM Watson IoT demo Cloud and cayenne cloud by myDevices.
Robotics/.DS_Store
__MACOSX/Robotics/._.DS_Store
Robotics/__pycache__/finch.cpython-34.pyc
__MACOSX/Robotics/__pycache__/._finch.cpython-34.pyc
Robotics/__pycache__/finch.cpython-35.pyc
__MACOSX/Robotics/__pycache__/._finch.cpython-35.pyc
Robotics/__pycache__/finchconnection.cpython-34.pyc
__MACOSX/Robotics/__pycache__/._finchconnection.cpython-34.pyc
Robotics/__pycache__/finchconnection.cpython-35.pyc
__MACOSX/Robotics/__pycache__/._finchconnection.cpython-35.pyc
__MACOSX/Robotics/.___pycache__
Robotics/Finch Python API Description.pdf
Finch Python Package Description
Description of Files
finch.py – Contains the Finch API functions for controlling Finch
finchconnection.py – Contains low level functions for sending and receiving data over USB, used by
finch.py
hidapi32/64.dll, libhidapi.dylib, libhidapi32/64.so, libhidapipi.so – compiled C libraries used by
finchconnection.py to scan for USB devices (specifically, the Finch) and open a connection. dll files are
for Windows, dylib is for OSX, and so is for Linux.
accelerationExampleOne.py, accelerationExampleTwo.py, dance.py, wanderer.py, alarm.py,
lapswimmer.py, musicexample.py, racedriver.py, tapExample.py, testfinchfunctions.py – Example
Python programs, open them for more information on what each one does.
notes.py – helper class used by musicexample.py to simplify playing lots of notes on the Finch buzzer.
Finch API
General
close – closes the connection to the Finch
Usage: call this when your program is exiting to cleanly close the Finch connection. This will shut off the
motors and then send the Finch back to idle mode (color changing)
halt – convenience function to shut off the Finch LED and finch motors
Usage: call whenever you wish the Finch to stop moving and turn off its LED with one function call. Will
not shut off the buzzer.
Outputs
led – controls the Finch beak color
Usage: hex triplet string: finch.led(‘#0000FF’) or 0-255 RGB values: finch.led(0, 0, 255). The first value
indicates the red intensity, second is green, third is blue.
wheels – Controls the power sent to the left and right wheels
Usage: values must range from -1.0 to 1.0 for each wheel, use left=right=0.0 to stop. Examples:
finch.wheels(1.0, 1.0) # full forward
finch.wheels(-1.0, -1.0) # full reverse
finch.wheels(0.7, -0.3) # 70% forward on left wheel, 30% reverse on right wheel
buzzer – outputs sound over the Finch buzzer
Usage: pass two parameters, duration in seconds followed by frequency in Hertz. Frequencies between
20 and 20,000 are audible. Example (plays 440 Hz note for ½ second): finch.buzzer(0.5, 440).
Note that this function does not delay program execution; to delay, use buzzer_with_delay. If two
buzzer functions are called one after the other, only the second will play. For example, the following will
only play a single 880 Hz note:
finch.buzzer(0.5, 220)
finch.buzzer(0.5, 880)
buzzer_with_delay – outputs sound over the ...
This document provides a guide to using Bluetooth networking with ESP32 for IoT devices. It includes 3 chapters: an introduction to Bluetooth networking and the EspBlufi app, APIs for development on ESP32 and EspBlufi, and examples of connecting ESP32 to a phone in station mode and as a softAP. The guide outlines how to set up ESP32 for Bluetooth networking, scan and connect devices with EspBlufi, configure ESP32 as a station or softAP, and view connection status.
The document discusses software architecture patterns and principles. It provides examples of how to apply Model-View-Controller (MVC), client-server, and other patterns to Android and web application development. Key strategies mentioned include refactoring existing code, separating concerns, and using patterns like observer and strategy to reduce coupling between architectural components.
2. Contents
1. Photon Command Line Interface
2. Blink an LED in Photon chip
3. Read a light sensor through CLI
4. Export the results using IFTTT
5. Photon interfacing Blynk App
6. Photon interfacing Arduino
3. 1. Photon Command Line Interface
Particle Photon can be programmed from the web IDE at
https://build.particle.io/signup by entering the login credentials. There is
also an offline IDE that can perform similar functions. But a greater
control over the Photon wifi module is achieved through the Command
Line Interface or CLI. The chip can be setup in to a new wifi, flashed and
can be monitored realtime through CLI. Particle CLI is a powerful tool
for interacting with your devices and the Particle Cloud. The CLI uses
node.js and can easily run on Windows, Mac OS X, and Linux. It's also
open source so you can edit and change it, and even send in your changes
as pull requests if you want to share.
a) Prerequisites
i) Node.js is needed to be installed.
ii) Next, install particle-cli from commandline using the
command npm install -g particle-cli.
iii) Install photon drivers to get the chip detected in the
computer system. https://community.particle.io/t/updated-
windows-driver-for-core-and-photon/12249)
b) CLI Commands
i) particle setup wifi- Helpful shortcut for adding another
wifi network to a device connected over USB. Make sure
your device is connected via a USB cable, and is slow
blinking blue listening mode.
4. ii) particle login- Login and save an access token for
interacting with your account on the Particle Cloud.
iii) particle logout- Logout and optionally revoke the access
token for your CLI session.
iv) particle list- Generates a list of what devices you own,
and displays information about their status, including
what variables and functions are available.
v) particle device add- Adds a new device to your account.
vi) particle device rename- Assigns a new name to a device
you've claimed.
vii) particle device remove- Removes a device from your
account so someone else can claim it.
5. viii) particle compile- Compiles one or more source file, or
a directory of source files, and downloads a firmware
binary.
ix) particle flash- Sends a firmware binary, a source file, or
a directory of source files, or a known app to your device.
x) particle call- Calls a function on one of your devices,
use particle list to see which devices are online, and what
functions are available.
xi) particle get- Retrieves a variable value from one of your
devices, use particle list to see which devices are online,
and what variables are available.
xii) particle monitor- Pulls the value of a variable at a set
interval, and optionally display a timestamp.
6. 2. Blink an LED in Photon chip
Following code was compiled and flashed in to the photon chip
from CLI.
int led1 = D7;
void setup() {
pinMode(led1, OUTPUT);
}
void loop() {
// To blink the LED, first we'll turn it on...
digitalWrite(led1, HIGH);
// We'll leave it on for 1 second...
delay(1000);
7. // Then we'll turn it off...
digitalWrite(led1, LOW);
// Wait 1 second...
delay(1000);
// And repeat!
}
3. Read a light sensor through CLI
Following code was compiled and flashed in to the photon chip
from CLI.
int light = 0;
8. void setup()
{
// variable name max length is 12 characters long
Particle.variable("light", light);
pinMode(A0, INPUT);
}
void loop()
{
// Read the analog value of the sensor (TMP36)
light = analogRead(A0);
//Convert the reading into degree celcius
}
Now in the CLI, use particle monitor
particle monitor- Pulls the value of a variable at a set interval,
and optionally display a timestamp.
9. 4. Export the results using IFTTT
a) First, create a recipe
b) Click ‘this’
c)
16. 5. Photon Interfacing Blynk App
Blynk is a Platform with iOS and Android apps to control Arduino,
Raspberry Pi and the likes over the Internet. It's a digital dashboard
where you can build a graphic interface for your project by simply
dragging and dropping widgets.It's really simple to set everything up and
you'll start tinkering in less than 5 mins.
Blynk library for photon is available in github and all the header
files in the blynk library needs to be sourced while flashing the
following source code in to the photon chip from CLI.
//#define BLYNK_DEBUG // Uncomment this to see debug prints
#define BLYNK_PRINT Serial
#include "blynk/blynk.h"
Used in the code below
17. // You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "e19a5229861e48ef8ae12cafc184e5ac";
// Attach a Button widget (mode: Switch) to the Digital pin 7 - and
control the built-in blue led.
// Attach a Graph widget to Analog pin 1
// Attach a Gauge widget to Analog pin 2
// No coding is required for direct pin operations!
void setup()
{
Serial.begin(9600);
delay(5000); // Allow board to settle
Blynk.begin(auth);
}
// Attach a Button widget (mode: Push) to the Virtual pin 1 - and
send sweet tweets!
BLYNK_WRITE(V1) {
if (param.asInt() == 1) { // On button down...
// Tweeting!
// Note:
18. // We allow 1 tweet per minute for now.
// Twitter doesn't allow identical subsequent messages.
Blynk.tweet("My Particle project is tweeting using
@blynk_app and it’s awesome!n @Particle #IoT #blynk");
// Pushing notification to the app!
// Note:
// We allow 1 notification per minute for now.
Blynk.notify("You pressed the button and I know it ;)");
}
}
// Attach a Slider widget to the Virtual pin 2 - and control the built-
in RGB led!
BLYNK_WRITE(V2) {
if (param.asInt() > 0) {
RGB.control(true);
byte rgb[3];
HsvToRgb(param.asDouble()/255, 1, 1, rgb);
RGB.color(rgb[0], rgb[1], rgb[2]);
} else {
RGB.control(false);
}
20. double r, g, b;
int i = int(h * 6);
double f = h * 6 - i;
double p = v * (1 - s);
double q = v * (1 - f * s);
double t = v * (1 - (1 - f) * s);
switch(i % 6){
case 0: r = v, g = t, b = p; break;
case 1: r = q, g = v, b = p; break;
case 2: r = p, g = v, b = t; break;
case 3: r = p, g = q, b = v; break;
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
rgb[0] = r * 255;
rgb[1] = g * 255;
rgb[2] = b * 255;
}
22. 7. Photon interfacing Arduino
Connection was made as follows and I2C protocol was used to
communicate between Photon and Arduino
Blynk library for photon is available in github and all the header
files in the blynk library needs to be sourced while flashing the
following source code in to the photon chip from CLI.
// This #include statement was automatically added by the Particle
IDE.
#include "blynk/blynk.h"
#define BLYNK_PRINT Serial
#include "blynk/blynk.h"
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
Arduino Pin A5 – Photon Pin D0
Arduino Pin A4 – Photon Pin D1
23. char auth[] = "e19a5229861e48ef8ae12cafc184e5ac";
// Attach a Button widget (mode: Switch) to the Digital pin 7 - and
control the built-in blue led.
// Attach a Graph widget to Analog pin 1
// Attach a Gauge widget to Analog pin 2
// No coding is required for direct pin operations!
bool x = 0;
bool prev_state=HIGH;
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600);
delay(5000); // Allow board to settle
Blynk.begin(auth);
}
// Attach a Button widget (mode: Push) to the Virtual pin 1 - and
send sweet tweets!
BLYNK_WRITE(V1) {
if (param.asInt() == 1) { // On button down...
// Tweeting!
// Note:
// We allow 1 tweet per minute for now.
// Twitter doesn't allow identical subsequent messages.
Blynk.tweet("My Particle project is tweeting using
@blynk_app and it’s awesome!n @Particle #IoT #blynk");
// Pushing notification to the app!
// Note:
// We allow 1 notification per minute for now.
Blynk.notify("You pressed the button and I know it ;)");
}
}
// Attach a Slider widget to the Virtual pin 2 - and control the built-in
RGB led!
BLYNK_WRITE(V2) {
if (param.asInt() > 0) {
25. int i = int(h * 6);
double f = h * 6 - i;
double p = v * (1 - s);
double q = v * (1 - f * s);
double t = v * (1 - (1 - f) * s);
switch(i % 6){
case 0: r = v, g = t, b = p; break;
case 1: r = q, g = v, b = p; break;
case 2: r = p, g = v, b = t; break;
case 3: r = p, g = q, b = v; break;
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
rgb[0] = r * 255;
rgb[1] = g * 255;
rgb[2] = b * 255;
}
void action(bool a) {
Wire.beginTransmission(8); // transmit to device #8
Wire.write(a); // sends one byte
Wire.endTransmission(); // stop transmitting
}
The following code was flashed into the Arduino Uno from the
Arduino IDE.
#include <Wire.h>
void setup() {
pinMode(13, OUTPUT);
Wire.begin(8); // join i2c bus with address #8
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}
void loop() {
// there are no statements in this block
26. }
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany) {
if (Wire.available()) { // loop through all but the last
bool c = Wire.read(); // receive byte as a character
digitalWrite(13, c);
}
}
Led on Arduino was turned on from the blynk app through photon-
arduino communication in I2C protocol.
27. Conclusion
Explored the command line interface programming of Particle Photon
Wifi Chip. Read a light sensor and obtained a graphical representation in
Blynk app. Exported the sensor data to google drive using IFTTT and
obtained a graphical representation. Communicated with an Arduino
Uno board from Blynk app through photon Chip.