Posts Tagged ‘example’

Example Factories

Question:

Do you have any sample factories I can show my students to get them excited?

Solution:

Sure do…. see the links below!  Be sure to send us any that you and your students do… we would love to feature them here!

CalPoly’s 2015 Factory that Assembles the lid to a container that was built in the previous unit of the CIM course.

That’s right…. CalPoly built TWO factories this year! This one does a powder coating operation on a metal part.

Would you like to see a playlist of older factories built at previous CTI’s? Click on the video below to get a playlist of many more.

Continue Reading

HOW DO I HANDSHAKE A LYNXMOTION AL5D ARM WITH A VEX CORTEX?

Question:
How do I make my Lynxmotion Robotic Arm talk to a VEX Cortex?

Solution:
The actual wiring is easy, and so is the programming. Let me break the answer up into sections:

Question:
How do I receive a signal on a Cortex from the SSC-32 (Lynx Robot) in RobotC?

Answer:
One way to do it is shown in the example below. A machine is waiting for a signal from the robot. The €œwhile€ statement in the program below is not necessary, just an added bonus as a start switch. NOTE THE COMMENTS BELOW FOR HOW THE WIRING GOES!

1 Question:
How do I send a signal from the Cortex to the SSC-32 in RobotC? 

Answer:
It is definitely best to set a to either 1 or 0 and make it a Digital Output!  Any other way and the signal will be backwards. Notice that you can check the value of the signal in the debugger window.  Notice that there is only one =. This sets the value. == means compare…..

REAL2 Question:
How do I make it talk back and forth?

Answer:
See the picture below. Please read the comments too!

Real3 Continue Reading

I WISH I HAD SOME EXAMPLE PROGRAMS IN ROBOTC!

Problem:

Are there any example programs in RobotC that will help me with beginning programming?

reddownloadDownload zip file with all the programs below here.  

Solution:

As a matter of fact; here they are! Download the zip folder for all of the programs and notes listed below.

These programs were written by Jim and I at Albany during CTI Facilitator training as examples to be used in the classroom. A great way to use these would be for a quiz, or check for understanding. Give the students the Description and /or the Psuedocode, and have them demonstrate proficiency by writing the program or making it work.

1StartStopMotors:  Turn two motors in opposite directions at half power for five seconds then stop.

2Continuous Servo: Continuously run a servo back and forth at 0.5 sec intervals until a button is pressed.

3Motor til Touch: Turn right motor On Until Touch is pressed stop right motor.

4ledTilPotValue:  Turn on the green led until the potentiometer value is greater than 2048.

5MotorTilEncoderValue:    Turn on both motors until the encoder counts 480 degrees. Motor 2 is reversed in #pragma as if in a diff drive Useful if you want a robot to drive x distance before stopping.

6WaitforSonarThenMotorOff:  Wait until object is 20 cm away and turn the motors off. NOTE: Refresh rate in the debugger has to be set on Pause Refresh.

7Line follower moves servo 4-1-11: move the servo to position 127 until a light object is detected, then move to position -127.

8Flashlight light sensor: Turn the flashlight on at dark, then of at light. Like a nightlight.

9LEDBlinkTilPot2048 Program the green led to flash on and off for 2 seconds while the pot reads less than 2048.
10BumpLightOnNoBumpLightOff: Program the green led to turn on if the bumper switch is pressed, and off if it’s released. Loop forever.
11IfThenElse: Program the green led to turn on if the bumper switch is pressed, and off if it’s released. Loop forever.
12IfTheElseNotes: Program the green led to turn on if the bumper switch is pressed, and off if it’s released. Loop forever. WITH NOTES
13-3xCounterExample: Create a count based while loop that turns a motor on for 1 second, then off for one second. Do this five times. WITH NOTES
14Functions: Make the LED light up when the bump switched is pushed, and turn off when it is not. This is an example of a function.
15 Advanced Functions : ADVANCED FUNCTIONS -FUNCTIONS THAT ARE SIMILAR LIKE FORWARD SLOW AND FORWARD FAST, -YOU CAN USE *PARAMETERS* TO SEND VALUES LIKE MOTOR SPEED OR SERVO POSITION -VOIDS JUST DO STUFF/ INT BELOW RETURNS A VALUE TO TASK MAIN.
16  While Timer: NOTE: TO MAKE A PROGRAM RUN FOR A CERTAIN AMOUNT OF TIME TIMER STARTS AS SOON AS THE PROGRAM DOES. THEREFORE YOU NEED TO CLEAR THE TIMER BEFORE USE. THERE ARE 4 TIMERS
17 Button Pushes in 30 sec: TO MAKE A PROGRAM RUN FOR A CERTAIN AMOUNT OF TIME TIMER STARTS AS SOON AS THE PROGRAM DOES. THEREFORE YOU NEED TO CLEAR THE TIMER BEFORE USE. THERE ARE 4 TIMERS
Continue Reading

Get in touch

Jim Hanson

Chris Hurd

Offcanvas

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.