You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CubeSatSim/stempayload/PayloadOK_STM32_PC13.ino

29 lines
728 B

// code for STM32F104C on the CubeSat Simulator STEM Payload board
// answers "OK" on the serial port when queried by the Pi
int counter = 0;
void setup() {
Serial1.begin(9600);
pinMode(PC13, OUTPUT);
digitalWrite(PC13, LOW); // turn the LED on
delay(50); // wait for a second
digitalWrite(PC13, HIGH); // turn the LED off
}
void loop() {
if (Serial1.available() > 0) {
digitalWrite(PC13, LOW); // turn the LED on
delay(50); // wait for a second
digitalWrite(PC13, HIGH); // turn the LED off
char result = Serial1.read();
// Serial1.println(result);
Serial1.println("OK");
// Serial1.println(counter++);
}
delay(100);
}

Powered by TurnKey Linux.