Code Monkey home page Code Monkey logo

pulser's Introduction

This library creates PWM signal of variable frequency and duty cycle.

Pulser

  • Uses timer1
  • for Atmega328
  • You can modify functions which are called to turn pin on/off by changing MACRO_PINON(), MACRO_PINOFF() in Pulser.h
  • Useful for precise frequency and duty modulation.
  • Great for driving Solid State Tesla Coils.

How to use

First you need to set right pin(s) to be switched. To modify it replace code in macros MACRO_PINON(), MACRO_PINOFF(), MACRO_PINMODE_INIT(). It's truly recommended to use register access as it is the fastest.

  1. For example PORTD |= (1<<2) in MACRO_PINON() will set 3rd bit of port D to true.-> setting arduino pin 2 HIGH
  2. Don't forget to change also MACRO_PINOFF() to PORTD &= ~(1<<2).
  3. Also you need to set pinMode(OUTPUT) for those pins. To do this simply replace code in MACRO_PINMODE_INIT(). DDRD |= (1<<2)

Alt text

(And yes, that's Bill)

pulser's People

Contributors

cooble avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

max4aters

pulser's Issues

how to change pins in macros and what to replace

hello, friend i really thank you for this great library can you please tell me how to use it because you have written everywhere just replace pins and pin mode , haven't told that what should we write there and whats the format for declaring pins , even am unable to run your only example that is showing me error in compiling ,waiting for your reply

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.