Testing parallel-to-serial converter with Arduino

This is a debug program to test parallel-to-serial converter.

int dataPin = 2;
int clockPin = 3;
int count = 0;

void setup() {
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);

  pinMode(dataPin, INPUT);
  Serial.begin(9600); //digital pins 1 and 0  
  Serial.println("Program start...");

  word dataa = word(B11000100,B11000000);

  digitalWrite(4, bitRead(dataa,15));
  digitalWrite(5, bitRead(dataa,14));
  digitalWrite(6, bitRead(dataa,13));
  digitalWrite(7, bitRead(dataa,12));
  digitalWrite(8, bitRead(dataa,11));
  digitalWrite(9, bitRead(dataa,10));
  digitalWrite(10, bitRead(dataa,9));
  digitalWrite(11, bitRead(dataa,8));
  digitalWrite(12, bitRead(dataa,7));
  digitalWrite(13, bitRead(dataa,6));

  // For noise suppression, enable pullup on interrupt pin
  digitalWrite(clockPin, HIGH);
  attachInterrupt(digitalPinToInterrupt(clockPin), kello, RISING);

void loop() {
  if (count >= 16) {
    Serial.println(""); //add linefeed
    count = 0;

void kello() {
  count = count + 1;  


Leave a Reply