Git Product home page Git Product logo

pulse-input-generator's Introduction

Pulse-Input-Generator

Hi! Below is some information you may need to get this working:

IMPORTANT

  • Please make sure you have the Arduino IDE installed. It is free online @ https://www.arduino.cc/
  • I will inlcude the corresponding library for digitalWriteFast: make sure to copy and paste the digitalWriteFast folder into C:/ProgramFiles(x86)/Arduino/libraries. This allows for the method digitalWriteFast() to compile at speeds of up to 250 nanosecs instead of the normal 100 microsecs (as close to instantaneous as can be) within the arduino code.

THE PROGRAM WILL NOT RUN CORRECTLY IF THE ABOVE IS NOT DONE!!!

USAGE INSTRUCTIONS

First, make sure the "Pulse Inputs Arduino.ino" file is uploaded to the Arduino via the Arduino IDE. Use the IDE to upload the code onto the Arduino, then you may close Arduino IDE and run the program as normal.

To run the program, navigate to the folder named "dist". Inside should be the ".exe"** program which the user can simply run and the application should pop up in a browser window (usually chrome). From there, just type in the desired time frames and measure the signals in an oscilloscope.

*If a smaller pulse width is desired, 250 ns is attainable if you skip the usage of the executable. To do this, open the "250ns HardCode Pulse Input" folder and open the .ino file in the Arduino IDE. Here, change the values within the __builtin_avr_delay_cycles(4) and delayMicroseconds(2) lines and upload the code onto the Arduino.

** The final step is to make it a ".exe" file to simply make an executable for the program. If you haven't yet, install pyinstaller via pip install pyinstaller in the command line (I use Anaconda Prompt). Then simply type python -m eel "YOUR_FILE.py" web --noconsole --onefile. The resulting executable should be in a "dist" folder.

HOW IT WORKS

The user interacts with the front end GUI application which uses a combination of JavaScript, HTML, and CSS, all with corresponding code files in the packaged distribution. The HTML gives the layout of the GUI, and the CSS dictates the location and specific colors, etc. of the user interface. The JS interfaces between the frontend and the backend (python), using similar functions. Once the user inputs numbers in the text fields and hits submit, the JS saves the values submitted and sends them into the python script, which combines the three inputs as a single string with a "," in between as a delimiter. This is then interfaced with the Arduino using serial communication, in which the values in the string are parsed through, seperated based on the delimeter, and put into variables used to change the corresponding pulse times. (More detailed documentation on the Arduino code is commented in the Arduino ".ino" file

DEBUGGING

With the program open, you can press F12 to see the DevTools and check to make sure your inputs are being sent through to the backend. You can see this in the "console" tab in the DevTools window.

SOURCES:

https://www.youtube.com/watch?v=iy2aKf9AAvc

pulse-input-generator's People

Contributors

phanny-pack avatar

Watchers

 avatar

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.