ROBODYSSEY SYSTEMS LLC

Product Catalog
Code Page
Policies
Gallery
Whats New
Press Releases
Resources
Links
Contact Us
About Us
Press

Home Product Catalog Shopping Cart Resources Links
Code Page Policies Gallery

The communication cable to the PC is made as specified in the PicBasic Compiler Manual.
1.0K DB9
pin --/\/\/\---- RS-232 RX Pin 2
GND ------------ RS-232 GND Pin 5
This Project displays A to D values on your computer screen as the occur. It is very handy for setting up sensors as you develop programs for your robot.
See "PicDisplay" for more details on serial hookup.

	
'** Displaying A to D Data on your computer ***
'********************************************** 
'@ Platform: PicBasic 
'@ Version: 1.0
'@ Author: Brian Patton (brianp@robodyssey.com)
'     Robodyssey Systems, LLC. - www.robodyssey.com
'@ Last Updated: Feb 19, 2004 
'*********Materials*****************************
' 1 Robodyssey PicPac MotherBoard
' 1 Pic16F876 or similar
' 1 Voltage Divider board
' 1 Photo Resistors
' PicBasic Compiler and a programmer
'***********************************************
' Register Locations
Symbol  TRISA  = $85          ' Register Location of TRISA
Symbol  ADCON0 = $1F          ' Register location of ADCON0
Symbol  ADCON1 = $9F          ' Register Location of ADCON1
Symbol  ADRESH = $1E          ' Register Location of ADRESH
 
'*****Initiation********************************
Init:
 Dirs = %11111111             ' Set all Port B to output
 
'*****Main Code Block Area**********************
'************ A/D Read *************************
 
Start:
  poke TRISA, %11111111       'Set all PortA Input
     poke ADCON1, %00000010   'xxxx0010 - PortA 0-4 analog inputs, 5-7 digital inputs 
                                                 '0xxxxxxx Sets result to Left justified
                                                 '1xxxxxxx Sets result to Right justified
AD0chk:
     poke ADCON0, %11000001   'Set A/D to RC Osc, Channel 0, A/D converter ready
                                                 'xx000xxx-Chan 0(RA0), xx001xxx-Chan 1(RA1),
                                                 'xx010xxx-Chan 2(RA2), xx011xxx-Chan 3(RA3),
                                                 'xx100xxx-Chan 4(RA4), xx101xxx-Chan 5(RA5),
                                                 'xx110xxx-Chan 6(RA6), xx111xxx-Chan 7(RA7),
 
     b0 = %11000101           'xxxxx1xx - on, xxxxx0xx - off
     Poke ADCON0,b0           ' Turn on the conversion at Bit 2
 
AD0fin: 
  Pause 5
     Peek ADCON0,b0
   If b0 = %11000101 Then AD0fin   ' Wait for low on bit-2 of ADCON0, conversion finished
     Peek ADRESH,b3
 
'************ Output to Display ******************        
 Serout 0,N2400,(#b3,10,13)   'Display the AD value stored in b3
 Pause 500                    'Chill for 1/2 second
'*************************************************
 goto AD0chk                  'Start it all over again
 end

Home Product Catalog Shopping Cart Resources Links
Code Page Policies Gallery

Robodyssey Systems manufactures Robot Kits including Autonomous Mobile Walking Robots, Wheeled Robots, Talking Robots, Expressive Robots, and Social Robots. We also sell Robotics Accessories including Nexcell NiMH AA Rechargeable Batteries, Nexcell NiMH AAA Rechargeable Batteries, Battery Holders, Velcro Straps for Battery Packs, Battery Chargers, Robot Grippers, Hobby Servos, Servos Modified for Continuous Rotation, Tail Wheels for all Rolling Robotic Platforms, Polyurethane Skate Wheels with Servo Adapter Hubs, Sharp IR Sensors and Adjustable Sensor Brackets, Sensor Cables, and Programming Cables. All of our Robot Kits can be purchased as easy to assemble robot kits or as fully assembled stationary or mobile robots. Robodyssey uses 1/8 inch aluminum and acetyl for most all of our mobile robot components and robotics accessories. We provide classroom training for teachers interested in integrating robotics, computer programming and electronics into the classroom.

We hope you enjoy our web site. Feel free to use any robotic resources. Robodyssey is your complete solution for Educational Robotics as well as Hobby Robotics.