Coder Social home page Coder Social logo

ese5190-2022-lab1-firefly's Introduction

University of Pennsylvania, ESE 5190: Intro to Embedded Systems, Lab 1

Ruturaj A. Nanoti and Siddhant Mathur
    www.linkedin.com/in/ruturajn | www.linkedin.com/in/siddhantmathur14
Tested on: ASUS TUF DASH F15, Windows 11 | HP Pavilion X360, Windows 10

General Information

  • The hid_keyboard directory contains the code for Q4.4. Our program emulates a keyboard, based on the brightness values and gesture control using the APDS9960 (The Color/Proximity/Gesture sensor). This directory also contains, all the libraries associated with the code, all placed in the lib folder.
  • The firefly directory contains the code for Q3.2, in which the blue LED on the RP2040 dims, and brightens based on the brightness value obtained from APDS9960. As stated above, all the librabries used are placed under the lib directory.
  • All the other directories follow the same organization, of libraries and code.

Walkthrough

Firefly - Q3.2

  • This program takes in the brightness values from the APDS9960 and scales it down from a range of 0 - 65536 to 0 - 255.
  • The scaling is done to pass the brightness value to the blue LED, on the RP2040.
  • Also, the color_integration_time property is tweaked to decrease the number of samples for each reading, which decreases the time between two sensor readings, and hence provides a faster response, although this does reduce the accuracy of the readings a bit, and that is a trade-off which needs to be worked with, based on the desired result.
  • Depending on the brightness, the LED changes from a dimmed state to a bright state, and vice-versa.
  • Finally, when the firefly video is played in front of the sensor, the LED replicates the changes observed in the video.

Keyboard Emulator - Q4.4

  • In this program, the RP2040 was programmed to emulate a keyboard.
  • Firstly, we acquire the brightness data from the APDS9960 and scale it down from a range of 0 - 65536 to 0 - 255.
  • Then, if the brightness value is between 0 and 100. We print out the statement This is very Dim!!\n. The \n character at the end, places the cursor on a newline.
  • If the above condition is not satisfied, we check if the brightness is within the range of 100 to 190. If so, then the BACKSPACE action is sent.
  • While all of the above steps are running, simulataneously we are also checking if the user waves their hand, leftwards or rightwards (i.e. the gesture sensor returns 4 or 3) on the sensor. This action is encoded to quit the program, and hence the execution stops.

Flow Diagram

GIFs

Firefly

Keyboard Emulator

ese5190-2022-lab1-firefly's People

Contributors

ruturajn avatar pixelflipping avatar

Forkers

osamuyi97

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.