Teensy USB & Serial????

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Teensy USB & Serial????

Postby AngrySpinach » Sat Dec 17, 2011 8:04 am

Hi,

Does anyone know if it possible to use a teensy USB to receive serial data (RS232) and then print something as a USB keyboard? If so how?

Thanks,

Sam
AngrySpinach
 
Posts: 5
Joined: Wed Dec 14, 2011 5:25 pm
Badges: Micro-controllers Skill Badge awarded to Sam Wilkinson by Adafruit

Re: Teensy USB & Serial????

Postby paulstoffregen » Sat Dec 17, 2011 11:29 am

Yes.

http://www.pjrc.com/teensy/td_uart.html

Code: Select all
// This line defines a "Uart" object to access the serial port
HardwareSerial Uart = HardwareSerial();

void setup() {
  Serial.begin(9600);
  Uart.begin(9600);
}

void loop() {
  if (Uart.available() > 0) {
    char incomingByte = Uart.read();
    Keyboard.write(incomingByte);
  }
}
paulstoffregen
 
Posts: 86
Joined: Sun Oct 11, 2009 10:23 am
Location: Portland, Oregon, USA

Re: Teensy USB & Serial????

Postby AngrySpinach » Sat Dec 17, 2011 4:20 pm

THANK YOU,

I managed to figure that out after awhile on the site. Thanks for the response.

Happy Holidays
AngrySpinach
 
Posts: 5
Joined: Wed Dec 14, 2011 5:25 pm
Badges: Micro-controllers Skill Badge awarded to Sam Wilkinson by Adafruit


Return to Microcontrollers

Who is online

Users browsing this forum: No registered users and 2 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]