sfranzyshen / OttoDIYJavaScriptV9

port of the OttoDIY Robot API (Otto9.h & Otto9Humanoid.h) to a ESP espruino (JavaScript) based platform (Based On The OttoDIYAsync Project Code)
https://github.com/sfranzyshen/OttoDIYJavaScript
MIT License
0 stars 0 forks source link

oscillator.js #7

Open sfranzyshen opened 4 years ago

sfranzyshen commented 4 years ago

first attempt at porting the oscillator code to javascript is up and ready for testing https://github.com/sfranzyshen/OttoDIYJavaScript/blob/master/oscillator.js

sfranzyshen commented 4 years ago

first test passed ... next up otto9.js 😄

let servo = [require('oscillator').init(), require('oscillator').init()];

// servo[0].attach(D12);
// servo[1].attach(D14);

// servo[0].SetPosition(0);
// servo[1].SetPosition(0);

// servo[0].SetPosition(180);
// servo[1].SetPosition(180);

// servo[0].SetPosition(90);
// servo[1].SetPosition(90);

// servo[0].detach();
// servo[1].detach();