I want to make a little device that will sit on my desk and flash a red LED, and make a really annoying sound with a buzzer when someone on our team commits code that causes our test suite to fail.
I bought an Adafruit Trinket thinking it would be perfect for the project, since I really only need 3 GPIO pins (one for a green LED that will be on when the test suite isn't failing), one for the red LED, and one for the buzzer.
I got all of this working pretty easily on the UNO - I simply send a 1 over serial if the test suite is failing, and a 0 if it's not.
Unfortunately, I didn't know that the trinket doesn't support serial communication like that. I've tried the two "simple" solutions provided by Adafruit - the TrinketFakeUsbSerial, and HIDSerial. Adafruit admits that they've never tried the TrinketFakeUsbSerial on Linux (we do use linux at work), and I can't get it work for the life of me. HIDSerial never detects my trinket, and believe me, I've fiddled with both of them for hours (including downgrading gcc-avr just so it can recognize the --assembler-with-cpp flag, which is apparently just not there in the newest version).
I figured I'd ask here to see if someone might have some insight. I really only need to send an "on" or an "off" signal to the trinket somehow. A 1 or a 0, a true or a false. It could be a pin on the trinket that has power for 1, or no power for 0 (could this be possible with one of the USB pins?).
Take a look at the Digispark libraries, they mostly run on Trinket. You should be able to use SoftwareSerial, too, but I seem to remember that Digispark has a smaller lib.
Since you're only looking for an on/off response, hook up the Tx line of a TTL serial adapter to one of the trinket pins, and trigger on the line going low. Idle state for TTL serial is high, and the start bit is low, so sending any character on the serial port will do.
mrburnette:
Take a look at the Digispark libraries, they mostly run on Trinket. You should be able to use SoftwareSerial, too, but I seem to remember that Digispark has a smaller lib.
Added:
Nice thing about the Digispark is that it does give all 3 PWM signals on the t85.
Added:
Pics showing the disabling of the reset button without desoldering (unwelding?):
Simply use a watch screwdriver or probe to unspring the retainer clip. Remove the leaf contact, the domed contact, and the actuator button. Replace clip if you desire. Parts can be reassembled if necessary but you will need an HV programmer to restore the fuses.
ralphd:
Since you're only looking for an on/off response, hook up the Tx line of a TTL serial adapter to one of the trinket pins, and trigger on the line going low. Idle state for TTL serial is high, and the start bit is low, so sending any character on the serial port will do.
Hi there! Kind of new to all this but what you describe here is exactly what I need to do also. Any chance of code guidance to accomplish this?