Views: 19,999,220 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
04-20-24 01:48 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: 20878787 Next: 352479 Since: 07-07-12 Last post: 1344 days ago Last view: 357 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: 7560071 Next: 196866 Since: 12-09-12 From: Toronto, Canada Last post: 1884 days ago Last view: 1770 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: 20878787 Next: 352479 Since: 07-07-12 Last post: 1344 days ago Last view: 357 days ago |
Vortex is the software that we use. ____________________ a |
Jamie |
| ||
Member banned by request Level: 47 Posts: 13/531 EXP: 741493 Next: 24710 Since: 04-01-14 Last post: 2011 days ago Last view: 2011 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: 20878787 Next: 352479 Since: 07-07-12 Last post: 1344 days ago Last view: 357 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.029 seconds. (2048KB of memory used) MySQL - queries: 29, rows: 207/207, time: 0.014 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |