go_away

Author Topic: 50$ robot  (Read 3398 times)

0 Members and 1 Guest are viewing this topic.

Offline ert481Topic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
  • yo young?
50$ robot
« on: October 31, 2008, 10:54:33 AM »
i would like to know how to add a push-button to the $50 robot

a. how and where would i connect it to the robot?
 
b. what would i add in the SoRutils.h file?
young people can build robots to!!!

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: 50$ robot
« Reply #1 on: October 31, 2008, 12:10:48 PM »
It depends on what the function of this push button would be.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: 50$ robot
« Reply #2 on: November 04, 2008, 12:02:11 AM »
Schematic:
http://www.societyofrobots.com/sensors_tactbumpswitch.shtml

In the code, set up a pin as an input (digital or analog, doesn't matter). You can use the same sensor code as the photoresistor if you want.

Offline ert481Topic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
  • yo young?
Re: 50$ robot
« Reply #3 on: November 04, 2008, 07:29:24 AM »
THANKS ADMIN!
young people can build robots to!!!

Offline ert481Topic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
  • yo young?
Re: 50$ robot
« Reply #4 on: November 07, 2008, 03:17:33 PM »
am i suposed to hook a 40 ohm resistor to the ground? then in the code what do i put so it does something when the button is pushed?
« Last Edit: November 07, 2008, 03:21:36 PM by ert481 »
young people can build robots to!!!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: 50$ robot
« Reply #5 on: November 09, 2008, 01:23:12 AM »
Quote
am i suposed to hook a 40 ohm resistor to the ground?
nope, not for a push button

Quote
then in the code what do i put so it does something when the button is pushed?
I'm confident you can figure this out after reading through the source code and searching the forum/google. Give it a try and if you still get stuck, post what you have and we'll help from there.

Step 0: connect one end of the button to ground, the other to your pin
Step 1: configure a port as a digital input
Step 2: turn on pull up resistor
Step 3: read the port value

 


Get Your Ad Here