Please I need helpin converting a Borland C source code into Python. I be very grateful for any help or proposed conversion tool..The code I want to convert is the following (these are serialcommunication parameters of a pulse oximeter i wish to enter into my Raspberry Pi)
void decode_data(void)
{
while (!((val = getccb()) & 0x80)); /* wait for sync bit */
if (val & 0x40)
printf(“!Puls!”); /* puls trigger active */
y = getccb(); /* get plethysmogram sample */
val = getccb(); /* get pulse bar sample */
puls_hbit = (val & 0x80)?1:0; /* store bit 7 of pulse */
bar_graph = val & 0x0F; /* store bar_graph value */
printf(“Puls %03u”,0x80*puls_hbit + getccb());
/* print pulse */
printf(“SpO2 %03u”,getccb()); /* print spo2 */
}
/* getccb() returns the next serial value from a queue that gets filled during the PC´s serial interrupt */
Assuming that you already have a
getccb()function that works in Python, the translation is pretty straightforward: