Views: 19,850,592 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
03-28-24 12:01 PM |
Guest: |
0 users reading Making/Coding Robots | 1 bot |
Main - Computers and technology - Making/Coding Robots | Hide post layouts | New reply |
shibboleet |
| ||
Fire Mario DROP TABLE users; Level: 123 Posts: 2506/4661 EXP: 20822758 Next: 408508 Since: 07-07-12 Last post: 1321 days ago Last view: 334 days ago |
Robots are starting to become a big part of human life, doing tasks for us and everything..it's interesting.
I always wished I could make my own, and I am, with 2 classmates in my electronics class. We're making a bot that has 2 prongs sticking out of it, with a sensor in the middle of the bot. We control the bot with a joystick and put the rod near another bot's sensor to turn it off...first team to turn the enemy's bots off wins...simply. Nobody should be surprised, but I offered to do the coding section...wee. I thought it would be a pain in the ass...I was wrong. #include "Main.h"
I hand-wrote this, it's pretty much like C. So it's really easy to make this kind of stuff.
void main (void) { // Variable & Char declaration char front_bumper; char rear_bumper; front_bumper = GetDigitalInput ( 1 ); // Current front bumper state rear_bumper = GetDigitalInput ( 1 ); // Current back bumper state PrintToScreen ( "Front Bumper =%d\n", front_bumper ); // Print the front state PrintToScreen ( "Back Bumper =%d\n", rear_bumper ); // Print the back state JoystickToMotor ( 1, 1, 1, 0 ); if (front_bumper == 0) // Turns off the bot (front) { SetMotor( 1, 0); SetMotor( 10, 0); } if (rear_bumper == 0) // Turns off the bot (back) { SetMotor( 1, 0); SetMotor( 10, 0); } Arcade2( 1, 2, 1, 1, 10, 1, 0); // Motor config (TODO: Compare Tank2) } If you have anything to add, just say it below. ____________________ a |
Degolegodyl |
| ||
Larry Koopa /r/pcmasterrace Level: 92 Posts: 1682/2397 EXP: 7539024 Next: 217913 Since: 12-09-12 From: Toronto, Canada Last post: 1861 days ago Last view: 1747 days ago |
What's the hardware called? I remember in my computer engineering class we used "arduinos" which are small devices that let you upload code through usb and connect different components like led's and motors, and sensors both digital and analog to it, making everything work well. The language was very similar to C, like your's. |
shibboleet |
| ||
Fire Mario DROP TABLE users; Level: 123 Posts: 2521/4661 EXP: 20822758 Next: 408508 Since: 07-07-12 Last post: 1321 days ago Last view: 334 days ago |
Vortex is the software that we use. ____________________ a |
Jamie |
| ||
Member banned by request Level: 47 Posts: 13/531 EXP: 739159 Next: 27044 Since: 04-01-14 Last post: 1988 days ago Last view: 1988 days ago |
They already are a big part of Spamming Life. To me this is like an NCGR file (unreadable at all).
But, it probably means something cool, like CSS. |
shibboleet |
| ||
Fire Mario DROP TABLE users; Level: 123 Posts: 2538/4661 EXP: 20822758 Next: 408508 Since: 07-07-12 Last post: 1321 days ago Last view: 334 days ago |
It's actually C++ mixed with some C.
Although, this uses libraries, so it's not from complete scratch. ____________________ a |
Main - Computers and technology - Making/Coding Robots | Hide post layouts | New reply |
Page rendered in 0.019 seconds. (2048KB of memory used) MySQL - queries: 27, rows: 207/207, time: 0.010 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |