-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
pca9685
since ported to xmake-repo and make start of TB6612.h
- Loading branch information
Showing
3 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
app/raspberry_pi/repository/packages/t/tb6612/tb6612/include/TB6612.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef TB6612_H | ||
#define TB6612_H | ||
|
||
#pragma once | ||
|
||
#include "cppgpio.hpp" | ||
|
||
namespace tb6612 | ||
{ | ||
class Motor | ||
{ | ||
public: | ||
Motor( | ||
const int &direction_channel, | ||
const int &pwn = 0, | ||
const bool &offset = true) : | ||
direction_channel(direction_channel), | ||
pwm(pwm), | ||
offset(offset), | ||
forward_offset(offset), | ||
backward_offset(!offset) | ||
{ | ||
} | ||
|
||
private: | ||
const int direction_channel; | ||
const int pwm; | ||
const bool offset; | ||
|
||
bool forward_offset; | ||
bool backward_offset; | ||
|
||
int speed = 0; | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package("tb6612") | ||
add_deps("cppgpio") | ||
set_sourcedir(path.join(os.scriptdir(), "tb6612")) | ||
on_install(function (package) | ||
local configs = {} | ||
import("package.tools.xmake").install(package, configs) | ||
end) | ||
package_end() |