0

Programming the Trinket
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Programming the Trinket

by Thrivenrg on Wed Sep 13, 2017 12:54 pm

Ok I bought a bunch of these little guys to perform all sorts of stuff for my companies development. Creating little timer modules is the biggest job we want them for as time functions hold thing up in core software.

So now I have timer code set up and ready to go. But now I cant figure out how to program this little guy. So here is where Im at.

Plugged the Trinket in to the pc, driver has loaded fine.

Ive gone in and selected USBtinyISP from the programmer in the tools menu.

Under Boards in the tools Menu, I have " Arduino Gemma" selected

In the Tools Menu "port" is grayed out. Question: Is there supposed to be a port available using this configuration?

Before I upload I press the button on the board and it goes dim initially and then pulses afterward.

So with no port selected as there is not an option available; Ive tried to upload and I get an error.

"avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)"


I am running an older version of the Arduino IDE I think; its version 1.6.7

My PC is running window 8.1 and does not have USB 3.0 ports they are 2.0 versions.

My code:


Code: Select all | TOGGLE FULL SIZE
int InputPin = analogRead(0);    // select the input pin for the potentiometer

int OutputPin = 3;      // select the pin for the LED
int sensorValue=0;  // variable to store the value coming from the sensor

int InputState = 0;


void setup()
{
  // declare the ledPin as an OUTPUT:
  pinMode(OutputPin, OUTPUT);
  pinMode(InputPin, INPUT);
}

void timer1(){

  InputState = digitalRead(InputPin);


        int timer1_value = (50);
        for (int i = timer1_value; i >= 0; i--){ //Begin the loop

            delay(100);
        }
    }
void timer2(){


                         
        int timer2_value = (1);
        for (int i = timer2_value; i >= 0; i--){ //Begin the loop

            delay(100);
        }
    }

void loop() {
 
    if (InputState == HIGH){
  digitalWrite(OutputPin, LOW);
 timer1();
  digitalWrite(OutputPin, HIGH);
timer2();                 
}
else{
  digitalWrite(OutputPin, HIGH);
}
 
}

Thrivenrg
 
Posts: 6
Joined: Wed Oct 12, 2016 11:13 pm

Re: Programming the Trinket

by franklin97355 on Wed Sep 13, 2017 1:22 pm

Select the Trinket in the boards menu. The instructions are in the tutorial.

franklin97355
 
Posts: 16532
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Programming the Trinket

by franklin97355 on Wed Sep 13, 2017 1:22 pm

Select the Trinket in the boards menu. The instructions are in the tutorial.

franklin97355
 
Posts: 16532
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Programming the Trinket

by Thrivenrg on Wed Sep 13, 2017 1:27 pm

There is not an option for that

Thrivenrg
 
Posts: 6
Joined: Wed Oct 12, 2016 11:13 pm

Re: Programming the Trinket

by Thrivenrg on Wed Sep 13, 2017 1:31 pm

franklin97355 wrote:Select the Trinket in the boards menu. The instructions are in the tutorial.


This is not a tutorial its the description page to purchase this.

Edit: its the introduction page it does not have instruction to upload from the Arduino IDE.

Thrivenrg
 
Posts: 6
Joined: Wed Oct 12, 2016 11:13 pm

Re: Programming the Trinket

by Thrivenrg on Wed Sep 13, 2017 1:58 pm

Here is the screen shot of the IDE and board selection.
Attachments
Arduino IDE Trinket 1.png
Arduino IDE Trinket 1.png (108.38 KiB) Viewed 95 times

Thrivenrg
 
Posts: 6
Joined: Wed Oct 12, 2016 11:13 pm

Re: Programming the Trinket

by franklin97355 on Wed Sep 13, 2017 2:14 pm

2017-09-13_11h07_18.png
2017-09-13_11h07_18.png (121.73 KiB) Viewed 94 times
Did you look at these sections?
Attachments
2017-09-13_11h04_04.png
2017-09-13_11h04_04.png (34.12 KiB) Viewed 94 times

franklin97355
 
Posts: 16532
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Programming the Trinket

by Thrivenrg on Wed Sep 13, 2017 2:38 pm

Ok Ive found the links and following instructions now. I have the baords loaded up and now working on loading the adafruit windows drivers. Ill post results here is a few, I really want this guy to work!

Cheers

Thrivenrg
 
Posts: 6
Joined: Wed Oct 12, 2016 11:13 pm

Re: Programming the Trinket

by Thrivenrg on Wed Sep 13, 2017 2:44 pm

Ok it worked, thank you for your assistance! If I run into any more walls Ill be back haha.

Cheers

Thrivenrg
 
Posts: 6
Joined: Wed Oct 12, 2016 11:13 pm

Re: Programming the Trinket

by franklin97355 on Wed Sep 13, 2017 4:27 pm

Glad I could be of assistance.

franklin97355
 
Posts: 16532
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Please be positive and constructive with your questions and comments.