Author Topic: More $50 Robot LED Troubles  (Read 2556 times)

0 Members and 1 Guest are viewing this topic.

Offline SlotheryTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
More $50 Robot LED Troubles
« on: August 04, 2010, 10:24:41 AM »
Upon installing my LED correctly (the poles were connected backwards) I have found that it still does not shine for my photovore code. However, the LED is constantly shining when I upload the .hex file used to center servos (the program provided by the website). I was wondering if someone could help me get my LED to shine for the photovore code.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: More $50 Robot LED Troubles
« Reply #1 on: August 04, 2010, 11:00:34 AM »
There should be some LED_ON() and LED_OFF() commands somewhere, dig around through the Sor_utils file and it should be there

Offline SlotheryTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: More $50 Robot LED Troubles
« Reply #2 on: August 04, 2010, 11:54:27 AM »
I have found the LED_ON() and LED_OFF() in the Sor_utils file now what am I to do to make my LED turn on when I power the board?

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: More $50 Robot LED Troubles
« Reply #3 on: August 04, 2010, 12:20:15 PM »
At the beginning of the code place "LED_ON();"

Offline SlotheryTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: More $50 Robot LED Troubles
« Reply #4 on: August 05, 2010, 08:59:31 AM »
Ok so my program now looks like this:

Quote
LED_ON;
#include <avr/io.h>          // include I/O definitions (port names, pin names, etc)
#include <avr/interrupt.h>   // include interrupt support

//AVRlib includes
#include "global.h"      // include global settings
//#include "buffer.h"      // include buffer function library
//#include "uart.h"      // include uart function library
//#include "rprintf.h"   // include printf function library
//#include "timer.h"      // include timer function library (timing,

After inserting "LED_ON;" right at the beginning of the code I hit (CTRL+S) to save it and then found my photovore .hex and uploaded that code to my board via my AVRISP MKII. However my LED still doesn't shine. Did I mention that the LED shines when the centering program provided by the website is on the board? Could you not find out what the centering program does that the photovore program lacks?

Offline amando96

  • Robot Overlord
  • ****
  • Posts: 187
  • Helpful? 1
Re: More $50 Robot LED Troubles
« Reply #5 on: August 05, 2010, 09:28:13 AM »
LED_ON; ≠ LED_ON();

I'm pretty sure there is a difference, I may be wrong, haven't touched this in a while.
Rorcle, 60% complete
AATV, 5% complete

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: More $50 Robot LED Troubles
« Reply #6 on: August 05, 2010, 09:53:29 AM »
Saving it won't update the hex file. You must rebuild the program (I believe there is a button called "build all" or something like that). After doing a successful build, then the hex would update.

Offline SlotheryTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: More $50 Robot LED Troubles
« Reply #7 on: August 05, 2010, 11:25:55 AM »
Alright guys I got the LED to light up! Here's how I did it. I opened the photovore source code file and changed
Quote
LED_off();
to
Quote
LED_on();
Then I hit F7 to build the program and voila! the LED glows.
« Last Edit: August 05, 2010, 11:28:30 AM by Slothery »

 

SMF spam blocked by CleanTalk