-3
请帮助我将Borland C源代码转换为Python。我对任何帮助或建议转换tool..The代码我想转换非常感谢如下(这些都是脉搏血氧仪的serialcommunication参数我想进入我的树莓派)从Borland C转换为python
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 */
这段代码也不是很长,我不认为你需要一个特殊的工具。 – rlms 2014-12-06 12:48:53