Kuribo64
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
Posted on 05-02-14 02:11 AM (rev. 2 of 05-02-14 02:11 AM) Link | #40826
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"

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)
}

I hand-wrote this, it's pretty much like C. So it's really easy to make this kind of stuff.
If you have anything to add, just say it below.

____________________
a

Degolegodyl
Posted on 05-02-14 03:36 AM Link | #40827
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
Posted on 05-27-14 10:05 PM Link | #41866
Vortex is the software that we use.

____________________
a

Jamie
Posted on 06-06-14 06:52 PM Link | #42284
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
Posted on 06-08-14 10:52 PM Link | #42346
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.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.