Adafruit Industries, Unique & fun DIY electronics and kits Adafruit Trinket - Mini Microcontroller - 5V Logic ID: 1501 - Deprecation Warning: The Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Trinket so that people can maintain some older projects, we no longer recommend it. The final random drawing for Hackaday’s Trinket Everyday Carry Contest was held tonight, and the winner is flaminggoat with Trinket Pocket IR Analyser/Transmitter! In addition to having an.
The final random drawing for Hackaday’s Trinket Everyday Carry Contest was held tonight, and the winner is [flaming_goat] with Trinket Pocket IR Analyser/Transmitter!
In addition to having an awesome username, [flaming_goat] loves IR protocols. Trinket Pocket IR Analyser/Transmitter is a standalone device to read, analyze and transmit Infrared (IR) signals. The IR portion of the project is handled by a Vishay TSOP38238 (PDF link) The 382 series is a 3 pin module. It comes in several variants, each tuned to a specific carrier frequency. The 38238 will decode IR signals at 38 kHz.
The demodulated IR signals are fed into the Pro Trinket, where they can be analyzed. Data is either sent through the serial terminal or displayed on the on-board 1.44″ TFT LCD. Source code for the whole project is up on [flaming_goat’s] GitHub repo.
[flaming_goat] will be receiving a Teensy 3.1 and an Audio+SD adapter from The Hackaday Store. If the Pro Trinket is a gateway drug, then Teensy 3.1 is the hardcore stuff. Powered by a Freescale Kinetis ARM Cortex M4 processor in a tiny package, the Teensy 3.1 packs quite a punch. You might think all that power would mean complex tools, but Teensy 3.1 is still easy to program using the Arduino IDE. The Audio+SD adapter board gives Teensy 3.1 the ability to create some pretty decent audio, thanks to the Teensy Audio Library.
This was the last weekly drawing for the Trinket Everyday Carry Contest, but there is still time to enter and win the big prizes! The deadline is January 3 at 12am PDT. That’s just about 3 days to enter – so procrastinators, get in the game!
PermalinkJoin GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
![Software Software](/uploads/1/2/5/8/125840509/601555825.jpg)
Find file Copy path
Cannot retrieve contributors at this time
![Adafruit Trinket Software Serial Finder Adafruit Trinket Software Serial Finder](/uploads/1/2/5/8/125840509/206978819.jpg)
/* |
TrinketFakeUsbSerial allows the user to use a serial terminal to communicate with the Trinket directly via USB. This depends on several pieces of host-side software to be installed first. |
Usage is similar to HardwareSerial, except that task() should be called at least once every 10 ms, or call a function that uses task(), such as available(), or send something. Basically, let the computer know that the Trinket is alive at least once every 10 ms. |
See tutorial at http://learn.adafruit.com/trinket-fake-usb-serial |
Copyright (c) 2013 Adafruit Industries |
All rights reserved. |
TrinketFakeUsbSerial is free software: you can redistribute it and/or modify |
it under the terms of the GNU Lesser General Public License as |
published by the Free Software Foundation, either version 3 of |
the License, or (at your option) any later version. |
TrinketFakeUsbSerial is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with TrinketFakeUsbSerial. If not, see |
<http://www.gnu.org/licenses/>. |
*/ |
#include'TrinketFakeUsbSerial.h' |
#include'TrinketFakeUsbSerialC.h' |
#include<stdint.h> |
#include'usbdrv/usbdrv.h' |
TrinketFakeUsbSerial::TrinketFakeUsbSerial(void) |
{ |
// empty constructor |
} |
voidTrinketFakeUsbSerial::begin(unsignedlong x) |
{ |
// baud rate ignored |
begin(); |
} |
voidTrinketFakeUsbSerial::begin(void) |
{ |
usbBegin(); |
} |
voidTrinketFakeUsbSerial::task(void) |
{ |
usbPollWrapper(); |
} |
size_tTrinketFakeUsbSerial::write(uint8_t d) |
{ |
tfus_tx(d); |
return1; |
} |
intTrinketFakeUsbSerial::available(void) |
{ |
task(); |
return (TFUS_RX_BUFFER_SIZE + tfus_rx_buffer_write - tfus_rx_buffer_read) % TFUS_RX_BUFFER_SIZE; |
} |
voidTrinketFakeUsbSerial::flush(void) |
{ |
task(); |
tfus_rx_buffer_write = tfus_rx_buffer_write = 0; |
} |
intTrinketFakeUsbSerial::peek(void) |
{ |
usbPollWrapper(); |
if ((TFUS_RX_BUFFER_SIZE + tfus_rx_buffer_write - tfus_rx_buffer_read) % TFUS_RX_BUFFER_SIZE <= 0) { |
return -1; |
} |
return tfus_rx_buffer[tfus_rx_buffer_read]; |
} |
intTrinketFakeUsbSerial::read(void) |
{ |
usbPollWrapper(); |
if ((TFUS_RX_BUFFER_SIZE + tfus_rx_buffer_write - tfus_rx_buffer_read) % TFUS_RX_BUFFER_SIZE <= 0) { |
return -1; |
} |
int r = tfus_rx_buffer[tfus_rx_buffer_read]; |
tfus_rx_buffer_read = (tfus_rx_buffer_read + 1) % TFUS_RX_BUFFER_SIZE; |
return r; |
} |
voidTrinketFakeUsbSerial::end(void) |
{ |
// drive both USB pins low to disconnect |
usbDeviceDisconnect(); |
tfus_rx_buffer_write = tfus_rx_buffer_write = 0; |
} |
TrinketFakeUsbSerial::operatorbool() { |
usbPollWrapper(); |
returntrue; |
} |
TrinketFakeUsbSerial TFUSerial; // instance that the user can use |
Copy lines Copy permalink