CSC270 Combined Display

From CSclasswiki
Jump to: navigation, search


Work in Progress Combination Setup













Debugging Code for Communication

//Raspberry Pi

#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <wiringSerial.h>
#include <time.h>

int serial_port;
int count = 0;
//char s[5];

void setup(){
  wiringPiSetup();
  serial_port = serialOpen("/dev/arduino", 9600);
  delay(5000);
}

void loop(){
  //sprintf(s, "%04d", count);
  count++;
  char c = (char) count;
  serialPutchar(serial_port, c);
  printf("sent %d\n", count);
  delay(1000);
}

int main(){
  setup();
  while(1){
    loop();
  }
  return 0;
}