Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IsakiMatsubara committed Sep 9, 2021
1 parent 0f7edf0 commit 884ef42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions plenbit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ namespace plenbit {

let motionSpeed = 20;
//[1000, 900, 300, 900, 800, 900, 1500, 900];good angle
export let servoSetInit = [1000, 630, 300, 600, 240, 600, 1000, 720];
let servoAngle = [0, 0, 0, 0, 0, 0, 0, 0];
export let servoSetInit = [1000, 630, 300, 600, 240, 600, 1000, 720, 900, 900, 900, 900];
const servoReverse = [false, false, false, false, false, false, false, false, true, true, true, true]; //サーボ反転
let servoAngle = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
let SERVO_NUM_USED = 8;
let romAdr1 = 0x56;
let initBle = false;
Expand Down Expand Up @@ -552,7 +553,7 @@ namespace plenbit {
//% block="servo motor initial"
//% weight=4 group="Motion"
export function servoInitialSet() {
for (let n = 0; n < 8; n++) {
for (let n = 0; n < 12; n++) {
servoWriteInit(n, 0);
}
}
Expand Down Expand Up @@ -663,6 +664,7 @@ namespace plenbit {
//% weight=10 group="PLEN:bit v1"
export function eyeLed(LedOnOff: LedOnOff) {
if (plenEyeCreated) clearPlenEye();
pins.digitalWritePin(DigitalPin.P8, LedOnOff);
pins.digitalWritePin(DigitalPin.P16, LedOnOff);
}

Expand Down Expand Up @@ -733,11 +735,14 @@ namespace plenbit {
*/
//% blockId=PLEN:bit_servo_Init
//% block="servo motor %num|number %degrees|degrees"
//% num.min=0 num.max=7
//% num.min=0 num.max=11
//% degrees.min=-90 degrees.max=90 degrees.defl=0
//% weight=8 group="Servo" advanced=true
export function servoWriteInit(num: number, degrees: number) {
let servoNum = 0x08;
if (servoReverse[num]) {
degrees *= -1;
}
if (initPCA9865 == false) {
secretIncantation();
initPCA9865 = true;
Expand Down
2 changes: 1 addition & 1 deletion pxt.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pxt-plenbit",
"version": "1.0.0",
"version": "1.0.1",
"description": "plenbit",
"dependencies": {
"core": "*",
Expand Down

0 comments on commit 884ef42

Please sign in to comment.