Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Receive a Byte from Serial and push it to Port B
- /* controlling pins on a port via Serial */
- char incomingByte = 0; // character for incoming serial data
- void setup() {
- Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
- DDRB= B00111111; //Set Port B as output (Pins 8 to 13) The two MSB pins are for Xtal and unusable
- }
- void loop() {
- // Listen for incoming Serial data:
- if (Serial.available() > 0) {
- // read the incoming byte:
- incomingByte = Serial.read();//Read from Serial Port
- PORTB=incomingByte; //output data to Port B
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement