![]() You should then pop the Trinket into the 170pt breadboard. Align it so that the USB port hangs over one edge, although we won’t be programming the Trinket over USB it’s a handy source of power. Once you’ve got the Trinket set up on your breadboard you need to make the power and SPI connections to it from your Raspberry Pi GPIO header. If you’re doing this on a breadboard you’ll need 6 female-to-male jump leads power, ground, mosi, miso, clock, reset. Colour Code It’s a good idea to stick with red/black wire for power/ground and pick separate colours for serial and SPI.įirst connect GPIO 8 on your Raspberry Pi to the Reset pin on the Trinket. GPIO 8 is the second to bottom most pin on the right of the Pi GPIO header. These three pins are known as MOSI, MISO and SCK - these catchy names stand for “Master Out, Slave In”, “Master In, Slave Out” and “Clock.” Next you will need to connect up the pins that do the programming. When connecting the Trinket, which is our slave device, we want to connect these to SPI In, SPI Out and SPI Clock. ![]() If you’re following, that’s MOSI on the Pi to the second pin down on the right of the Trinket and then work your way through MISO and SCK on the Pi, and down on the Trinket- the pins are in the same order.įinally, connect the power and ground connections. These are next to each other on the top left of the Trinket ( the USB port is on the top ). ![]() I suggest using the 3.3v Power and Ground pins towards the bottom of the Pi header, since these are both comfortably close to the SPI pins you’ll be using, and a safe distance from the 5v pin. Next, you can compile and upload the Blink sketch that we’ve provided in the GitHub repo: cd examples/blink To do this run: avrdude -c gpio -p attiny85Īnd you should see something like: avrdude: AVR device initialized and ready to accept instructions To test that you’ve connected the Trinket up correctly, you can ask avrdude to look for it. ![]() To get you started, we’ve included some example code in the GitHub repository that should compile and upload straight onto your Trinket. These include an i2c NeoPixel driver, basic reading-writing of the EEPROM ( the Trinkets non-volatile memory ), Serial and a standard Blink. You might notice that all of these examples include a header file, that’s the file ending with ”.h” void setup() #Adafruit trinket 5v pinout serial# ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |