cwhaticando.com home DIY • Do it Yourself • Weekend Projects • BIG Projects • LITTLE Projects
become a creator share your how-to  

 

 

close window

How Do I Share My How-To?

It's really pretty easy, pictures and videos of the steps it takes to complete your project are stored on YouTube and picasaWeb. Once your "final" video is stored on YouTube, your project will show in the listings on the site. All this is controlled by our Creator's Tools. Basically, you start a project by writing up the project idea.

Step 1. Sign up for a free Creator's Account to gain access to the Creator's Tools.

Step 2. Login

Step 3. Push the "Create New Project" button on the Creator's Tools. Make a name (you can change it later) for your project. And describe your plans to use as notes to guide the creation of the steps.

Step 4. When you've finished providing all the steps to your project, shooting the videos and saving to google video via the Creator's Tool Panel, you are ready to write the introductory paragraph with an interesting story of how you did it, or how you do it in the case of a professional services presentation.

Step 5. Last but not least create and upload the video (to YouTube) which is the video that will be used to summarize the project. If you were building a robot, this final video would show the robot running around, doing fun things that will inspire others to create their version of your project.

That's it... Watch the views and ratings for your project pile up along with the sales commissions! Or get a customer because you showed how you remodel a house.

close window

FAQ About Becoming A Creator

Q. Why would I go to all that work, building something, then put it on a website like C What I Can Do? What's the point?

A. Actually, there are a couple of forms for a reward:

  1. You get rated as an author. Lots of good ratings looks good on your resume.
  2. You Make Money!

YOU Make Money when someone buys a part from You, and builds it into Their Version of your project. And, if YOU have a basement full of red leds and build a red led project - we'll send you customers who are inspired to build your blinking light device. If you sell PC boards, you may link to your own sales. Or sell your own kit online through your e-Bay store.

The same with books! We encourage project builders to make books. In fact, CwhatIcanDo is a great place to get rated as an author. 'Betcha get a better deal from your publisher...

Of course, it is possible that your project won't make you any money, because someone built something even cooler than yours (maybe even inspired by your project.) Maybe you just want to show your version of another project... It's done in the spirit of the web: Sharing ideas. And it's fun building a project on your own.



picAxe 18m2 for robotics      ...     32041 Views
Author's name: WeRbots       

I have obtained a pixAxe 18m2 to replace an 18x I was using in a project. The "m2" is the bees-knees for the things I am putting it through.

HOT STUFF and COLD STUFF

Hot list first, it`s the longest. It`s multi-tasking! I couldn`t believe it. No more timer problems (so far) driving pwm timers and servo timing. It seems much nicer now. You can run four tasks at a time and have complete programmatic task control.

And still you have interrupts! What a joy. Right now I`m playing around with a controller that`s sort of a half breed using pwm and electronic motor control to drive a two-wheeled bot.

Where the fun comes in now is fun with distance, since I can read on one of the many ADC`s from an IR rangefinder. Not only can I look for objects, I can react to them differently as I check things out in the area. Thanks for the multiprocessing.

And, to make that even better, you can bump the 4mHz / 8mHz timing up as high as 32 mHz, although you lose the correct timing for servos if you go above 16mHz :-) ROFL

Thus each of the 4 processes can rip along like they think they are running on 8mHz chips... Again, a winner!

Legs are replaced by port.pin dot annotation. So no pin/leg issues for my muddled old brain.

I haven`t tried `em yet, but there are capacitive touch inputs, fancy capacitive touch sensors like on an I-something. I will try them.

I have tried the all-new "reset button as input button". No reset button. I like it though, mine runs a process that starts up the motors during short test runs of my latest bot.
Author's Assigned Keywords:    picAxe 18m2    picAxe 18x    picAxe

  (ad)
Software Clips of Interest     
This is pretty nice:

Check out the listing. Notice how you can stop processing running and then restart them. Note the drive forward process, it is stopped when the motor stops when you get too close to an object. You can see the task management in the software:

#rem
```````````````````````````````````````````````````
` PicAxe 18M2
` Pinout and Definition of Legs
`
`(DAC / Touch / ADC / Out / In) C.2 leg 1
`(SRQ / Out) Serial Out / C.3 leg 2
`(In) / Serial In / C.4 leg 3
`(In) C.5 leg 4
`=======================================
`(gnd) 0v leg 5
`=======================================
`(SRI / Out / In) B.0 leg 6
`(i2c sda / Touch / ADC / Out / In) B.1 leg 7
`(hserin / Touch / ADC / Out / In) B.2 leg 8
`(pwm / Touch / ADC / Out / In) B.3 leg 9
`---------------------------------------
`(i2c scl / Touch / ADC / Out / In) B.4 leg 10
`(hserout / Touch / ADC / Out / In) B.5 leg 11
`(pwm / Touch / ADC / Out / In) B.6 leg 12
`(Touch / ADC / Out / In) B.7 leg 13
`=======================================
`(vcc) +v leg 14
`=======================================
`(Out / In) C.6 leg 15
`(Out / In) C.7 leg 16
`(Touch / ADC / Out / In) C.0 leg 17
`(Touch / ADC / Out / In) C.1 leg 18
`
` end 18M2 definition
`````````````````````````````````````````````````````
#endrem

` ------------------------------------------------------------
` Program Wide Symbols


`pins
symbol Piezo = B.2
symbol outPWM = B.3

`regVars
symbol ADCval = w0
symbol motorSpeed = w1
symbol TempA = w2
symbol TempB = w3
symbol warnDist = w4
symbol haltDist = w5

symbol true = 1 ` one or more
symbol false = 0 ` zero
`vars
symbol slowSpeed = 245 `carpet s250,m260,h300
symbol midSpeed = 250 `smooth s240,m280,h310
symbol hiSpeed = 300


` end Program Wide Symbols ----------------------------------

start0:
warnDist = 150 ` Somewhere between haltDist and around 80
haltDist = 410 ` 400 Least "sensitive" you are in 10 cm zone
`50 is most "sensitive", it`s pretty noisy and very picky
`80 is roughly 6ft away, nice burglar alarm for bedroom door
`400 is almost blind, things have to be 10cm zone to see `em
` set Motor Speed
gosub stopMotor
pwmout outPWM, 99, hiSpeed ` shake it baby hustle!

start1:
readadc10 C.1,ADCval ; read value into b1
pause 10 ; let value settle in
if ADCval > TempA then
TempA = ADCval `we are finding the maximum here
endif
` stop completely halt everything we are at limit (400ish)
if ADCval > haltDist then
TempA = 0
suspend 3
gosub stopMotor
gosub sirenHorn
gosub revMotor
pause 500
gosub stopMotor
pause 100
gosub turnL
pause 500
gosub stopMotor
` endif
` within sensor distance start gross evasive moves
elseif ADCval > warnDist then
gosub beepHorn
pwmduty outPWM,slowSpeed ` or turn right or left and back?
endif
pause 5 ; short delay
goto start1 ; loop back to start

start2:
if pinC.5 = 0 then
gosub beepHorn
pause 200
gosub beepHorn
pause 200
pause 1000
pwmduty outPWM,hiSpeed
resume 3
endif
pause 1000
goto start2

start3:
gosub fwdMotor
pause 20
goto start3


beepHorn:
sound Piezo,(122,40) ; make a sound,
return

sirenHorn:
sound Piezo,(120,30,125,30) ; make a siren
return

fwdMotor:
low B.0
high B.1
high B.4
low B.5
return

revMotor:
high B.0
low B.1
low B.4
high B.5
return


stopMotor:
low B.0
low B.1
low B.4
low B.5
`low outPWM
return

` Right and Left Steering Subroutines
`
turnR:
low b.0
high b.1
low b.4
high b.5
return

turnL:
high b.0
low b.1
high b.4
low b.5
return
Problems I encountered     
The PWM signal and the Servo command both use the same timer, so does the sound command, so things got messy. I had to treat a lot more of it as if it was a serial process, in other words, like an 18x, not an 18m2.

That was my fault for making assumptions about the multitasking. I read and learned, so I took a different approach. It`s a bit of a blend between how I would do it on an 18x and how I would like it to work on an 18m2. But I am learning and expect to do a lot more later.

Here`s where the code stands now: I`m not doing the head movements, just allowing the head to sit still and provide distance measurements which I can use to judge how close to a thing the bot can get.

Listing:

`pins
symbol Piezo = C.2
symbol outPWM = B.3
symbol Xservo = B.6
symbol Yservo = B.7

`regVars
symbol ADCval = w0
symbol motorSpeed = w1
symbol TempA = w2
symbol TempB = w3
symbol TempC = w4
symbol haltDist = w5
symbol warnDist = w6

symbol true = 1 ` one or more
symbol false = 0 ` zero
`vars
symbol slowSpeed = 280 `carpet s250,m260,h300
symbol midSpeed = 310 `smooth s240,m280,h310
symbol hiSpeed = 360
symbol headUP = 116
symbol headDN = 90
symbol xHdCtr = 135
symbol yHdCtr = 110


` end Program Wide Symbols ----------------------------------

start0:
warnDist = 300 ` Somewhere between haltDist and around 80
haltDist = 410 ` 400 Least "sensitive" you are in 10 cm zone

gosub stopMotor
servo Xservo, xHdCtr
servo Yservo, yHdCtr
low Xservo
low Yservo
`gosub beepHorn
pause 1000
pwmout outPWM, 99, hiSpeed ` shake it baby hustle!

loopydupe1:
readadc10 C.1,ADCval ; read value into c1
pause 10 ; let value settle in
` stop completely halt everything we are at limit (400ish)
`sertxd("The value of adc is ",#w0,13,10)
`pause 200
if ADCval > haltDist then
TempA = 0
suspend 2
gosub stopMotor
gosub sirenHorn
pwmduty outPWM, hiSpeed
gosub revMotor
pause 300
gosub stopMotor
pause 100
gosub turnL
pause 200
gosub stopMotor
pwmduty outPWM, slowSpeed
pause 1000
resume 2
` within sensor distance start gross evasive moves
elseif ADCval > warnDist then
pwmduty outPWM, slowSpeed ` or turn right or left and back?
`gosub snoop
endif
pause 5 ; short delay
goto loopydupe1 ; loop back to start

start1:
if pinC.5 = 0 then
pause 1000
pwmduty outPWM, hiSpeed
resume 2
endif
pause 1000
goto start1

start2:
gosub fwdMotor
pause 20
goto start2



`Direction sensing
snoop:
`gosub stopMotor
gosub ctrHead
gosub upHead
for TempC = 50 to 200 step 10
servopos Xservo, TempC
pause 100
readadc10 C.1,ADCval ` read IR value
if ADCval > TempA then
TempA = ADCval `we are finding the maximum here
TempB = TempC `count
endif
next TempC

gosub dnHead
for TempC = 200 to 50 step -10
servopos Xservo, TempC
pause 100
readadc10 C.1,ADCval ` read IR value
if ADCval > TempA then
TempA = ADCval `we are finding the maximum here
TempB = TempC `count
endif
`stor largest and head position
next TempC

gosub ctrHead
pause 1000
`low Xservo
`low Yservo

return

beepHorn:
sound Piezo,(122,40) ; make a sound,
low Piezo ; sound off
return

sirenHorn:
`sound Piezo,(120,30,125,30) ; make a siren
pause 100
low Piezo
return

fwdMotor:
low B.0
high B.1
high B.4
low B.5
return

revMotor:
high B.0
low B.1
low B.4
high B.5
return


stopMotor:
low B.0
low B.1
low B.4
low B.5
`low outPWM
return

` Right and Left Steering Subroutines
`
turnR:
low b.0
high b.1
low b.4
high b.5
return

turnL:
high b.0
low b.1
high b.4
low b.5
return

`
ctrHead:
servopos Xservo, xHdCtr
pause 500
servo Yservo, yHdCtr ` set HeadPosition Indicator Flag CTR
pause 500
return

upHead:
servopos Yservo, headUP
` set HeadPosition Indicator Flag UP
return

dnHead:
servopos Yservo, headDN
` set HeadPosition Indicator Flag DN
return

become a creator
close window

It's Easy To:

C - What - I - Can - Do

• Sign up - Get ID and Password

• Plan and Create a Project That Someone Might Enjoy and May Even Want to Build

• Link to your creation on your favorite social networking site or blog.

• Become famous! Because your projects get a lot of Hits!

 

No parts list with this project. Scan the 'Junkbox Reviewer' below! Find projects by clicking on their parts. Got something in your junkbox? Here's your spot to find something fun to make or build!

 

Junk Box Reviewer
Itching To Start Building A DIY Do It Yourself Project? Got Some Parts of Your Own in your JunkBox? Find projects by Surfing' the Parts List!
  
  
  
  
  
 
Andrei And Jim
Web Developers
Visit the project:

CwhatIcanDo Website


 
  
  
 
L 298 Compact Motor Driver Kit
Solarbotics
Visit the project:

Build the L298 H-Bridge Motor Control


 
  
 
Account On CwhatIcanDo
CwhatIcanDo.com
Visit the project:

HELP :: How To Create a Project


 
  
  
 
Microrobot Avoider Jr
Microrobot
Visit the project:

Robot Man: With Robot Demos


 
  
  
  
 
Brilliant Blue/Green LED
Surplus
Visit the project:

Converting a Flashlight to LED


 
  
 
PICAXE 8 Pin Motor Driver Board
SparkFun
Visit the project:

Easy Cheap Robot Weekend Project


 
  
 
Tracked Vehicle Chassis Kit
Tamiya
Visit the project:

Build Your Own Track Drive Robot


 
  
  
 
PICAXE 8 Pin Motor Driver Board
SparkFun
Visit the project:

Build Your Own Track Drive Robot


 
  
 
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
Visit the project:

Build Your Own Track Drive Robot


 
  
 
PICAXE 8 Pin Motor Driver Board
SparkFun
Visit the project:

Build a Robot In 5 Minutes


 
  
 
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
Visit the project:

Build a Robot In 5 Minutes


 
  
 
Gear Motor 2 - 224:1 Offset Shaft
SolarBotics
Visit the project:

Build a Robot In 5 Minutes


 
  
 
4 X AA Cell battery holder plus on/off switch
Powerize
Visit the project:

Build a Robot In 5 Minutes


 
  
 
PICAXE 8 Pin Motor Driver Board
SparkFun
Visit the project:

picAxe 8 bit Motor Controller: Look Inside


 
  
 
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
Visit the project:

picAxe 8 bit Motor Controller: Look Inside


 
  
 
4 Section In-Ground Batting Net
battingnets.com
Visit the project:

Home Installation of a 4 Section In-Ground Batting Cage


 
  
  
  
  
  
  
  
 
Transformer 1k:8 ohm
xicon
Visit the project:

Pong)))))


 
  
 
PICAXE 8 Pin Motor Driver Board
SparkFun
Visit the project:

Robots Almost Anyone Can Afford


 
  
  
  
 
Morphibian Land Shark
Kid Galaxy
Visit the project:

Morphibian Land Shark


 
  
  
  
  
  
  
 
Parallax (Futaba) Continuous Rotation Servo
futaba (modified)
Visit the project:

How To Build a Robot in a Box


 
  
 
Parallax (Futaba) Standard Servo
futaba
Visit the project:

How To Build a Robot in a Box


 
  
  
  
 
PICAXE 8 Pin Motor Driver Board
SparkFun
Visit the project:

Weekend Project: Get Started With Robots


 
  
  
 
L298 Compact Motor Driver
Solarbotics
Visit the project:

Build a Respectable Autonomous Robot


 
  
 
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
Visit the project:

Weekend Project: Get Started With Robots


 
  
  
 
PICAXE 18 Pin Power Project Board
picAxe
Visit the project:

Build a Robot From A Power Wheelchair


 
  
 
PICAXE 18M2 Microcontroller
picAxe
Visit the project:

Build a Robot From A Power Wheelchair


 
  
  
  
  
  
 
Solderless Breadboard For Uno
Jameco Valupro
Visit the project:

Arduino Development VS PicAxe Development


 
  
 
USB 2/0Video Capture Device
SIIG
Visit the project:

On Line Neighborhood Watch


 
  
  
  
 
Eurocard IC Pattern
Velleman
Visit the project:

On Line Neighborhood Watch


 
  
 
40 kHz Weatherproof Transducer
Audiowell Electronics
Visit the project:

Pong)))))


 
  
 
PICAXE 18M2 Microcontroller
picAxe
Visit the project:

Autonomous Robot PVC "Pickup Truck"


 
  
 
Power Amplifier
ST Micro
Visit the project:

Pong)))))


 
  
  

By Creators
WeRbots: i-Mon App
WeRbots: Pong)))))
By Keywords
Ajax: battle
Android: battle
BEAM Robots: battle
Convert Your Flashlight to LED: Converting a Flashlight to LED
How To Build Cheap Bots: Robots Almost Anyone Can Afford
How To Build Cheap Bots: How To Build a Robot in a Box
How To Website: Tour This Website
How To Website: CwhatIcanDo Website
Infrared Proximity Sensor: Build Your Own Track Drive Robot
Quick Build Robot: Build a Robot In 5 Minutes
robot bending: Morphibian Land Shark
Robot Motor Control: Robot Basics
Robot Motor Control: Buggy Bot: Wire Frame Bot Body
Robots: Robot Basics
Rumble Bot Conversions: Robots Almost Anyone Can Afford
Select or type in a Keyword: Converting a Flashlight to LED
web 2.0 site: CwhatIcanDo Website
Weekend Project Robots: Easy Cheap Robot Weekend Project

Click To Expand / Contract Menus. View by Creator, Category, Keywords or Number of Views.

©Copyright 2008 - , CwhatIcanDo.com, all rights reserved.