SlideShare a Scribd company logo
1 of 17
Coding Dojo
The learning remote control
/* a C++ exercise */
@AlinPandichi
Coding Dojo Mindset
● We are here to learn
● Safe place outside of work
● Need to slow down
● Focus on doing it right
● Non­competitive, collaborative, fun 
environment
Expectations?
Agenda
● 19:00 ­ 19:10 Introduction  
● 19:10 ­ 19:30 Intro
● 19:30 ­ 20:00 Practice Session Part 1 
● 20:00 ­ 20:10 Break  
● 20:10 ­ 20:45 Practice Session Part 2 
● 20:45 ­ 21:00 Retrospective
The learning remote control
● You are writing the firmware for a 
learning remote control.
● You put it into a 'listening' state...
● ...to capture the signal from another IR 
remote control
● Your firmware must find a repeating 
pattern of pulses
Digital signal processing
● https://www.allaboutcircuits.com/uploads/articles/An­
Introduction­to­Digital­Signal­Processing­(1).png
Other requirements
● on_start_learning_mode to simulate the 
user initiating a training operation
● on_signal_change called repeatedly to 
simulate a continually repeating input 
signal
● Return a list of pulses representing the 
detected pattern (or none)
Other requirements
● A pulse is defined as a HIGH/LOW pair 
made out of an integer 2­tuple. 
● Each integer pair is the time in 
nanoseconds the signal was high for and 
then the time in nanoseconds the signal 
was low for. For example:
# high for 52 nanos, low for 4500 nanos
pulse = (52, 4500)
In ASCII art...
| (1) (2) (3)(4)(5) (6) (7)(8) <--
| ..................... .... ..... ... <--- HIGH
| | | | | | | | |
|.....| |...| |..| |.....| | <--- LOW
| <- nanos_elapsed ->
+-------------------------------------------------------------
time_nanos ->
It should look something like this
def on_signal_change(is_high,
nanos_elapse):
# your code
...
# then return a pattern
return [(50, 4500), (3423, 333),
(212,44)]
The following will hold true
● The first invocation of the on_signal_change method 
will be the start of the pattern. Note that nanos_elapsed 
will be 0 for this first call.
● The first invocation of the on_signal_change method 
will always be for a LOW to HIGH transition (rising 
edge, is_high is True).
● The pattern will be made up of at least 1 HIGH/LOW 
pulse.
● The pattern will be made up of less than 26 HIGH/LOW 
pulses.
● The pattern will be made up of ideal pulses (i.e. no 
jitter, fuzzyness, or drift).
Practice session
● One laptop with a functional dev. env. is 
connected to a projector
● Two developers pair program on the 
laptop. The others are watching the code 
changes.
● Every 7 minutes, one developer leaves the 
laptop and the next one from the room 
takes his place. 
Practice time!
Retrospective
● What surprised you?
● What happened as expected?
● What do you plan to use at work?
Kata stolen from:
https://www.codewars.com/kata/
Learn more!
https://cppeurope.com/
Thank you!
@AlinPandichi

More Related Content

Similar to Coding Dojo - The learning remote control

arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.pptZainIslam20
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
TinyML: Machine Learning for Microcontrollers
TinyML: Machine Learning for MicrocontrollersTinyML: Machine Learning for Microcontrollers
TinyML: Machine Learning for MicrocontrollersRobert John
 
Choose your dev platform
Choose your dev platformChoose your dev platform
Choose your dev platformMarian Marinov
 
Arduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesArduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesMithi Sevilla
 
Arduino.pptx
Arduino.pptxArduino.pptx
Arduino.pptxAadilKk
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docxAjay578679
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxethannguyen1618
 
All about ir arduino - cool
All about ir   arduino - coolAll about ir   arduino - cool
All about ir arduino - coolVlada Stoja
 
OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...
OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...
OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...NETWAYS
 
Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)
Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)
Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)AkshetPatel
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanArif Huda
 
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-Alin Pandichi
 
13223971.ppt
13223971.ppt13223971.ppt
13223971.pptSuYee13
 
GDGPH Hack Fair Presentation
GDGPH Hack Fair PresentationGDGPH Hack Fair Presentation
GDGPH Hack Fair PresentationMithi Sevilla
 

Similar to Coding Dojo - The learning remote control (20)

arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Arduino
ArduinoArduino
Arduino
 
TinyML: Machine Learning for Microcontrollers
TinyML: Machine Learning for MicrocontrollersTinyML: Machine Learning for Microcontrollers
TinyML: Machine Learning for Microcontrollers
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
Choose your dev platform
Choose your dev platformChoose your dev platform
Choose your dev platform
 
Arduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesArduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch Slides
 
Arduino.pptx
Arduino.pptxArduino.pptx
Arduino.pptx
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
All about ir arduino - cool
All about ir   arduino - coolAll about ir   arduino - cool
All about ir arduino - cool
 
OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...
OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...
OSMC 2018 | Monitoring evolution at scale: From closed to open source in 13 y...
 
Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)
Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)
Getting Started with the NodeMCU- NodeMCU Programming (By Akshet Patel)
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrograman
 
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
Coding Dojo - Golden Master Technique - Approval Tests - Gilded Rose Kata-
 
13223971.ppt
13223971.ppt13223971.ppt
13223971.ppt
 
GDGPH Hack Fair Presentation
GDGPH Hack Fair PresentationGDGPH Hack Fair Presentation
GDGPH Hack Fair Presentation
 

More from Alin Pandichi

[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend code[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend codeAlin Pandichi
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Alin Pandichi
 
The sorry state of frontend code [a talk @ Softbinator]
The sorry state of frontend code [a talk @ Softbinator] The sorry state of frontend code [a talk @ Softbinator]
The sorry state of frontend code [a talk @ Softbinator] Alin Pandichi
 
Behavior driven development - a recap (@ Symfony Bucharest Meetup)
Behavior driven development - a recap (@ Symfony Bucharest Meetup)Behavior driven development - a recap (@ Symfony Bucharest Meetup)
Behavior driven development - a recap (@ Symfony Bucharest Meetup)Alin Pandichi
 
The sorry state of frontend code
The sorry state of frontend codeThe sorry state of frontend code
The sorry state of frontend codeAlin Pandichi
 
How to unit test your React/Redux app
How to unit test your React/Redux appHow to unit test your React/Redux app
How to unit test your React/Redux appAlin Pandichi
 
Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)Alin Pandichi
 
Coding Dojo - Refactoring Tennis Kata
Coding Dojo - Refactoring Tennis KataCoding Dojo - Refactoring Tennis Kata
Coding Dojo - Refactoring Tennis KataAlin Pandichi
 
Software development - the java perspective
Software development - the java perspectiveSoftware development - the java perspective
Software development - the java perspectiveAlin Pandichi
 
Java 8 - Lambdas and much more
Java 8 - Lambdas and much moreJava 8 - Lambdas and much more
Java 8 - Lambdas and much moreAlin Pandichi
 

More from Alin Pandichi (11)

[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend code[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend code
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
 
The sorry state of frontend code [a talk @ Softbinator]
The sorry state of frontend code [a talk @ Softbinator] The sorry state of frontend code [a talk @ Softbinator]
The sorry state of frontend code [a talk @ Softbinator]
 
Behavior driven development - a recap (@ Symfony Bucharest Meetup)
Behavior driven development - a recap (@ Symfony Bucharest Meetup)Behavior driven development - a recap (@ Symfony Bucharest Meetup)
Behavior driven development - a recap (@ Symfony Bucharest Meetup)
 
The sorry state of frontend code
The sorry state of frontend codeThe sorry state of frontend code
The sorry state of frontend code
 
How to unit test your React/Redux app
How to unit test your React/Redux appHow to unit test your React/Redux app
How to unit test your React/Redux app
 
Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)
 
Coding Dojo - Refactoring Tennis Kata
Coding Dojo - Refactoring Tennis KataCoding Dojo - Refactoring Tennis Kata
Coding Dojo - Refactoring Tennis Kata
 
Avatar.js
Avatar.jsAvatar.js
Avatar.js
 
Software development - the java perspective
Software development - the java perspectiveSoftware development - the java perspective
Software development - the java perspective
 
Java 8 - Lambdas and much more
Java 8 - Lambdas and much moreJava 8 - Lambdas and much more
Java 8 - Lambdas and much more
 

Recently uploaded

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Coding Dojo - The learning remote control