$ cd $ cordova prepareĭiscovered platform in config.xml or package.json. This will download all the node module and their dependencies, and setup the project files for Xcode and Android Studio. Run the `cordova prepare` command in the freshly cloned repository. Unpacking objects: 100% (80/80), $ Run ‘cordova prepare’ Remote: Total 80 (delta 23), reused 80 (delta 23), pack-reused 0 Remote: Compressing objects: 100% (47/47), done. Clone the repository from Github $ git clone I can only give quick instructions for how to do this on macOS, because that’s all I have.Ĭordova installation instructions can be found here. If you’re not familiar with Cordova, it’s not super complicated. To build the app and firmware, clone the repository from Github. Check if it's been more than 300ms since the last message, Int turningPWM = serialToPWM ( turningSpeed ) Int throttlePWM = serialToPWM ( throttleSpeed ) check if data is available, if so, process it Anything less than 25 can’t move the motors anyway. I’ve implemented a very coarse PWM, with only 5 levels: 0, 25, 50, 75 and 100%. It listens for incoming commands and energises the motors accordingly. bugLog ( "disconnectFromBattleSpider", spiderDebug ) īle.disconnect ( spiderDeviceID, () => handleDisconnectedSpider(), () => showError ( "Could not disconnect") ) * deviceID the BLE ID of the Battle Spiderįunction connectToBattleSpider ( deviceID: string )īle.autoConnect ( deviceID, ( data: BLECentralPlugin.PeripheralDataExtended ) => handleConnectedSpider ( data ), () => handleDisconnectedSpider() ) I’ve used TypeScript as my main language because it just makes for much nicer looking code, rather than straight-up JavaScript. The application to control the Battle Spider is made with Cordova, allowing it to be run on both Android and iOS, without too much hassle. Good thing I have another 3 spares sitting on my desk! (Thanks, Heather!) I think I probably would done it very differently now. ![]() I used a copious amount of hot glue and double-sided tape to hold it all together. Everything is powered by a 500mAh LiPo battery. I Dremeled the USB connect off it, to make it a bit more compact. Otherwise, they would be running way too slowly. Its function is to boost the 3V3 from the Bluefruit to about 5V, for the motors. The thing in the middle of the awesome diagram is a DC-DC booster board, I got from Deal Extreme. I am also using an Adafruit TB6612 motor controller board. There is no need to disconnect the battery, ever. It’s super small, and the best part is that you can hook a LiPo battery up to it, with the ability to charge it through the USB connector on the board. An Adafruit Feather 32U4 Bluefruit LE, which is an Arduino compatible, BLE capable board. I would download a copy, in case it ever becomes worth something, some day. Using the code I wrote back then, and visual inspection of the finished product, I’ve made a drawing of how the different components are connected, using state of the art graphics software. I would’ve loved to show you how I wired it up in steps, but this was all done 2 years ago and it didn’t occur to me then to make photos along the way. I didn’t use the wires in my one, but perhaps it could be useful for something. I tried to save the wires of the doodad on the right-hand side, but failed and ended up cutting them off with the Dremel. I am sure you could use a very sharp knife, but the plastic is pretty strong, so you may end up cutting your way into the hospital emergency department. ![]() I used a marker to draw out what I was going to cut. Next, go to town on the cover with a Dremel, removing all the excess plastic. Desolder or cut them away from the board. The wires to the motors are attached to a small PCB, which you can see once you’ve opened it up. It takes a single screw to remove the lid, to get to the batteries and then another 3 to remove the top of the robot. Direction is changed by rotating the main body, using a second motor, which changes the disposition of the legs, changing the direction in which the entire robot moves. All the 6 legs are powered with a single motors. These Battle Spiders are mechanically really interesting. Ever since I saw these HEXBUG Battle Spiders, I’ve wanted to tear them apart and supply them with a more capable brain. This is a project I’ve had on the shelf for quite some time (2 years or so), and only just now finished up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |