{"id":27617886,"url":"https://github.com/dexterind/pxt-gigglebot","last_synced_at":"2025-04-23T04:57:30.373Z","repository":{"id":56336825,"uuid":"138215647","full_name":"DexterInd/pxt-gigglebot","owner":"DexterInd","description":"Choose Giggle package to get started. This is the limited features package only. It contains everything that is compatible with bluetooth so if you want to use bluetooth, this is the package you need.","archived":false,"fork":false,"pushed_at":"2020-11-13T16:16:25.000Z","size":1128,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T04:57:25.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://gigglebot.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DexterInd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-21T19:55:45.000Z","updated_at":"2021-04-16T13:47:56.000Z","dependencies_parsed_at":"2022-08-15T16:50:44.071Z","dependency_job_id":null,"html_url":"https://github.com/DexterInd/pxt-gigglebot","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterInd%2Fpxt-gigglebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterInd%2Fpxt-gigglebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterInd%2Fpxt-gigglebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DexterInd%2Fpxt-gigglebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DexterInd","download_url":"https://codeload.github.com/DexterInd/pxt-gigglebot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372940,"owners_count":21419722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-23T04:57:29.923Z","updated_at":"2025-04-23T04:57:30.366Z","avatar_url":"https://github.com/DexterInd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GiggleBot by Dexter Industries\nThis library provides blocks to control the Gigglebot, its motors, neopixels, sensors and servos.\nFor more information: https://www.gigglebot.io/pages/program-the-gigglebot-robot\n\n## Example Usage\n\n### Driving around  #driveMillisec\nTo drive forward and back for 2 seconds each:\n\n```blocks\ninput.onButtonPressed(Button.A, () =\u003e {\n    gigglebot.driveMillisec(gigglebotWhichDriveDirection.Forward, 2000)\n    gigglebot.driveMillisec(gigglebotWhichDriveDirection.Backward, 2000)\n})\n```\n\n### Turning, Spinning and Steering\n#### Turning happens around a wheel, it's a nice way of going around an obstacle. #turnMillisec\nTurning will have the GiggleBot make a sharp turn around one of its wheel. \nThis block will get the GiggleBot to turn right for a full second.\n```blocks\ngigglebot.turnMillisec(gigglebotWhichTurnDirection.Right, 1000)\n```\n#### Spinning happens on the spot, useful when drawing. #spinMillisec\nUsing the spin block is useful when drawing because the turns will be around the pen, instead of around a wheel. That way, you can get good corners when drawing.\n\n```blocks\ngigglebot.spinMillisec(gigglebotWhichTurnDirection.Left, 1000)\n```\n\n#### Steering is up to you, you can use it to orbit around a \"sun\". #steerMillisec\nWith steering you control how much turning each wheel can do. \nIn this example, the robot will turn towards the right, doing a curve around an object. \nThe first number is percent-based. With a value of 0, the robot will not turn at all. \nWith a value of 100, you will get the same behavior as the turn block.\n```blocks\ngigglebot.steerMillisec(20, gigglebotWhichTurnDirection.Right, 1000)\n```\n### Moving without time constraint \nYou can have blocks to drive, turn, spin, and steer, which are not time limited. That way, you can decide when to interrupt the GiggleBot. Maybe it gets dark, or there's an obstacle ahead.\n\n#### Drive #drivestraight \n```blocks\ngigglebot.driveStraight(gigglebotWhichDriveDirection.Forward)\n```\n#### Turn #turn \n```blocks\ngigglebot.turn(gigglebotWhichTurnDirection.Right)\n```\n#### Spin #gigglebotspin \n```blocks\ngigglebot.gigglebotSpin(gigglebotWhichTurnDirection.Right)\n```\n#### Steer #steer\n```blocks\ngigglebot.steer(20, gigglebotWhichTurnDirection.Right)\n```\n\n### STOP #stop\nWhen using blocks that do not have a time limit to them, you will need to stop the robot yourself.\n```blocks\ngigglebot.stop()\n```\n\n### Setting the speed #setspeed\nYou can set the motors to five different speeds, from slowest to fastest. You can either set one motor, or both at the same time. Be careful, if you set the motors to different speeds, it will not drive straight.\n\n```blocks\ngigglebot.setSpeed(gigglebotWhichMotor.Both, gigglebotWhichSpeed.Slowest)\n```\n\n### Following a line #linefollow\nThe GiggleBot comes with two line sensors that allows it to follow either a thick line or a thin line. The thick line is thick enough that both sensors will attempt to be over the line, while the thin line is thin enough to fit between the two sensors and each sensor will attempt to avoid the line.\n\n```blocks\ninput.onButtonPressed(Button.A, function () {\n    gigglebot.lineFollow(gigglebotLineType.Thick)\n})\n```\n\n### Reading the line sensors #linereadsensor\n\nYou can also access the line sensors values directly by using the blocks under the \"more...\" section. This allows you to write a line follower logic that is tailored to your specific needs.\n\n```blocks\nbasic.showNumber(gigglebot.lineReadSensor(gigglebotWhichTurnDirection.Right)) \n```\n\nYou can use the following code as the basis for your own line follower. First, detect what are good values for detecting your line, then code the appropriate movements.\n```blocks\nbasic.forever(() =\u003e {\n    if (gigglebot.lineReadSensor(gigglebotWhichTurnDirection.Right) \u003c 200) {\n        basic.showIcon(IconNames.Yes)\n    } else {\n        basic.showIcon(IconNames.Asleep)\n    }\n})\n```\n\n### Following a light #lightfollow\n\nThe GiggleBot comes with two light sensors that allows it to follow a spotlight, a little bit like a cat would.  Shining a flashlight onto one eye will get the GiggleBot to turn in that direction. The robot will go straight if the two sides receive similar lighting conditions. \n```blocks\ninput.onButtonPressed(Button.A, function () {\n    gigglebot.lightFollow()\n})\ninput.onButtonPressed(Button.B, function () {\n    gigglebot.stop()\n})\n\n```\n\n### Reading the light sensor values #lightreadsensor\n\nYou can also read the light sensors values directly in order to implement a different behaviour, like having the GiggleBot fall asleep when it gets dark, and wake up when there's light. The light sensor reading block can be found under the \"more...\" section.\n\n```blocks\nbasic.forever(() =\u003e {\n    if (gigglebot.lightReadSensor(gigglebotWhichTurnDirection.Right) \u003c 200) {\n        basic.showIcon(IconNames.Asleep)\n    } else {\n        basic.showIcon(IconNames.Happy)\n    }\n})\n```\n\n\n## SERVO MOTORS  #servomove\nThe GiggleBot comes with two servo connectors. What will you do with them? You can control them one by one, both together (in synchro), or both mirrored, depending on how they are positioned on the robot.\n```blocks\ngigglebot.servoMove(gigglebotServoAction.Right, 90)\n```\n\n### Testing for an obstacle with the distance sensor #distancesensortestforobstacle \n\n```blocks\nif (gigglebot.distanceSensorTestForObstacle(gigglebotInequality.Farther, 100)) {\n    gigglebot.driveStraight(gigglebotWhichDriveDirection.Forward)\n} else {\n    gigglebot.stop()\n}\n```\n\n## Getting the distance sensor value #distancesensorreadrangecontinuous\n\nYou can add a distance sensor to the robot. This distance sensor is not ultrasonic, but laser-based. \n\nThe smile Neopixels will give feedback on the distance sensor readings.\n```blocks\n\nbasic.forever(function () {\n    lights.smileShowGraph(gigglebot.distanceSensorReadRangeContinuous(), 300)\n    }\n})\n```\n\n## Supported targets\n\n* for PXT/microbit\n\n## License\n\nMIT License\n\nCopyright 2018 Dexter Industries\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexterind%2Fpxt-gigglebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdexterind%2Fpxt-gigglebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexterind%2Fpxt-gigglebot/lists"}