What next?

Forum Administrative - NOT PROJECT OR "HELP"

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

Hmm...I just downloaded it and there's no 'i; on line 1524, and there's no comment, either. Try this one:
avrdude.conf.zip
(25.65 KiB) Downloaded 45 times

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

This is creepy; I replaced the file and I still get the same error:

Code: Select all

C:\Users\Barry>avrdude -v

avrdude: Version 5.11-Patch#7610, compiled on Aug 31 2011 at 08:02:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"

error at C:\WinAVR-20100110\bin\avrdude.conf:1524 unrecognized character: "i"

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

And you put the file here, right?
C:\WinAVR-20100110\bin\avrdude.conf

That *is* strange. Here's what I've got around line 1524:

Code: Select all

#------------------------------------------------------------
# AT90s1200
#------------------------------------------------------------

part
    id               = "1200";
    desc             = "AT90S1200";
    stk500_devcode   = 0x33;
    avr910_devcode   = 0x13;
    signature        = 0x1e 0x90 0x01;
Line 1524 is the one with stk500_devcode. Maybe you could try commenting out the entire AT90s1200 section and see what happens.

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

Now I am beginning to freak out. I am certain I replaced the avrdude.conf with yours, and I know it's in the right place. When I rename it and run it with the -v option it fails to find a .conf file. But look what I found: :cry:

Code: Select all

#------------------------------------------------------------
# AT90s1200
#------------------------------------------------------------

part
    id               = "1200";
    desc             = "AT90S1200";
    is_at90s1200     = yes;              <-- look here!
    stk500_devcode   = 0x33;
    avr910_devcode   = 0x13;
    signature        = 0x1e 0x90 0x01;
Here are the first few lines I copied from the file to which you linked (I downloaded it again just to be sure I wasn't looking at a different file).

Code: Select all

# $Id: avrdude.conf.in 1012 2011-09-15 14:57:51Z joerg_wunsch $ -*- text -*-
#
# AVRDUDE Configuration File
#
# This file contains configuration data used by AVRDUDE which 
This is not my first foray into software development. I did this for a living for more years than I care to discuss. And of course every time I had an intractable problem someone would peer over my shoulder for 5 seconds and say something like "is that a lower case L or a 1?" :oops:

So who out there wants to take me, my laptop and my Gemmas in for a day or so and help me get this working? I have nothing to offer in return except grief. I have an angry crowd gathering on my front lawn, carrying torches and demanding blinky things.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

What happens if you delete that line?

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

Nothing. So what version of the config file are you using? can I get it directly from you?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

This is straight off of my XP machine. I zipped up both avrdude.conf and added avrdude.exe for good measure. Don't replace your avrdude.exe unless you have to.
Attachments
avrdude.zip
(174.75 KiB) Downloaded 41 times

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

Good news/bad news: No unrecognized characters but

Code: Select all

avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed, win error: The device does not recognize the command.

 (expected 4, got -5)

avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed, win error: The device does not recognize the command.
over and over.

I searched my entire hard drive for wayward copies of avrdude.exe and .conf, renamed or deleted all of them except the one in the winavr bin directory. When I ran the IDE it complained it couldn't find the .conf file in the IDE's bin directory, so I copied it to there. That says to me the IDE is not calling the avrdude.exe in the winavr directory, but the one in the IDE's installation directory is right version too, and since the program's so small I don't think it matters which version is being called (5.11 addresses a max executable size, right?).

I guess I have to ask what''s next to try?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

If you set the 'Verbose Upload" preference in the IDE, you can see which avrdude and avrdude.conf is being used.

Also, did you edit the chip erase delay down to 400000? I don't think I had to do that on my box.

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

I am looking at one of my Gemmas, and it's running blink! I have to admit I was beginning to think I would never get this working, but thanks to your seemingly infinite patience I expect clear sailing from here on in. The last step that got me there was changing the chip_erase_delay.

I can't thank you and the entire Adafruit team enough for making it possible for me to buy more Gemmas. You guys rock, and it's got nothing to do with the fact that my son is part of your team :twisted:

Here's an idea for a new product: Infinite Patience Skill Badge. If you make it, I'll buy you, Mike and the rest of the support team one.

Can you tell I'm happy?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

Hey, we're both happy! I think you've earned an Infinite Patience badge yourself - I was expecting you to blow up long ago.

There's something about Windows - some people have no problems with this at all. Other people have to be more ...um ... persuasive with it. Your experience has been way out on the far end of the persuasion spectrum.

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

I'm extremely persistent. That's not the same as being patient LOL. I think I spoke just a little soon about clear sailing. Although I did get blink running, I still get this:

Code: Select all

Binary sketch size: 832 bytes (of a 5,310 byte maximum)

avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning.

(edit) I whined about not getting anything working, but I had a bad clip lead, so that part's gone.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

So, where are you at now? Your NeoPixels are working?

User avatar
Barry914
 
Posts: 448
Joined: Sun Dec 08, 2013 1:26 pm

Re: What next?

Post by Barry914 »

Yes and no. I have a fully functional Gemma-based earring driving a 16 pixel ring. I added a button so I can change the brightness, wheel direction and speed. That's the good news. The not-so-good news is that I have some rings that failed while running strandtest for a short time. I posted this to the Administrative forum and I assume it will be taken care of. More good (or maybe bad) news is I am obsessed and need to order more Gemmas and rings.

Here's the code I'm running.

Code: Select all

// Low power NeoPixel earrings.  Makes a nice blinky display
// with just a few LEDs on at any time...uses MUCH less juice than
// rainbow display!  Has two animation effects - random flashes and
// a rotating wheel.
// Adafruit example code modified by Barry Rutkin to add features:
// Change brightness, wheel speed and wheel rotation with a
// a pushbutton connected to an input pin and ground.  Short press 
// changes brightness in 4 steps, long press toggles wheel animation 
// speed and direction.
// This will run on a Flora, or a Gemma or Trinket. A 150 mAh battery
// will run a Flora for about 5 hours at the lowest brightness setting.
// Thanks to adafruit_support_mike for the rotate right code that 
// generates the colors.

#include <Adafruit_NeoPixel.h>

#define pixelPin 1
#define buttonPin 2
#define bpNumSteps 4
#define brightnessIncrement 254/bpNumSteps
#define numPixels 16
#define wheelShort 25
#define wheelLong 60

Adafruit_NeoPixel ring = Adafruit_NeoPixel(numPixels, pixelPin);
uint8_t  mode   = 0;     // Current animation effect
uint8_t  offset = 0;     // Position of spinny eyes
long color  = 0xfd9100;  // Start yellow
long prevTime;
uint8_t button = HIGH;
uint8_t bpStep = 0;
uint8_t lastButtonState = HIGH;
uint8_t buttonState = HIGH;
long lastDebounceTime;
long buttonPressStartTime;
long lasttime;
uint8_t val;
long wheelDelay = wheelLong;
uint8_t wheelRotation = 1;
uint8_t lpState = 0;

void setup() 
{
  ring.begin();
  ring.setBrightness(brightnessIncrement); // Initially 1/4 brightness
  pinMode(buttonPin, INPUT_PULLUP);
  prevTime = millis(); // avoid a large random number on startup
  lasttime = millis();
}

void loop() 
{
  uint8_t  i;
   
  switch(mode) 
  {
   case 0: // Random sparks - just one LED on at a time!
    i = random(numPixels);
    ring.setPixelColor(i, color);
    ring.show();
    delay(10);
    ring.setPixelColor(i, 0);
    break;
 
   case 1: // Spinny wheels (4 LEDs on at a time)
    for(i=0; i < numPixels; i++) 
    {
      uint32_t c = 0;
      if(((offset + i) & 7) < 2) c = color; // 4 pixels on...
        if (wheelRotation)
        {
          ring.setPixelColor(i, c); // First earring
        }
        else
        {
          ring.setPixelColor((numPixels -1) - i, c); // Second earring can be flipped
        }
    }
    ring.show();
    offset++;
    delay(wheelDelay);
    break;
  }

  if((millis() - prevTime) > 8000) // Every 8 seconds...
  {
    prevTime = millis();
    mode++;                        // Next mode
    if(mode > 1)                   // End of modes?
    {
      mode = 0;                    // Start modes over
      color = (color >> 1) | ((color & 1) << 23); // Rotate right one bit
    }

    for(i = 0; i <numPixels; i++) ring.setPixelColor(i, 0);  // Turn them off
  }
  
  val = buttonpress();
  switch (val) 
  {
    case 0:    // nothing to do
      break;
      
     case 1:    // a short button press detected
       if (bpStep++ == bpNumSteps -1) bpStep = 0;
       ring.setBrightness((bpStep + 1) * brightnessIncrement);
       break;
      
     case 2:    // long button press detected
       switch (lpState)
       {
         case 0:
         if (wheelDelay == wheelLong)
         {
           lpState++;
           wheelDelay = wheelShort;
         }
         else
         {
           lpState++;
           wheelDelay = wheelLong;
         }
         break;
         
         case 1:
           lpState = 0;
           wheelRotation = !wheelRotation;
           break;
    }
  }  
}

/*
buttonpress() debounces a pushbutton and returns
  0 if the button was not depressed,
  1 if a short button press was detected, or
  2 if a long button press was detected
*/

int buttonpress() 
{
#define debounceDelay 50
#define longPressTime 1000

  
  int retVal = 0;
  static int button;
  static int lastButtonState = HIGH;
  static int buttonState = HIGH;
  static long lastDebounceTime;
  static long buttonPressStartTime;
  
  button = digitalRead(buttonPin);  // read the button pin
  if (button != lastButtonState)   // if the button state has changed
  {
    lastDebounceTime = millis();   // reset the debounce timer
  }  
  if ((millis() - lastDebounceTime) > debounceDelay)  // check if button has been stable for debounceDelay mS
  {
    if (button != buttonState)      // this starts the processing of a debounced state change
    {
      buttonState = button;
      if (buttonState == HIGH) // the button has just been released
      {
        if (millis() - buttonPressStartTime >= longPressTime) 
        { 
          retVal = 2;  // a long press has been detected
        }
        else 
        {
          retVal = 1;  // otherwise it was a short press
        }
      }
      else   // the button has just been pressed
      {
        buttonPressStartTime = millis();  // start timing how long the button is depressed
      }
    }    
  }  // This ends processing of a debounced state change
  lastButtonState = button;
  return(retVal);
}

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: What next?

Post by adafruit_support_rick »

I see that. They'll get all that straightened out for you. Good to see you up and running otherwise! :D

Locked
Please be positive and constructive with your questions and comments.

Return to “Administrative (closed)”