SlideShare a Scribd company logo
Getting Started with Embedded Python
(MicroPython and CircuitPython)
@iAyanPahwa/iayanpahwa
About Me
Embedded Software
Engineer at Mentor
Graphics - A Siemens
Business
Part time blogger
Full time maker
Mentor Graphics is world
leader in Electronics Design
Automation(Tools Business).
I work for Automotive
Embedded Software Division,
which deals in providing
custom solutions, OS and
BSP for IVI and ADAS
systems.
Contact: https://iayanpahwa.github.io
People who are really
serious about software
should make their own
hardware
- Alan Kay
Motivation
-
@iAyanPahwa/iayanpahwa
Motivation
@iAyanPahwa/iayanpahwa
What is MicroPython
The MicroPython project is an open source
implementation of Python 3 that includes a small
subset of the Python standard libraries, and is
optimised to run on microcontrollers with constrained
environments like limited ROM, RAM and processing
power. It came about after a successful Kick-starter
campaign by Damien George.
@iAyanPahwa/iayanpahwa
Python 3
IoT
(Devices)
Microcontrollers
In a NutShell
@iAyanPahwa/iayanpahwa
Opportunities
@iAyanPahwa/iayanpahwa
@iAyanPahwa/iayanpahwa
~20MHz System Clock
~32Kb RAM
~16MB ROM
Single Core
Register Level Access
Microcontrollers
@iAyanPahwa/iayanpahwa
MicroPython
- A small stripped down version on Python3 which runs as firmware on microcontrollers,
exposes all the low level modules, acting as an operating system.
- It is packed full of advanced features such as an interactive prompt, arbitrary precision
integers, closures, list comprehension, generators, exception handling and more.
- Yet it is compact enough to fit and run within just 256k of code space and 16k of RAM.
- MicroPython aims to be as compatible with normal Python as possible to allow you to
transfer code with ease from the desktop to a microcontroller or embedded target.
- Python APIs for low level hardware modules- GPIOs, UART, PWM, ADC, i2c, SPI.
- Runs directly on bare-metal or under OS env or as emulator.
@iAyanPahwa/iayanpahwa
Python vs μPython vs Arduino
Refer: https://github.com/micropython/micropython/wiki
@iAyanPahwa/iayanpahwa
Boards Supported
@iAyanPahwa/iayanpahwa
The PyBoard
The ESP8266
160Kb RAM
802.11 b/g/n
4MB Flash
GPIO, ADC, I2c, SPI
@iAyanPahwa/iayanpahwa
Functions & Libraries Supported
@iAyanPahwa/iayanpahwa
Interaction
Serial REPL (115200 BAUD RATE)
WEB REPL, works over LAN
File System mounts on host
Tools to transfer source code(ex: AMPY)
Emulation on linux host
Unicorn web based emulator
@iAyanPahwa/iayanpahwa
Interaction: Serial
Loading uP on ESP8266 board
Install esptool - pip install esptool
Download uP firmware.bin from GitHub release pages for
your board.
Erase flash - esptool.py --port /path/to/ESP8266
erase_flash
Flash uP firmware - esptool.py --port /path/to/ESP8266 --
baud 460800 write_flash --flash_size=detect 0 firmware.bin
Connect Serial console - screen /dev/tty… 115200
@iAyanPahwa/iayanpahwa
Interaction: WebREPL
Setting up WebREPL
> import webrepl_setup
> Enter ‘E’ to enable it
> Enter and confirm password(defaults
micropythoN)
> Enter ‘y’ to reboot and save changes
@iAyanPahwa/iayanpahwa
Interaction: WebREPL
@iAyanPahwa/iayanpahwa
Interaction: Unicorn
https://micropython.org/unicorn
@iAyanPahwa/iayanpahwa
Interaction: Live
https://micropython.org/live
@iAyanPahwa/iayanpahwa
Interaction: Emulator
@iAyanPahwa/iayanpahwa
(DEMO)
HELLO WORLD OF ELECTRONICS
@iAyanPahwa/iayanpahwa
Interaction: Hello WORlD
// Classic way of Blinking LED
#include “Board_Defination_File.h”
int main(void)
{
while(1){
DDRB |= (1 << 7);
PORTB |= (1 << 7);
_delay_ms(1000);
PORTB &= ~(1 << 7);
_delay_ms(1000);
}
}
// Make Pin Output
// Send logic 1 to the pin
//Send logic 0 to the pin
@iAyanPahwa/iayanpahwa
Interaction: h3llO WORlD
> from machine import Pin
> from time import sleep
# Make Pin behave as output
> led = Pin(2, Pin.OUT)
> while True:
# Send digital logic 1 to the pin
> led.on()
> sleep(1)
# Send digital logic 0 to the pin
> led.off()
> sleep(1)
MicroPython Way
@iAyanPahwa/iayanpahwa
Interaction: Advance
File System on Flash to store:
WiFi credentials (SSID, PASSOWRD)
boot.py - POST operations
main.py - main executable
You can mount the fs over network, or
transfer files over webREPL or tools like
AMPY.
@iAyanPahwa/iayanpahwa
CircuitPython
https://github.com/adafruit/circuitpython
Adafruit fork of MicroPython maintained for
educational purpose around boards sell by
Adafruit industries.
Centred Around ATMEL SAMD21 and ESP8266 SoCs.
Various new modules added like capacitive touch
APIs, Sound outputs, USB HID etc.
Bluetooth Low energy support with newly
supported NRF SoC port.
DISCLAIMER: The stunts will be performed by experts
under expert supervision and no matter how many times
you test before, chances of live demo failures are
incalculable :P
SHOW TIME
@iAyanPahwa/iayanpahwa
DEMOS
@iAyanPahwa/iayanpahwa
Temperature and Humidity Measurement
> import dht, machine
> from time import sleep
# Make Pin behave as output
> d = dht.DHT11(machine.Pin(4))
> while True:
# Measure temp and humidity
> d.measure()
# Print Values
> d.temperature()
> d.humidity()
> sleep(2)
@iAyanPahwa/iayanpahwa
NeoPixel
* 1 wire to control multiple LEDs, color and
brightness.
* 8-bit format for Red, Green, Blue
* RRGGBB
* 0-ff or 0-255
NeoPixel
> import machine, neopixel
# Initialize GPIO and number of pixels
> np = neopixel.NeoPixel(machine.Pin(4), 8)
# Set a Pixel color in RGB format
> np[0] = (255, 0, 0)
>np.write()
@iAyanPahwa/iayanpahwa
Thank You
@iAyanPahwa
/iayanpahwa

More Related Content

What's hot

Smart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PISmart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PI
Krishna Kumar
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sample
Mirco Vanini
 
Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015
mycal1
 
Raspberry Pi and Amateur Radio
Raspberry Pi and Amateur RadioRaspberry Pi and Amateur Radio
Raspberry Pi and Amateur Radio
Kevin Hooke
 
Esp8266 Workshop
Esp8266 WorkshopEsp8266 Workshop
Esp8266 Workshop
Stijn van Drunen
 
Video Surveillance Using Raspberry Pi Architecture
Video Surveillance Using Raspberry Pi ArchitectureVideo Surveillance Using Raspberry Pi Architecture
Video Surveillance Using Raspberry Pi Architecture
RUTURAJ SHETE
 
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
David Fowler
 
Espressif Introduction
Espressif IntroductionEspressif Introduction
Espressif Introduction
Amazon Web Services
 
ESP8266 and IOT
ESP8266 and IOTESP8266 and IOT
ESP8266 and IOT
dega1999
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending MachineJava Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Jeff Prestes
 
NodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseNodeMCU with Blynk and Firebase
NodeMCU with Blynk and Firebase
Eueung Mulyana
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
HusainBhaldar21
 
lwM2M OTA for ESP8266
lwM2M OTA for ESP8266lwM2M OTA for ESP8266
lwM2M OTA for ESP8266
Manolis Nikiforakis
 
Costruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minutiCostruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minuti
Codemotion
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-Prototyping
Lars Gregori
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266
Baoshi Zhu
 
Cassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshopCassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshop
tomtobback
 
Esp8266 - Intro for dummies
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummies
Pavlos Isaris
 
Adafruit Huzzah Esp8266 WiFi Board
Adafruit Huzzah Esp8266 WiFi BoardAdafruit Huzzah Esp8266 WiFi Board
Adafruit Huzzah Esp8266 WiFi Board
Biagio Botticelli
 
WiFi SoC ESP8266
WiFi SoC ESP8266WiFi SoC ESP8266
WiFi SoC ESP8266
Devesh Samaiya
 

What's hot (20)

Smart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PISmart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PI
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sample
 
Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015Esp8266 hack sonoma county 4/8/2015
Esp8266 hack sonoma county 4/8/2015
 
Raspberry Pi and Amateur Radio
Raspberry Pi and Amateur RadioRaspberry Pi and Amateur Radio
Raspberry Pi and Amateur Radio
 
Esp8266 Workshop
Esp8266 WorkshopEsp8266 Workshop
Esp8266 Workshop
 
Video Surveillance Using Raspberry Pi Architecture
Video Surveillance Using Raspberry Pi ArchitectureVideo Surveillance Using Raspberry Pi Architecture
Video Surveillance Using Raspberry Pi Architecture
 
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
IoT simple with the ESP8266 - presented at the July 2015 Austin IoT Hardware ...
 
Espressif Introduction
Espressif IntroductionEspressif Introduction
Espressif Introduction
 
ESP8266 and IOT
ESP8266 and IOTESP8266 and IOT
ESP8266 and IOT
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending MachineJava Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
 
NodeMCU with Blynk and Firebase
NodeMCU with Blynk and FirebaseNodeMCU with Blynk and Firebase
NodeMCU with Blynk and Firebase
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
lwM2M OTA for ESP8266
lwM2M OTA for ESP8266lwM2M OTA for ESP8266
lwM2M OTA for ESP8266
 
Costruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minutiCostruiamo un Rover in 60 minuti
Costruiamo un Rover in 60 minuti
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-Prototyping
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266
 
Cassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshopCassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshop
 
Esp8266 - Intro for dummies
Esp8266 - Intro for dummiesEsp8266 - Intro for dummies
Esp8266 - Intro for dummies
 
Adafruit Huzzah Esp8266 WiFi Board
Adafruit Huzzah Esp8266 WiFi BoardAdafruit Huzzah Esp8266 WiFi Board
Adafruit Huzzah Esp8266 WiFi Board
 
WiFi SoC ESP8266
WiFi SoC ESP8266WiFi SoC ESP8266
WiFi SoC ESP8266
 

Viewers also liked

Raspberry home server
Raspberry home serverRaspberry home server
Raspberry home server
Massimiliano Perrone
 
HPC DAY 2017 | Prometheus - energy efficient supercomputing
HPC DAY 2017 | Prometheus - energy efficient supercomputingHPC DAY 2017 | Prometheus - energy efficient supercomputing
HPC DAY 2017 | Prometheus - energy efficient supercomputing
HPC DAY
 
LinuxKit and OpenOverlay
LinuxKit and OpenOverlayLinuxKit and OpenOverlay
LinuxKit and OpenOverlay
Moby Project
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?
Dmitry Alexandrov
 
HPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big DataHPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY
 
HPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. Availability
HPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. AvailabilityHPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. Availability
HPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. Availability
HPC DAY
 
HPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPC
HPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPCHPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPC
HPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPC
HPC DAY
 
Database Security Threats - MariaDB Security Best Practices
Database Security Threats - MariaDB Security Best PracticesDatabase Security Threats - MariaDB Security Best Practices
Database Security Threats - MariaDB Security Best Practices
MariaDB plc
 
HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...
HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...
HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...
HPC DAY
 
Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...
Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...
Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...
Benoit Combemale
 
Libnetwork updates
Libnetwork updatesLibnetwork updates
Libnetwork updates
Moby Project
 
HPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC Computing
HPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC ComputingHPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC Computing
HPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC Computing
HPC DAY
 
Latency tracing in distributed Java applications
Latency tracing in distributed Java applicationsLatency tracing in distributed Java applications
Latency tracing in distributed Java applications
Constantine Slisenka
 
GPU databases - How to use them and what the future holds
GPU databases - How to use them and what the future holdsGPU databases - How to use them and what the future holds
GPU databases - How to use them and what the future holds
Arnon Shimoni
 
Design patterns in Java - Monitis 2017
Design patterns in Java - Monitis 2017Design patterns in Java - Monitis 2017
Design patterns in Java - Monitis 2017
Arsen Gasparyan
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
Drive into calico architecture
Drive into calico architectureDrive into calico architecture
Drive into calico architecture
Anirban Sen Chowdhary
 
Vertx
VertxVertx
세션1. block chain as a platform
세션1. block chain as a platform세션1. block chain as a platform
세션1. block chain as a platform
Jay JH Park
 
Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...
Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...
Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...
ScyllaDB
 

Viewers also liked (20)

Raspberry home server
Raspberry home serverRaspberry home server
Raspberry home server
 
HPC DAY 2017 | Prometheus - energy efficient supercomputing
HPC DAY 2017 | Prometheus - energy efficient supercomputingHPC DAY 2017 | Prometheus - energy efficient supercomputing
HPC DAY 2017 | Prometheus - energy efficient supercomputing
 
LinuxKit and OpenOverlay
LinuxKit and OpenOverlayLinuxKit and OpenOverlay
LinuxKit and OpenOverlay
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?
 
HPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big DataHPC DAY 2017 | HPE Storage and Data Management for Big Data
HPC DAY 2017 | HPE Storage and Data Management for Big Data
 
HPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. Availability
HPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. AvailabilityHPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. Availability
HPC DAY 2017 | NVIDIA Volta Architecture. Performance. Efficiency. Availability
 
HPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPC
HPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPCHPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPC
HPC DAY 2017 | HPE Strategy And Portfolio for AI, BigData and HPC
 
Database Security Threats - MariaDB Security Best Practices
Database Security Threats - MariaDB Security Best PracticesDatabase Security Threats - MariaDB Security Best Practices
Database Security Threats - MariaDB Security Best Practices
 
HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...
HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...
HPC DAY 2017 | Accelerating tomorrow's HPC and AI workflows with Intel Archit...
 
Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...
Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...
Model Simulation, Graphical Animation, and Omniscient Debugging with EcoreToo...
 
Libnetwork updates
Libnetwork updatesLibnetwork updates
Libnetwork updates
 
HPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC Computing
HPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC ComputingHPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC Computing
HPC DAY 2017 | Altair's PBS Pro: Your Gateway to HPC Computing
 
Latency tracing in distributed Java applications
Latency tracing in distributed Java applicationsLatency tracing in distributed Java applications
Latency tracing in distributed Java applications
 
GPU databases - How to use them and what the future holds
GPU databases - How to use them and what the future holdsGPU databases - How to use them and what the future holds
GPU databases - How to use them and what the future holds
 
Design patterns in Java - Monitis 2017
Design patterns in Java - Monitis 2017Design patterns in Java - Monitis 2017
Design patterns in Java - Monitis 2017
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Drive into calico architecture
Drive into calico architectureDrive into calico architecture
Drive into calico architecture
 
Vertx
VertxVertx
Vertx
 
세션1. block chain as a platform
세션1. block chain as a platform세션1. block chain as a platform
세션1. block chain as a platform
 
Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...
Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...
Scylla Summit 2017: Repair, Backup, Restore: Last Thing Before You Go to Prod...
 

Similar to Getting Started with Embedded Python: MicroPython and CircuitPython

IOT with Drupal 8 - Webinar Hyderabad Drupal Community
IOT with Drupal 8 -  Webinar Hyderabad Drupal CommunityIOT with Drupal 8 -  Webinar Hyderabad Drupal Community
IOT with Drupal 8 - Webinar Hyderabad Drupal Community
Prateek Jain
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101
Pance Cavkovski
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryRaspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
Brian Pichman
 
Johnny-Five
Johnny-FiveJohnny-Five
Johnny-Five
Henri Cavalcante
 
SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...
SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...
SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...
South Tyrol Free Software Conference
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software SetupRaspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software Setup
RANAALIMAJEEDRAJPUT
 
PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2
Raghad Foqha
 
PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2
Raghad Foqha
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
Cliff Samuels Jr.
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
Tomomi Imura
 
Capstone_Project.ppt
Capstone_Project.pptCapstone_Project.ppt
Capstone_Project.ppt
Dhruvkumar Panchal
 
Raspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projectsRaspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projects
Ismailkhan77481
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with Python
Lelio Campanile
 
Rapid IoT Prototyping with Tizen on Raspberry Pi
Rapid IoT Prototyping with Tizen on Raspberry PiRapid IoT Prototyping with Tizen on Raspberry Pi
Rapid IoT Prototyping with Tizen on Raspberry Pi
Leon Anavi
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
Rishabh Sharma
 
Building your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry PiBuilding your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry Pi
Jeff Prestes
 
A prototyping hardware for the real Internet of Things
A prototyping hardware for the real Internet of ThingsA prototyping hardware for the real Internet of Things
A prototyping hardware for the real Internet of Things
Antonio Liñán Colina
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
Areski Belaid
 
Home Automation Using RPI
Home Automation Using  RPIHome Automation Using  RPI
Home Automation Using RPI
Ankara JUG
 
Iaetsd the universal brain for all robots
Iaetsd the universal brain for all robotsIaetsd the universal brain for all robots
Iaetsd the universal brain for all robots
Iaetsd Iaetsd
 

Similar to Getting Started with Embedded Python: MicroPython and CircuitPython (20)

IOT with Drupal 8 - Webinar Hyderabad Drupal Community
IOT with Drupal 8 -  Webinar Hyderabad Drupal CommunityIOT with Drupal 8 -  Webinar Hyderabad Drupal Community
IOT with Drupal 8 - Webinar Hyderabad Drupal Community
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryRaspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
 
Johnny-Five
Johnny-FiveJohnny-Five
Johnny-Five
 
SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...
SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...
SFScon 22 - Roberto Innocenti - Start Enjoy Yourself with Open Hardware POWER...
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software SetupRaspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software Setup
 
PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2
 
PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2PI-Phone Using Raspberry Pi-2
PI-Phone Using Raspberry Pi-2
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
 
Capstone_Project.ppt
Capstone_Project.pptCapstone_Project.ppt
Capstone_Project.ppt
 
Raspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projectsRaspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projects
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with Python
 
Rapid IoT Prototyping with Tizen on Raspberry Pi
Rapid IoT Prototyping with Tizen on Raspberry PiRapid IoT Prototyping with Tizen on Raspberry Pi
Rapid IoT Prototyping with Tizen on Raspberry Pi
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
Building your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry PiBuilding your own RC Car with Raspberry Pi
Building your own RC Car with Raspberry Pi
 
A prototyping hardware for the real Internet of Things
A prototyping hardware for the real Internet of ThingsA prototyping hardware for the real Internet of Things
A prototyping hardware for the real Internet of Things
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
 
Home Automation Using RPI
Home Automation Using  RPIHome Automation Using  RPI
Home Automation Using RPI
 
Iaetsd the universal brain for all robots
Iaetsd the universal brain for all robotsIaetsd the universal brain for all robots
Iaetsd the universal brain for all robots
 

More from Ayan Pahwa

Kicad 101
Kicad 101Kicad 101
Kicad 101
Ayan Pahwa
 
IoT with circuitpython | CloudBadge
IoT with circuitpython | CloudBadgeIoT with circuitpython | CloudBadge
IoT with circuitpython | CloudBadge
Ayan Pahwa
 
MQTT on Raspberry Pi - Basics
MQTT on Raspberry Pi - BasicsMQTT on Raspberry Pi - Basics
MQTT on Raspberry Pi - Basics
Ayan Pahwa
 
Basics of Embedded Systems / Hardware - Architectures
Basics of Embedded Systems / Hardware - ArchitecturesBasics of Embedded Systems / Hardware - Architectures
Basics of Embedded Systems / Hardware - Architectures
Ayan Pahwa
 
Using Linux in commercial products + Yocto Project touchdown
Using Linux in commercial products + Yocto Project touchdownUsing Linux in commercial products + Yocto Project touchdown
Using Linux in commercial products + Yocto Project touchdown
Ayan Pahwa
 
Reverse engineering IoT Devices
Reverse engineering IoT DevicesReverse engineering IoT Devices
Reverse engineering IoT Devices
Ayan Pahwa
 

More from Ayan Pahwa (6)

Kicad 101
Kicad 101Kicad 101
Kicad 101
 
IoT with circuitpython | CloudBadge
IoT with circuitpython | CloudBadgeIoT with circuitpython | CloudBadge
IoT with circuitpython | CloudBadge
 
MQTT on Raspberry Pi - Basics
MQTT on Raspberry Pi - BasicsMQTT on Raspberry Pi - Basics
MQTT on Raspberry Pi - Basics
 
Basics of Embedded Systems / Hardware - Architectures
Basics of Embedded Systems / Hardware - ArchitecturesBasics of Embedded Systems / Hardware - Architectures
Basics of Embedded Systems / Hardware - Architectures
 
Using Linux in commercial products + Yocto Project touchdown
Using Linux in commercial products + Yocto Project touchdownUsing Linux in commercial products + Yocto Project touchdown
Using Linux in commercial products + Yocto Project touchdown
 
Reverse engineering IoT Devices
Reverse engineering IoT DevicesReverse engineering IoT Devices
Reverse engineering IoT Devices
 

Recently uploaded

A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 

Recently uploaded (20)

A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 

Getting Started with Embedded Python: MicroPython and CircuitPython

  • 1. Getting Started with Embedded Python (MicroPython and CircuitPython) @iAyanPahwa/iayanpahwa
  • 2. About Me Embedded Software Engineer at Mentor Graphics - A Siemens Business Part time blogger Full time maker Mentor Graphics is world leader in Electronics Design Automation(Tools Business). I work for Automotive Embedded Software Division, which deals in providing custom solutions, OS and BSP for IVI and ADAS systems. Contact: https://iayanpahwa.github.io
  • 3. People who are really serious about software should make their own hardware - Alan Kay Motivation - @iAyanPahwa/iayanpahwa
  • 5. What is MicroPython The MicroPython project is an open source implementation of Python 3 that includes a small subset of the Python standard libraries, and is optimised to run on microcontrollers with constrained environments like limited ROM, RAM and processing power. It came about after a successful Kick-starter campaign by Damien George. @iAyanPahwa/iayanpahwa
  • 6. Python 3 IoT (Devices) Microcontrollers In a NutShell @iAyanPahwa/iayanpahwa
  • 9. ~20MHz System Clock ~32Kb RAM ~16MB ROM Single Core Register Level Access Microcontrollers @iAyanPahwa/iayanpahwa
  • 10. MicroPython - A small stripped down version on Python3 which runs as firmware on microcontrollers, exposes all the low level modules, acting as an operating system. - It is packed full of advanced features such as an interactive prompt, arbitrary precision integers, closures, list comprehension, generators, exception handling and more. - Yet it is compact enough to fit and run within just 256k of code space and 16k of RAM. - MicroPython aims to be as compatible with normal Python as possible to allow you to transfer code with ease from the desktop to a microcontroller or embedded target. - Python APIs for low level hardware modules- GPIOs, UART, PWM, ADC, i2c, SPI. - Runs directly on bare-metal or under OS env or as emulator. @iAyanPahwa/iayanpahwa
  • 11. Python vs μPython vs Arduino Refer: https://github.com/micropython/micropython/wiki @iAyanPahwa/iayanpahwa
  • 14. The ESP8266 160Kb RAM 802.11 b/g/n 4MB Flash GPIO, ADC, I2c, SPI @iAyanPahwa/iayanpahwa
  • 15. Functions & Libraries Supported @iAyanPahwa/iayanpahwa
  • 16. Interaction Serial REPL (115200 BAUD RATE) WEB REPL, works over LAN File System mounts on host Tools to transfer source code(ex: AMPY) Emulation on linux host Unicorn web based emulator @iAyanPahwa/iayanpahwa
  • 17. Interaction: Serial Loading uP on ESP8266 board Install esptool - pip install esptool Download uP firmware.bin from GitHub release pages for your board. Erase flash - esptool.py --port /path/to/ESP8266 erase_flash Flash uP firmware - esptool.py --port /path/to/ESP8266 -- baud 460800 write_flash --flash_size=detect 0 firmware.bin Connect Serial console - screen /dev/tty… 115200 @iAyanPahwa/iayanpahwa
  • 18. Interaction: WebREPL Setting up WebREPL > import webrepl_setup > Enter ‘E’ to enable it > Enter and confirm password(defaults micropythoN) > Enter ‘y’ to reboot and save changes @iAyanPahwa/iayanpahwa
  • 23. (DEMO) HELLO WORLD OF ELECTRONICS @iAyanPahwa/iayanpahwa
  • 24. Interaction: Hello WORlD // Classic way of Blinking LED #include “Board_Defination_File.h” int main(void) { while(1){ DDRB |= (1 << 7); PORTB |= (1 << 7); _delay_ms(1000); PORTB &= ~(1 << 7); _delay_ms(1000); } } // Make Pin Output // Send logic 1 to the pin //Send logic 0 to the pin @iAyanPahwa/iayanpahwa
  • 25. Interaction: h3llO WORlD > from machine import Pin > from time import sleep # Make Pin behave as output > led = Pin(2, Pin.OUT) > while True: # Send digital logic 1 to the pin > led.on() > sleep(1) # Send digital logic 0 to the pin > led.off() > sleep(1) MicroPython Way @iAyanPahwa/iayanpahwa
  • 26. Interaction: Advance File System on Flash to store: WiFi credentials (SSID, PASSOWRD) boot.py - POST operations main.py - main executable You can mount the fs over network, or transfer files over webREPL or tools like AMPY. @iAyanPahwa/iayanpahwa
  • 27. CircuitPython https://github.com/adafruit/circuitpython Adafruit fork of MicroPython maintained for educational purpose around boards sell by Adafruit industries. Centred Around ATMEL SAMD21 and ESP8266 SoCs. Various new modules added like capacitive touch APIs, Sound outputs, USB HID etc. Bluetooth Low energy support with newly supported NRF SoC port.
  • 28. DISCLAIMER: The stunts will be performed by experts under expert supervision and no matter how many times you test before, chances of live demo failures are incalculable :P SHOW TIME @iAyanPahwa/iayanpahwa
  • 30. Temperature and Humidity Measurement > import dht, machine > from time import sleep # Make Pin behave as output > d = dht.DHT11(machine.Pin(4)) > while True: # Measure temp and humidity > d.measure() # Print Values > d.temperature() > d.humidity() > sleep(2) @iAyanPahwa/iayanpahwa
  • 31. NeoPixel * 1 wire to control multiple LEDs, color and brightness. * 8-bit format for Red, Green, Blue * RRGGBB * 0-ff or 0-255
  • 32. NeoPixel > import machine, neopixel # Initialize GPIO and number of pixels > np = neopixel.NeoPixel(machine.Pin(4), 8) # Set a Pixel color in RGB format > np[0] = (255, 0, 0) >np.write() @iAyanPahwa/iayanpahwa