go_away

Author Topic: Sharp Code for GP2Y0A21YK  (Read 2424 times)

0 Members and 1 Guest are viewing this topic.

Offline Razor ConceptsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Sharp Code for GP2Y0A21YK
« on: October 07, 2008, 05:56:44 PM »
Hi, I just bought the Sharp IR sensor, the GP2Y0A21YK version (for my Axon). I noticed in sensors.c , there is no mention of the GP2Y0A21YK, closest one is the GP2Y0A02YK, which doesnt seem to work well. What code would be appropriate for my Sharp sensor? Thanks  ;D

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,585
  • Helpful? 169
    • Society of Robots
Re: Sharp Code for GP2Y0A21YK
« Reply #1 on: October 07, 2008, 10:41:49 PM »
Ok I just wrote this code for you. Add it into sensors.c. It'll be included in all future Axon code versions. Let me know how well it works for you!

Code: [Select]
//Sharp GP2Y0A21YK IR Range Sensor - 4 cm to 30 cm
int sharp_IR_interpret_GP2Y0A21YK(int value)
{
return 739.38*pow(value,-.8105);
}

Offline Razor ConceptsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: Sharp Code for GP2Y0A21YK
« Reply #2 on: October 08, 2008, 04:59:43 PM »
Thanks it works great. This also spurred me on to finally use the hyperterminal... and now I wish I had used it earlier, it should help a lot in trying to debug my code  ;D

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
1799 Views
Last post January 15, 2009, 09:44:02 PM
by Admin
5 Replies
1540 Views
Last post March 02, 2013, 08:13:43 PM
by Admin
5 Replies
3179 Views
Last post August 01, 2009, 04:53:35 AM
by starscorched
3 Replies
843 Views
Last post July 21, 2010, 07:58:43 AM
by waltr


Get Your Ad Here