Port Scratch to pcDuino with hardware support. Scratch is a visual programming environment that allows kids to make games and share online. This document explains how to provide Scratch running on pcDuino access to Arduino compatible hardware interfaces. It involves packaging pcDuino's Arduino-style API into a Scratch plugin. This adds a new "Hardware" block to Scratch and implements functions for GPIO, PWM, and ADC using the pcDuino hardware API. It also shows implementing the HardwarePlugin in C/C++ to call the low-level hardware functions from Scratch blocks.
pcDuino tech talk at Carnegie Mellon University 10/14/2014Jingfeng Liu
The document discusses pcDuino, an open-source single board computer that costs $39 and can be used for hardware experiments, programming, and connecting physical computing projects to the internet. It provides an overview of the different models of pcDuino, describes how to program it using languages like Arduino, Python, Go, and OpenCV, and showcases various projects that have been built with pcDuino like home automation, 3D printing, and robotics.
The document discusses pcDuino, an open source hardware and software platform. It can be programmed under Ubuntu Linux using C, Python, Java, and other languages. It also runs Android and supports Arduino-style programming under Android. The pcDuino combines the processing power of a mini PC with Arduino compatibility. It has multiple models that support functions like WiFi, Ethernet, HDMI output, and working with shields. Programming examples and guides are provided for C, Python, OpenCV, Cloud 9 IDE, QT, Scratch, Go and home automation using TCP/IP.
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.
The document describes pcDuino, a $39 single board computer compatible with the Arduino ecosystem. It has 1GB RAM, 4GB flash storage, Gigabit Ethernet, and runs Linux and Android. The document outlines different pcDuino models and their specifications. It provides examples of programming pcDuino using languages like Scratch, C, Python, Go, and through IDEs like Arduino and Cloud 9. Accessories like shields can expand its functionality for hardware experiments.
In this presentation, we highlight the details on doing IoT home automation with openHAB on pcDuino3B, and use Bluetooth BLE 4.0 technology to talk to sensors
This document discusses the maker movement and various tools and platforms that enable making. It introduces platforms like Arduino, Raspberry Pi, and pcDuino which allow users to create interactive electronic projects more easily. It describes how these platforms can be used for physical computing projects, education, and bringing manufacturing jobs back locally. Various shields and extensions are shown that add functionality to the boards. The document also discusses hackerspaces, crowd funding platforms like Kickstarter, and how open source projects like RepRap 3D printers are part of this movement.
pcDuino tech talk at Carnegie Mellon University 10/14/2014Jingfeng Liu
The document discusses pcDuino, an open-source single board computer that costs $39 and can be used for hardware experiments, programming, and connecting physical computing projects to the internet. It provides an overview of the different models of pcDuino, describes how to program it using languages like Arduino, Python, Go, and OpenCV, and showcases various projects that have been built with pcDuino like home automation, 3D printing, and robotics.
The document discusses pcDuino, an open source hardware and software platform. It can be programmed under Ubuntu Linux using C, Python, Java, and other languages. It also runs Android and supports Arduino-style programming under Android. The pcDuino combines the processing power of a mini PC with Arduino compatibility. It has multiple models that support functions like WiFi, Ethernet, HDMI output, and working with shields. Programming examples and guides are provided for C, Python, OpenCV, Cloud 9 IDE, QT, Scratch, Go and home automation using TCP/IP.
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.
The document describes pcDuino, a $39 single board computer compatible with the Arduino ecosystem. It has 1GB RAM, 4GB flash storage, Gigabit Ethernet, and runs Linux and Android. The document outlines different pcDuino models and their specifications. It provides examples of programming pcDuino using languages like Scratch, C, Python, Go, and through IDEs like Arduino and Cloud 9. Accessories like shields can expand its functionality for hardware experiments.
In this presentation, we highlight the details on doing IoT home automation with openHAB on pcDuino3B, and use Bluetooth BLE 4.0 technology to talk to sensors
This document discusses the maker movement and various tools and platforms that enable making. It introduces platforms like Arduino, Raspberry Pi, and pcDuino which allow users to create interactive electronic projects more easily. It describes how these platforms can be used for physical computing projects, education, and bringing manufacturing jobs back locally. Various shields and extensions are shown that add functionality to the boards. The document also discusses hackerspaces, crowd funding platforms like Kickstarter, and how open source projects like RepRap 3D printers are part of this movement.
Open Source Home Automation with LinkSprite.IOJingfeng Liu
This document discusses open source home automation using LinkSprite.IO. It describes using a LinkNode D1 WiFi Arduino board along with various Linker sensor and actuator modules. It provides the hardware and software requirements, including using the Arduino IDE, Android SDK, and Java. It explains how to set up WiFi on the LinkNode and send sensor data to LinkSprite.IO via HTTP POST requests. Finally, it briefly mentions the possibility of Zigbee-based home automation using pcDuino.
This document summarizes an ESP8266+Arduino workshop that demonstrates connecting an ESP8266 WiFi module to Arduino and programming it to create WiFi networks and access the internet. The workshop shows how to communicate with the ESP8266 using AT commands over serial, program it using the Arduino IDE, and use it as a web server and client. Code examples are provided to retrieve sensor data using a DHT11 and send it to a cloud database using the ESP8266's WiFi connection.
This document provides information about controlling GPIO pins on the Raspberry Pi. It discusses using GPIO pins to blink an LED, read a button input, and control a DC motor with an L293D motor driver chip. It also covers configuring the serial port and using the RPIO library to add PWM and interrupt functions to GPIO control. Advanced topics include creating an internet-controlled robot with Livebots and examples on the RPIO documentation website.
Interacting with Intel Edison
with Esther Jun Kim
Presented at FITC Toronto 2015
More info at www.fitc.ca
OVERVIEW
This talk will introduce the audience to Intel Edison, Intel’s newest maker platform. It will show how Edison can be transformed into a smart, natural device by teaching it to see and hear while retaining its small form factor.
The talk will also briefly describe how to interface Edison with simple supplementary hardware to create a programmable, voice-controlled system.
OBJECTIVE
Highlight the possibilities of Speech Interaction with Maker Devices.
TARGET AUDIENCE
Developers, designers, programmers.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
What’s Intel Edison.
How Language Models Work.
Simple Circuits.
About LEDs.
Voice Interaction.
Designed keeping in mind the latest technology on a single board. It is really easy to design, experiment with, and test circuitry without soldering. Students can explore a wide variety of electronic concepts simply by placing components on to the breadboard. It is very useful in electronics laboratories for performing IoT experiments. It is also useful to build and test circuits as well as making projects related to IoT integrating with the cloud platform. visit https://researchdesignlab.com/esp32-development-board-trainer-kit.html for more details
This presentation describes my experience with nRF24L01, Arduino, Bus Pirate and various other hardware toys when somebody who does software gets into contact with "real stuff".
This document provides a summary of an ESP8266 workshop covering:
- Introduction to the ESP8266 hardware and software
- Setting up ESP-01 and ESP-12 modules for development
- Flashing firmware using esptool
- Introduction to NodeMCU and Lua
- Using the ESPlorer IDE
- Examples of using buttons, LEDs, WiFi, UDP, and MQTT with the ESP8266
The project uses ultrasonic sensor and ESP8266 to monitor tank water level at any point of time.
The monitoring aspect has 2 objectives:
To check water level at any given point (achieved with the help of cloud connectivity through Thingspeak)
To send an alert message when tank is filled or empty (achieved with the help of Notify My Android app)
1) This document discusses using Arduino to receive and transmit infrared signals. It explains how to receive infrared signals from remote controls using an infrared receiver and the IRRemote library.
2) It also explains how to transmit infrared signals by connecting an infrared LED to an Arduino and using the IRsend object from the IRRemote library.
3) Finally, it provides instructions for building a DIY keypad remote control that can transmit infrared signals by connecting buttons to an Arduino and coding the button presses to send infrared codes.
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...David Fowler
The Austin IoT Hardware Sub-Group meetup focused on hands-on demonstrations and discussions around creating IoT devices for fun or profit. The meetup agenda included introductions, announcements of jobs and demo projects, and a presentation on the ESP8266 WiFi module. The ESP8266 was discussed as an inexpensive WiFi module that can be programmed through an AT command set or using NodeMCU, Arduino, or raw C/C++ code. Challenges discussed included FCC certification for products, WiFi configuration, code and memory limits, and power/noise issues.
This document provides an introduction to developing Internet of Things (IoT) applications using the NodeMCU development board and IoT cloud platforms. It covers basic Arduino programming on NodeMCU, reading sensor values from devices like DHT11, and sending sensor data to the IoT platform Ubidots. Hands-on labs demonstrate building a real-time humidity and temperature monitor and a smart switch controller that retrieve and send data to control an LED. Future topics discussed include IoT communication protocols, machine learning, and applying IoT in various fields.
This document provides instructions for setting up a basic Internet of Things (IoT) project using an Arduino clone that costs less than $10. It discusses selecting an inexpensive Arduino clone, installing the necessary software development environment and libraries, and testing serial communication and ping response between the Arduino and a Linux computer. The document outlines getting started with IoT concepts at low cost using easier microcontroller technology like Arduino. It provides step-by-step guidance for configuring the hardware, software, and network settings to enable pinging an Arduino clone connected via serial communication to a Linux virtual machine on a Mac.
This document provides an introduction to programming the ESP8266 WiFi chip. It outlines ESP8266 basics, including an overview of the ESP-01 and ESP-12 models. It then demonstrates how to connect an ESP8266 to an Arduino and use the Blynk app and library to control an LED over WiFi. Wiring diagrams and code examples are provided to showcase setting up and programming the ESP8266 for basic WiFi functionality and Blynk integration.
This document provides an overview of prototyping with a Raspberry Pi, including common operating systems, programming languages, GPIO pin usage, sensors, motors, I2C, PWM, SPI, and UART communication protocols. It discusses connecting an LED and button to the GPIO pins, as well as code examples for blinking an LED, reading a button press, and communicating via I2C, SPI, and UART. The online community is highlighted as a key benefit of the Raspberry Pi platform.
Lightning talk from the 24 March 2016 FW Dev meetup.
http://www.meetup.com/FW-Dev/
This talk will give a brief overview of the ESP8266, show how easy they are to get started with and discuss interest in holding a Saturday workshop
This document discusses an Arduino introductory project about lighting. It provides instructions on installing the Arduino driver, uploading a basic blinking LED program, and exploring analog input and output by reading the value of a potentiometer and fading an LED. It also introduces Fritzing and 123D Circuits as tools for circuit schematic design.
This document introduces JavaScript robotics and discusses how Node.js can be used both on and off microcontroller boards to build robots. It describes common microcontroller boards like Arduino, Tessel 2, and ESP8266 that robots are often built on. These boards have inputs and outputs that can be used to build sensors and actuators. The document then outlines three techniques for using Node.js in robotics: running Node.js directly on a board like Tessel 2, interfacing with a board like Arduino from a separate Node.js program, and using Node.js as an Internet of Things service to control a device like an ESP8266-powered tiara over MQTT. Resources for further learning are also provided
This document discusses using Arduino with Ruby. It provides an overview of Arduino hardware and software, introduces RAD (Ruby Arduino Development) for writing Ruby code to control Arduino boards, and presents several example projects that combine Arduino and Ruby including Ruby on Bells, Barduino, and a Flying Robot. Code examples are provided for blinking an LED, fading an LED, reading an analog sensor, and using servos from Ruby. Additional sensors and shields discussed include Sharp IR sensors, ultrasonic rangefinders, and WiFi shields.
ez-clang C++ REPL for bare-metal embedded devicesStefan Gränitz
ez-clang is an experimental Clang-based cross-compiler with a remote-JIT backend targeting very low-resource embedded devices. Compilation, linking and memory management all run on the host machine.
Open Source Home Automation with LinkSprite.IOJingfeng Liu
This document discusses open source home automation using LinkSprite.IO. It describes using a LinkNode D1 WiFi Arduino board along with various Linker sensor and actuator modules. It provides the hardware and software requirements, including using the Arduino IDE, Android SDK, and Java. It explains how to set up WiFi on the LinkNode and send sensor data to LinkSprite.IO via HTTP POST requests. Finally, it briefly mentions the possibility of Zigbee-based home automation using pcDuino.
This document summarizes an ESP8266+Arduino workshop that demonstrates connecting an ESP8266 WiFi module to Arduino and programming it to create WiFi networks and access the internet. The workshop shows how to communicate with the ESP8266 using AT commands over serial, program it using the Arduino IDE, and use it as a web server and client. Code examples are provided to retrieve sensor data using a DHT11 and send it to a cloud database using the ESP8266's WiFi connection.
This document provides information about controlling GPIO pins on the Raspberry Pi. It discusses using GPIO pins to blink an LED, read a button input, and control a DC motor with an L293D motor driver chip. It also covers configuring the serial port and using the RPIO library to add PWM and interrupt functions to GPIO control. Advanced topics include creating an internet-controlled robot with Livebots and examples on the RPIO documentation website.
Interacting with Intel Edison
with Esther Jun Kim
Presented at FITC Toronto 2015
More info at www.fitc.ca
OVERVIEW
This talk will introduce the audience to Intel Edison, Intel’s newest maker platform. It will show how Edison can be transformed into a smart, natural device by teaching it to see and hear while retaining its small form factor.
The talk will also briefly describe how to interface Edison with simple supplementary hardware to create a programmable, voice-controlled system.
OBJECTIVE
Highlight the possibilities of Speech Interaction with Maker Devices.
TARGET AUDIENCE
Developers, designers, programmers.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
What’s Intel Edison.
How Language Models Work.
Simple Circuits.
About LEDs.
Voice Interaction.
Designed keeping in mind the latest technology on a single board. It is really easy to design, experiment with, and test circuitry without soldering. Students can explore a wide variety of electronic concepts simply by placing components on to the breadboard. It is very useful in electronics laboratories for performing IoT experiments. It is also useful to build and test circuits as well as making projects related to IoT integrating with the cloud platform. visit https://researchdesignlab.com/esp32-development-board-trainer-kit.html for more details
This presentation describes my experience with nRF24L01, Arduino, Bus Pirate and various other hardware toys when somebody who does software gets into contact with "real stuff".
This document provides a summary of an ESP8266 workshop covering:
- Introduction to the ESP8266 hardware and software
- Setting up ESP-01 and ESP-12 modules for development
- Flashing firmware using esptool
- Introduction to NodeMCU and Lua
- Using the ESPlorer IDE
- Examples of using buttons, LEDs, WiFi, UDP, and MQTT with the ESP8266
The project uses ultrasonic sensor and ESP8266 to monitor tank water level at any point of time.
The monitoring aspect has 2 objectives:
To check water level at any given point (achieved with the help of cloud connectivity through Thingspeak)
To send an alert message when tank is filled or empty (achieved with the help of Notify My Android app)
1) This document discusses using Arduino to receive and transmit infrared signals. It explains how to receive infrared signals from remote controls using an infrared receiver and the IRRemote library.
2) It also explains how to transmit infrared signals by connecting an infrared LED to an Arduino and using the IRsend object from the IRRemote library.
3) Finally, it provides instructions for building a DIY keypad remote control that can transmit infrared signals by connecting buttons to an Arduino and coding the button presses to send infrared codes.
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...David Fowler
The Austin IoT Hardware Sub-Group meetup focused on hands-on demonstrations and discussions around creating IoT devices for fun or profit. The meetup agenda included introductions, announcements of jobs and demo projects, and a presentation on the ESP8266 WiFi module. The ESP8266 was discussed as an inexpensive WiFi module that can be programmed through an AT command set or using NodeMCU, Arduino, or raw C/C++ code. Challenges discussed included FCC certification for products, WiFi configuration, code and memory limits, and power/noise issues.
This document provides an introduction to developing Internet of Things (IoT) applications using the NodeMCU development board and IoT cloud platforms. It covers basic Arduino programming on NodeMCU, reading sensor values from devices like DHT11, and sending sensor data to the IoT platform Ubidots. Hands-on labs demonstrate building a real-time humidity and temperature monitor and a smart switch controller that retrieve and send data to control an LED. Future topics discussed include IoT communication protocols, machine learning, and applying IoT in various fields.
This document provides instructions for setting up a basic Internet of Things (IoT) project using an Arduino clone that costs less than $10. It discusses selecting an inexpensive Arduino clone, installing the necessary software development environment and libraries, and testing serial communication and ping response between the Arduino and a Linux computer. The document outlines getting started with IoT concepts at low cost using easier microcontroller technology like Arduino. It provides step-by-step guidance for configuring the hardware, software, and network settings to enable pinging an Arduino clone connected via serial communication to a Linux virtual machine on a Mac.
This document provides an introduction to programming the ESP8266 WiFi chip. It outlines ESP8266 basics, including an overview of the ESP-01 and ESP-12 models. It then demonstrates how to connect an ESP8266 to an Arduino and use the Blynk app and library to control an LED over WiFi. Wiring diagrams and code examples are provided to showcase setting up and programming the ESP8266 for basic WiFi functionality and Blynk integration.
This document provides an overview of prototyping with a Raspberry Pi, including common operating systems, programming languages, GPIO pin usage, sensors, motors, I2C, PWM, SPI, and UART communication protocols. It discusses connecting an LED and button to the GPIO pins, as well as code examples for blinking an LED, reading a button press, and communicating via I2C, SPI, and UART. The online community is highlighted as a key benefit of the Raspberry Pi platform.
Lightning talk from the 24 March 2016 FW Dev meetup.
http://www.meetup.com/FW-Dev/
This talk will give a brief overview of the ESP8266, show how easy they are to get started with and discuss interest in holding a Saturday workshop
This document discusses an Arduino introductory project about lighting. It provides instructions on installing the Arduino driver, uploading a basic blinking LED program, and exploring analog input and output by reading the value of a potentiometer and fading an LED. It also introduces Fritzing and 123D Circuits as tools for circuit schematic design.
This document introduces JavaScript robotics and discusses how Node.js can be used both on and off microcontroller boards to build robots. It describes common microcontroller boards like Arduino, Tessel 2, and ESP8266 that robots are often built on. These boards have inputs and outputs that can be used to build sensors and actuators. The document then outlines three techniques for using Node.js in robotics: running Node.js directly on a board like Tessel 2, interfacing with a board like Arduino from a separate Node.js program, and using Node.js as an Internet of Things service to control a device like an ESP8266-powered tiara over MQTT. Resources for further learning are also provided
This document discusses using Arduino with Ruby. It provides an overview of Arduino hardware and software, introduces RAD (Ruby Arduino Development) for writing Ruby code to control Arduino boards, and presents several example projects that combine Arduino and Ruby including Ruby on Bells, Barduino, and a Flying Robot. Code examples are provided for blinking an LED, fading an LED, reading an analog sensor, and using servos from Ruby. Additional sensors and shields discussed include Sharp IR sensors, ultrasonic rangefinders, and WiFi shields.
ez-clang C++ REPL for bare-metal embedded devicesStefan Gränitz
ez-clang is an experimental Clang-based cross-compiler with a remote-JIT backend targeting very low-resource embedded devices. Compilation, linking and memory management all run on the host machine.
In an ideal world, you would write Python code and then it would work perfectly. But unfortunately, it doesn't work in this manner. In my talk, I'll cover how to efficiently debug your programs, especially in cloud environments or inside Kubernetes.
This document provides an overview of Arduino programming concepts including:
- Microcontrollers contain a CPU, memory, input/output pins and other peripherals on a single integrated circuit.
- Arduino is an open-source electronics platform with a microcontroller, pins to connect circuits, and software to program it.
- The core Arduino functions include setup(), loop(), pinMode(), digitalWrite(), digitalRead(), analogWrite(), analogRead(), and delay().
- Examples demonstrate blinking LEDs, reading input, using conditions and loops, arrays, LCD displays, and controlling servo motors.
- Arduino programming provides an accessible way to learn embedded systems and interact with circuits.
The document discusses Arduino, an open-source electronics prototyping platform. It describes Arduino Uno, including its processor, memory, input/output pins, and operating voltage. It provides steps for getting started with Arduino, including downloading the IDE, connecting the board, selecting options in the IDE, and uploading a basic blink program. The document also covers some key Arduino concepts like variables, conditional statements, loops, and functions.
Getting Started with iBeacons (Designers of Things 2014)Daniel Luxemburg
iBeacon is a system for device-to-device communication based on Bluetooth Low Energy. Applications running on phones, computers, or other types of device can detect and respond to the presence of nearby iBeacons. This technology opens the doors for new and creative interactions between networked objects like wearables and the surrounding environment. In this session we'll explore the potential of iBeacons by building an iBeacon detection device from scratch and using it to interact with a set of iBeacon nodes from Estimote.
See code examples and demo application on GitHub here: https://github.com/dluxemburg/ibeacon-detector
The document describes an Arduino-based home automation system that can sense various parameters like temperature, distance, light, and detect burglars. It transmits the sensor data to an Arduino board which processes the data and checks it against the program code to control devices like fans accordingly. The system also allows users to set alerts. It then provides details about Arduino programming, including the languages, code structure, and functions used. It gives an example of a circuit and code to light LEDs and explains various Arduino functions like pinMode(), digitalWrite(), analogRead() etc.
The document provides an overview of Arduino programming structures and concepts. It discusses the setup and loop functions, variables and data types, arrays, operators, constants, control structures, and input/output functions like pinMode, digitalRead, analogRead, and analogWrite. It also covers other functions for delay, random numbers, serial communication, and working with sensors like a vibration sensor, accelerometer, ultrasonic sensor, and Bluetooth shield. Example code is provided to read and display sensor values and control an LED.
This document discusses home automation and the r-house gem. It provides an overview of home automation categories like lighting, climate and appliances. It also summarizes the r-house architecture which includes components like the interceptor, devices, and database. Finally, it demonstrates how to initialize and connect the interceptor component and register events using the r-house gem.
Codemotion Rome 2015 - Building a drone from scratch with spare parts is a challenging business. To accomplish this journey, a Linux embedded stability control system is developed entirely from 0.This is a journey starting from the hardware choosing (a home WIFI router), to a stable and real flight. Unconventional implementations are one of the main topic, like using WiFi as communication between drone and pilot, HTML5 and COMET to show telemetry from the router web server, and implementing a entirely new protocol based on 802.11 Beacon Frames to prevent deauthentication attacks.
The document provides an overview of programming for robotics competitions, including what is needed, how to program using C language in the MPLAB environment, and how to associate programming elements with robot components and sensors. Key aspects covered include familiarizing yourself with important files like user_routines.c, programming commands like if/else statements and variables, and how programming maps to elements on the robot controller and operator interface.
The document provides an overview of various Python machine learning libraries and tools, including Orange, MDP, PyMC, PyML, hcluster, NLTK, mlpy, LIBSVM, PyEvolve, FANN, Theano, PyBrain, Shogun, ffnet. For each library, it gives information on the homepage, dependencies, installation/source options, key developers and details. It also discusses machine learning and Python in general terms, noting the large amount of activity but also varying documentation quality and lack of packaging.
Getting Started With Raspberry Pi - UCSD 2013Tom Paulus
The document provides information to help get started with the Raspberry Pi. It recommends downloading the operating system image from the Raspberry Pi website. It then discusses setting up the SD card with the image for both Windows and Mac users. The document proceeds to provide examples of code to blink an LED using the GPIO pins and read analog sensor values using the SPI interface. It demonstrates connecting additional hardware like displays and buttons. The examples show how to smooth sensor readings and control the display. The document emphasizes cleaning up resources to avoid issues.
You have one of those fruity *Pi arm boards and cheep sensor from China? Some buttons and LEDs? Do I really need to learn whole new scripting language and few web technologies to read my temperature, blink a led or toggle a relay? No, because your Linux kernel already has drivers for them and all you need is device tree and cat.
Endless fun with Arduino and EventmachineBodo Tasche
This document provides information about Arduino and how it can be used with the EventMachine library in Ruby. It discusses the Arduino hardware specifications including the microcontroller, memory, and input/output pins. It then covers the Arduino software and examples of basic sketches. The document explains how EventMachine allows Ruby programs to communicate with an Arduino by connecting to its serial port and receiving sensor data or sending commands. Code snippets are provided for setting up serial communication between an EventMachine Ruby app and an Arduino.
This document discusses adding logical replication protocol support to the psycopg2 library to allow Python applications to consume real-time replication streams from PostgreSQL. It provides code examples for connecting to replication slots, consuming change streams and messages, and stopping replication. Docker images are also available to simplify testing logical replication. Physical replication is also supported through a separate connection class. Asynchronous replication connections and keepalive messages are demonstrated as well.
The document describes an attendance system project using a barcode scanner. It includes a bonafide certificate signed by the project guide and a declaration by the authors. It also includes a table of contents and chapters describing the introduction, objectives, circuit diagram, components, approaches and results of the project. The project aims to develop a prototype using an Arduino board and barcode scanner to read student ID cards and display attendance data on an LCD screen. It discusses the hardware and software used and the working of scanning barcodes and displaying the output.
3. Overview
Scratch is a tile-based visual programming
environment and toolkit. It lets kids make
games, animated stories, interactive art,
and share with others on the Net.
In this poster, we explain the work needed
to let Scratch have access to Arudino
compatible hardware interface on pcDuino
when Scratch itself runs on pcDuino.
4. Introduction
Scratch is based on squeak ( a type of smalltalk)
virtual machine.
Scratch provides a mechanism to call host API,
named plugin. Through plugin, Scratch can access
devices, such as camera, sound, on host.
pcDuino already implemented Arduino style API (in
C/C++), so the key is to pacakge pcDuino’s
Arduino-ish API into a form of plugin.
5. UI
Scratch uses block to organize the programming
elements. Currently, there are 8 blocks.
We add a new block ‘hardware’ to hold the new
elements.
6. Hardware functions implemented
A portion of pcDuino hardware interface is implemented:
GPIO 0-23: Set input/output mode, high/low output signal level,
Read Status
PWM5-6: Set the output frequency, duty cycle, turn off PWM
ADC0-5: Read the voltage level
Referring to the UI, the following items are implemented:
set pin (0-23) to (INPUT/OUTPUT) mode
set pin (0-23) to (HIGH/LOW) level
pin (0-23) level is (HIGH/LOW)?
Voltage(mV) of pin (A0-A5)
set pwm (5/6) (781/520/390/260/195) Hz (0-256) step
stop pwm (5/6)
8. Add a new block “Hardware”
Open system browser in squeak, find method
‘blockSpecs’ in class Scratch-Objects ->
ScratchSpriteMorph -> block specs.
9. Add a new block “Hardware”
The symbol after % is the input variable. It needs to be
declared in Scratch-Blocks -> CommandBlockMorph -> private ->
uncoloredArgMorphFor. We find a symbol that is not used, and
add our own:
10. Parameters Enumeration in hardware
block
The format of blockSpec is as following:
(‘block text’#identifier#selector ‘default’
‘values’)
The one after % in ‘block test’ is the input
parameters, we need to implement the following:
%A
#pinModeNames INPUT/OUTPUT
%B
#pinLevelNames HIGH/LOW
%E
#analogPinNames A0-A5
%F
#digitalPinNames
0-23
%G
#pwmPinNames
5/6
%j
#pwmPinFreqs
781/520/390/260/195
%J
#pwmPinLevels
0-256
11. Calling Method in Hardware Block
# selector in blockSpec is the corresponding calling method. We
need to implement the following methods:
pinMode:to:
digitalWrite:to:
digitalRead:is:
analogReadVoltage:
analogSet:freqTo:stepTo:
analogStop:
All the above methods eventually need to be implemented through
hardware plugin which is implemented in C/C++.
We need to define the interface to hardware plugin.
12. Calling Method in Hardware
Block
Open system-Browser, and create HardwarePlugin->Primtives Class, and add the
following methods:
primPinMode: pin to: mode
"This is the call to the pinMode primitive."
<primitive: 'primPinMode' module: 'HardwarePlugin'>
self primitiveFailed
primDigitalRead: pin
"This is the call to the digitalRead primitive."
<primitive: 'primDigitalRead' module: 'HardwarePlugin'>
self primitiveFailed
primDigitalWrite: pin to: level
"This is the call to the digitalWrite primitive."
<primitive: 'primDigitalWrite' module: 'HardwarePlugin'>
self primitiveFailed
13. Calling Method in Hardware
Block
primAnalogReadVoltage: pin
"This is the call to the analogReadVoltage primitive."
<primitive: 'primAnalogReadVoltage' module: 'HardwarePlugin'>
self primitiveFailed
primAnalogSet: pin freqTo: freq stepTo: step
"This is the call to the analogSet primitive."
<primitive: 'primAnalogSet' module: 'HardwarePlugin'>
self primitiveFailed
primAnalogWrite: pin to: level
"This is the call to the analogWrite primitive."
<primitive: 'primAnalogWrite' module: 'HardwarePlugin'>
self primitiveFailed
14. Calling Method in Hardware
Block
Use primPinMode as the example, it will eventually call
function ‘primPinMode’in scratch HardwarePlugin.so to
set the mode of GPIO pin as instructed in <primitive:
'primPinMode' module: 'HardwarePlugin'>
15. Calling Method in Hardware
Block
We define the interface in Scratch-Objects ->
ScratchSpriteMorph -> hardware ops instance:
pinMode: pin to: mode
| p m |
p := pin asNumber.
Transcript show: p.
mode = 'INPUT' ifTrue: [ m := 0 ].
mode = 'OUTPUT' ifTrue: [ m := 1 ].
HardwarePlugin primPinMode: p to: m.
digitalRead: pin is: level
| p ret |
p := pin asNumber.
ret := HardwarePlugin primDigitalRead: p.
level = 'HIGH' ifTrue: [ ^ ret ].
^ ret not.
digitalWrite: pin to: level
| p l |
p := pin asNumber.
Transcript show: p.
level = 'LOW' ifTrue: [ l := 0 ].
level = 'HIGH' ifTrue: [ l := 1 ].
HardwarePlugin primDigitalWrite: p to: l.
16. Calling Method in Hardware
Block
analogReadVoltage: pin
| p |
pin = 'A0' ifTrue: [ p := 0 ].
pin = 'A1' ifTrue: [ p := 1 ].
pin = 'A2' ifTrue: [ p := 2 ].
pin = 'A3' ifTrue: [ p := 3 ].
pin = 'A4' ifTrue: [ p := 4 ].
pin = 'A5' ifTrue: [ p := 5 ].
^ HardwarePlugin primAnalogReadVoltage: p.
analogSet: pin freqTo: freq stepTo: step
| p f s |
p := pin asNumber.
f := freq asNumber.
s := step asNumber.
HardwarePlugin primAnalogSet: p freqTo: f stepTo: s.
analogStop: pin
| p |
p := pin asNumber.
HardwarePlugin primAnalogWrite: p to: 0.
17. Implement HardwarePlugin
We can refer to the code of camera.
The key is to implement setInterpreter
and the functions primXXX used in
Primitives-Plugins->HardwarePlugin>primtives.
The functions pinMode, digitalRead,
digitalWrite, and analogWrite are
already implemented in libarduino of
pcDuino. We can call them directly.
18. Implement HardwarePlugin
DLLEXPORT void primPinMode(void) {
int pin = interpreterProxy->stackIntegerValue(1);
int mode = interpreterProxy->stackIntegerValue(0);
pinMode(pin, mode);
}
DLLEXPORT void primDigitalWrite(void) {
int pin = interpreterProxy->stackIntegerValue(1);
int level = interpreterProxy->stackIntegerValue(0);
digitalWrite(pin, level);
}
DLLEXPORT int primDigitalRead(void) {
int pin = interpreterProxy->stackIntegerValue(0);
int level = digitalRead(pin);
interpreterProxy->pop(1);
interpreterProxy->pushBool(level != 0);
return 0;
}
19. Implement HardwarePlugin
DLLEXPORT int primAnalogReadVoltage(void) {
int pin = interpreterProxy->stackIntegerValue(0);
int level = analogReadVoltage(pin);
interpreterProxy->pop(1);
interpreterProxy->pushInteger(level);
return 0;
}
DLLEXPORT void primAnalogWrite(void) {
int pin = interpreterProxy->stackIntegerValue(1);
int level = interpreterProxy->stackIntegerValue(0);
analogWrite(pin, level);
}
DLLEXPORT void primAnalogSetFreq(void) {
int pin = interpreterProxy->stackIntegerValue(1);
int freq = interpreterProxy->stackIntegerValue(0);
analogSetFreq(pin, freq);
}
DLLEXPORT void primAnalogSet(void) {
int pin = interpreterProxy->stackIntegerValue(2);
int freq = interpreterProxy->stackIntegerValue(1);
int level = interpreterProxy->stackIntegerValue(0);
analogSetFreq(pin, freq);
analogWrite(pin, level);
20. Implement HardwarePlugin
DLLEXPORT int setInterpreter(struct VirtualMachine* anInterpreter)
{
int ok;
interpreterProxy = anInterpreter;
ok = interpreterProxy->majorVersion() == VM_PROXY_MAJOR;
if (ok == 0) {
return 0;
}
ok = interpreterProxy->minorVersion() >= VM_PROXY_MINOR;
return ok;
}
24. C Command line
Setup (one time)
If not already done, set up git. Do this using the command:
ubuntu@ubuntu:~$ sudo apt-get install git
Make sure you’re in your home folder by typing
ubuntu@ubuntu:~$ cd
ubuntu@ubuntu:~$ pwd
/home/Ubuntu
Now download the distribution from github by typing
ubuntu@ubuntu:~$ git clone https://github.com/pcduino/c_enviroment
26. C Command line
Change into the c_enviroment folder:
ubuntu@ubuntu:~$ cd c_enviroment
ubuntu@ubuntu:~/c_enviroment$ ls
Makefile hardware libraries output sample
Now run make to make the libraries and the examples with the following command:
ubuntu@ubuntu:~/c_enviroment$ make
Make[1]: Leaving directory `/home/ubuntu/c_enviroment/sample'
The resulting binary files are found in the output/test folder
ubuntu@ubuntu:~/c_enviroment$ cd output/test
ubuntu@ubuntu:~/c_enviroment/output/test$ ll
total 660
drwxrwxr-x 2 ubuntu ubuntu 4096 Apr 27 06:59 ./
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 27 06:49 ../
-rwxrwxr-x 1 ubuntu ubuntu 13868 Apr 27 06:58 adc_test*
-rwxrwxr-x 1 ubuntu ubuntu 28284 Apr 27 06:58 adxl345_test*
-rwxrwxr-x 1 ubuntu ubuntu 14209 Apr 27 06:58 interrupt_test*
-rwxrwxr-x 1 ubuntu ubuntu 13726 Apr 27 06:58 io_test*
-rwxrwxr-x 1 ubuntu ubuntu 13712 Apr 27 06:59 linker_button_test*
-rwxrwxr-x 1 ubuntu ubuntu 13907 Apr 27 06:59 linker_buzzer_test*
-rwxrwxr-x 1 ubuntu ubuntu 13689 Apr 27 06:59 linker_hall_sensor_test*
-rwxrwxr-x 1 ubuntu ubuntu 13760 Apr 27 06:59 linker_joystick_test*
-rwxrwxr-x 1 ubuntu ubuntu 13769 Apr 27 06:59 linker_led_bar_test*
-rwxrwxr-x 1 ubuntu ubuntu 13690 Apr 27 06:59 linker_led_test*
-rwxrwxr-x 1 ubuntu ubuntu 14290 Apr 27 06:59 linker_light_sensor_test*
……
27. C Command line
To view the contents of a sample sketch, (this
example we’ll look at the contents of
linker_led_test.c) type:
ubuntu@ubuntu:~/c_enviroment/sample$ cat
linker_led_test.c
/*
* LED test program
*/
#include <core.h>
int led_pin = 1;
void setup()
{
if(argc != 2){
goto _help;
}
led_pin = atoi(argv[1]);
if((led_pin < 0) || (led_pin > 13)){
goto _help;
}
pinMode(led_pin, OUTPUT);
return;
_help:
printf("Usage %s LED_PIN_NUM(0-13)n", argv[0]);
exit(-1);
}
void loop()
{
digitalWrite(led_pin, HIGH); // set the
LED on
delay(1000); // wait for a second
digitalWrite(led_pin, LOW); // set the LED
off
delay(1000); // wait for a second
}
28. Creating Your Own Sketch
ubuntu@ubuntu:~/c_enviroment/sample$ nano button_led.c
An empty nano screen should appear.
Copy and paste the following code into it. (Remember to paste in nano at the cursor,
just right click the mouse button).
#include <core.h> // Required first line to run on pcDuino
int ledPin = 8;
int buttonPin = 7;
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
29. Creating Your Own Sketch
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
30. Creating Your Own Sketch
Modify the Makefile and Compile
ubuntu@ubuntu:~/c_enviroment/sample$ nano Makefile
You will see a section that lists all the OBJS something like:
OBJS = io_test adc_test pwm_test spi_test adxl345_test serial_test liquidcrystal_i2c
liquidcrystal_spi interrupt_test tone_test
OBJS += linker_led_test linker_potentiometer_test linker_tilt_test linker_light_sensor_test
linker_button_test
OBJS += linker_touch_sensor_test linker_magnetic_sensor_test linker_temperature_sensor_test
linker_joystick_test
OBJS += linker_rtc_test linker_sound_sensor_test linker_buzzer_test linker_hall_sensor_test
linker_led_bar_test linker_relay_test
OBJS += pn532_readAllMemoryBlocks pn532readMifareMemory pn532readMifareTargetID
pn532writeMifareMemory
31. Creating Your Own Sketch
We’re going to add a line to the end of this with the name of the
scketch we just created:
OBJS += button_led
Save the file and exit nano using <CTRL>X with a y and <enter>.
We now run make by typing:
ubuntu@ubuntu:~/c_enviroment/sample$ make
You should see a whole bunch of text with the end being:
button_led.c -o ../output/test/button_led ../libarduino.a
If all went well, you can go to the output/test folder and find your executable you have created:
ubuntu@ubuntu:~/c_enviroment/sample$ cd ../output/test/
ubuntu@ubuntu:~/c_enviroment/output/test$ ll
total 676
drwxrwxr-x 2 ubuntu ubuntu 4096 Apr 27 07:51 ./
drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 27 06:49 ../
-rwxrwxr-x 1 ubuntu ubuntu 13868 Apr 27 07:51 adc_test*
-rwxrwxr-x 1 ubuntu ubuntu 28284 Apr 27 07:51 adxl345_test*
-rwxrwxr-x 1 ubuntu ubuntu 13668 Apr 27 07:51 button_led*
…..(not showing rest of listing here)
32. Creating Your Own Sketch
Run Your Sketch
To run it, once you have wired up a switch and led to the right pins, type:
ubuntu@ubuntu:~/c_enviroment/output/test$ ./button_led
To stop the program, <Ctrl>C
A Quick Re-Cap
Add #include <core.h> to the top of your sketch.
Create your sketch in the samples folder (if your familiar with linux,
makefiles, and compiling code, you could set up your own)
Add the filename to the Makefile in the samples folder in the OBJS section
without the .c
Run make
Run the executable from the output/test folder.
You can introduce command line arguments into your sketch to make it more
transportable.
41. OpenCV
def process(infile):
image = cv.LoadImage(infile);
if image:
faces = detect_object(image)
im = Image.open(infile)
path = os.path.abspath(infile)
save_path = os.path.splitext(path)[0]+"_face"
try:
os.mkdir(save_path)
except:
pass
if faces:
draw = ImageDraw.Draw(im)
count = 0
for f in faces:
count += 1
draw.rectangle(f, outline=(255, 0, 0))
a = im.crop(f)
file_name =
os.path.join(save_path,str(count)+".jpg")
#
print file_name
a.save(file_name)
drow_save_path =
os.path.join(save_path,"out.jpg")
im.save(drow_save_path, "JPEG", quality=80)
else:
print "Error: cannot detect faces on %s" %
infile
if __name__ == "__main__":
process("./opencv_in.jpg")
42. OpenCV
#!/usr/bin/env python
#coding=utf-8
import os
from PIL import Image, ImageDraw
import cv
def detect_object(image):
grayscale = cv.CreateImage((image.width, image.height), 8, 1)
cv.CvtColor(image, grayscale, cv.CV_BGR2GRAY)
cascade = cv.Load("/usr/share/opencv/haarcascades/haarcascade_frontalface_alt_tree.xml")
rect = cv.HaarDetectObjects(grayscale, cascade, cv.CreateMemStorage(), 1.1, 2,
cv.CV_HAAR_DO_CANNY_PRUNING, (20,20))
result = []
for r in rect:
result.append((r[0][0], r[0][1], r[0][0]+r[0][2], r[0][1]+r[0][3]))
return result
43. Cloud 9 IDE
Cloud9 IDE is an online development environment
for Javascript and Node.js applications as well
as HTML, CSS, PHP, Java, Ruby and 23 other
languages.
You're programming for the web, on the web.
Teams can collaborate on projects and run them
within the browser. When you're finished,
deploy it—and you're done!
48. Home Automation:IP controllable LED
Many users are asking if the hardware part can be
programmed together with the Ubuntu linux?
Sure. This is the beauty of pcDuino. The Arduino compatible hardware is a native part
of the OS.
pcDuino includes Ethernet port, USB Wifi dongle, so there is no
need for Ethernet shield, Ethernet shield , USB host shield, MP3
shields and so on.
Now, we are going to implement a TCP/IP
socket server on pcDuino to listen to the
data coming from client.
When it
turn on
it will
receive
receives character ’O', it will
the LED, and when it receives ‘F”,
turn on the LED. No actions if
something else.
49. Home Automation:IP controllable LED
#include “sys/socket.h”
#include “netinet/in.h”
#include “arpa/inet.h”
#include
“sys/types.h”
void loop()
{
n = read(connfd, sendBuff, strlen(sendBuff) );
int led_pin = 2;
int listenfd = 0, connfd = 0;
int n;
struct sockaddr_in serv_addr;
char sendBuff[1025];
time_t ticks;
if(n>0)
{
if(sendBuff[0]=='O') digitalWrite(led_pin,
HIGH); // set the LED on
if(sendBuff[0]=='F') digitalWrite(led_pin,LOW);
// set the LED off
}
}
void setup()
{
led_pin = 2;
pinMode(led_pin, OUTPUT);
listenfd = socket(AF_INET, SOCK_STREAM, 0);
memset(serv_addr, '0', sizeof(serv_addr));
memset(sendBuff, '0', sizeof(sendBuff));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(5000);
bind(listenfd, (struct sockaddr*) serv_addr, sizeof(serv_addr));
listen(listenfd, 10);
connfd = accept(listenfd, (struct sockaddr*)NULL, NULL);
}