![]() | ||
Views: 24,266,821 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
03-21-25 07:58 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: 124 Posts: 2506/4661 EXP: 21676526 Next: 160075 Since: 07-07-12 Last post: 1679 days ago Last view: 692 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: 93 Posts: 1682/2397 EXP: 7859510 Next: 193300 Since: 12-09-12 From: Toronto, Canada Last post: 2219 days ago Last view: 2106 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: 124 Posts: 2521/4661 EXP: 21676526 Next: 160075 Since: 07-07-12 Last post: 1679 days ago Last view: 692 days ago |
Vortex is the software that we use. ____________________ a |
Jamie |
| ||
Member banned by request Level: 48 ![]() Posts: 13/531 EXP: 774601 Next: 48942 Since: 04-01-14 Last post: 2346 days ago Last view: 2346 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: 124 Posts: 2538/4661 EXP: 21676526 Next: 160075 Since: 07-07-12 Last post: 1679 days ago Last view: 692 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.434 seconds. (2048KB of memory used) MySQL - queries: 27, rows: 205/205, time: 0.209 seconds. ![]() © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |