Git Product home page Git Product logo

ossex's People

Contributors

dga02155 avatar durkie avatar hellerve avatar per1234 avatar quitmeyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ossex's Issues

Button not working

Hi,

I tried to play a little bit for an own toy with the library. And individually the functions of it are great and work. But when I try to to work with the full Mod Sketch I only can get the button to work when I include the Onebutton Library into the mod_vibrator.ino , define the pin there and changing the set.up buttons clicks. At least the single click function for switching patterns is working then. But the increase or decrease not.

Maybe there is something wrong with pulling the defined pin in the ossex.cpp file. Could you help me out here? Would love to get it fully going.

Patterns can only update one motor at a time

Currently pattern functions set a global step array of {motorNumber, motorPower, stepTime} for the next vibration pattern step to be run.

You can currently only set one motor change per step. Ideally you'd be able to update all motors at once in a given step.

Considerations:

  • Keeping it clean and approachable for people of different experience levels
  • Handling time: do we have a time component for each motor ({ {m1power, m1time}, {m2power, m2time} }...)? Do we consider each motor's step time as happening sequentially or all step times initiating at the start of the step? Eg: to turn the motors on to 200 power with 100ms offsets from each other do we do: { {200, 100}, {200, 100}, {200, 100} } OR { {200, 100}, {200, 200}, {200, 300} }? They seem roughly equivalent right now, but both seem conceptually tricky.
  • Handling time 2: What if we have a single time value, but multiple potential values for motor and power? Something like { {motors}, {powers}, time }. Issue is then how to structure the data to handle cases where we're updating only one motor or updating all 3. Maybe like:
struct {
  bool motor[3];
  unsigned int power[3];
  unsigned int time;
} step;

So then each step can update the motors like so:

for (int i = 0; i < 3; i++) {
  if (step.motor[i]) { 
    Toy.setOutput(i, step.power[i]); 
  }
}

People can then write pattern functions that set Step or Toy.step:


function myPattern() {
  Step.motor[0] = true;
  Step.power[0] = 200;

  if (random(2) % 2) {
    Step.motor[1] = true;
    Step.power[1] = random(255);
  } else {
    Step.motor[1] = false;
  }

  Step.time = 400;
}

๐Ÿ‘‰ ๐Ÿ‘Œ

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.