uln200xa: C implementation and examples

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2016-10-24 16:04:51 -06:00
parent 7e0862cecc
commit 58dfa9d95a
14 changed files with 499 additions and 270 deletions

View File

@ -1,6 +1,6 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
* Copyright (c) 2015-2016 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -33,7 +33,7 @@ var myUln200xa_obj = new Uln200xa_lib.ULN200XA(4096, 8, 9, 10, 11);
myUln200xa_obj.goForward = function()
{
myUln200xa_obj.setSpeed(5); // 5 RPMs
myUln200xa_obj.setDirection(Uln200xa_lib.ULN200XA.DIR_CW);
myUln200xa_obj.setDirection(Uln200xa_lib.ULN200XA_DIR_CW);
console.log("Rotating 1 revolution clockwise.");
myUln200xa_obj.stepperSteps(4096);
};
@ -41,7 +41,7 @@ myUln200xa_obj.goForward = function()
myUln200xa_obj.reverseDirection = function()
{
console.log("Rotating 1/2 revolution counter clockwise.");
myUln200xa_obj.setDirection(Uln200xa_lib.ULN200XA.DIR_CCW);
myUln200xa_obj.setDirection(Uln200xa_lib.ULN200XA_DIR_CCW);
myUln200xa_obj.stepperSteps(2048);
};