Beispiel #1
0
 PyMODINIT_FUNC
 PyInit__pygit2(void)
 {
     PyObject* m;
     m = PyModule_Create(&moduledef);
     return moduleinit(m);
 }
Beispiel #2
0
 PyMODINIT_FUNC
 init_pygit2(void)
 {
     PyObject* m;
     m = Py_InitModule3("_pygit2", module_methods,
                        "Python bindings for libgit2.");
     moduleinit(m);
 }
int main() {
	int oldl = 1000, oldh = 1000, oldt = 1000;//, oldr = 1000;
	unsigned char out[4];
	unsigned char rec[5];
	unsigned char temp[2];
	moduleinit();

	while (1) {
		//receive and convert temperature
		ds1631_temp(temp);
		float c = temp[0];
		if (temp[1]) {
			c += 0.5;
		}
		float f = (9*c)/5;
		int x = f +32;

		//unsigned char rmt = rx_char();

		if (low != oldl) {
			moveto(0x45);	
			stringout("   "); //clear previous number
			moveto(0x45);
			sprintf(out, "%2d", low);
			stringout(out);
			oldl = low;
		}
		if (high != oldh) {
			moveto(0x4d);
			stringout("   ");	//clear previous number
			moveto(0x4d);
			sprintf(out, "%2d", high);
			stringout(out);
			oldh = high;
		}
		if (x != oldt) {
			moveto(5);
			stringout("   ");
			moveto(5);
			itoa(x, out, 10);
			stringout(out);
			oldt = x;
			//send temperature
			if (x > 0) {
				tx_char('+');	
			}
			else if (x < 0) {
				tx_char('-');
			}
			//if 3 digits
			if (out[2] == 0) {
				tx_char('0');
				_delay_ms(5);
				tx_char(out[0]);
				_delay_ms(5);
				tx_char(out[1]);
			}
			//if 2 digits
			else {
				tx_char(out[0]);
				_delay_ms(5);
				tx_char(out[1]);
				_delay_ms(5);
				tx_char(out[2]);
			}
		}

		//receive temperature
		if (UCSR0A & (1 << RXC0)) {
			// character has been received
			if (rx_char() == '+') {
				rec[0] = rx_char();	//100's digit
				if (rec[0] == '0') {		//if 100's digit is 0
					rec[0] = rx_char();
					rec[1] = rx_char();
					rec[2] = 0;
				}
				else {		//else reset rec[0] to 10's digit
					rec[1] = rx_char();
					rec[2] = rx_char();
					rec[3] = 0;
				}
			}
			
			else if (rx_char() == '-') {
				rec[0] = '-';
				rec[1] = rx_char();
				if (rec[1] == '0') {		//if 100's digit is 0
					rec[1] = rx_char();
					rec[2] = rx_char();
					rec[3] = 0;
				}
				else {		//else reset rec[0] to 10's digit
					rec[2] = rx_char();
					rec[3] = rx_char();
					rec[4] = 0;
				}
			}
			moveto(13);
			stringout("   ");
			moveto(13);
			stringout(rec);
		}

		if (x < low) {
			PORTD |= (1 << PD3);
		}
		else {
			PORTD &= ~(1 << PD3);
		}
		if (x > high) {
			PORTD |= (1 << PD2);
		}
		else {
			PORTD &= ~(1 << PD2);
		}
		moveto(0x50);	//move cursor off of screen
	}
	return 0;
}
PyMODINIT_FUNC
PyInit__uinput(void)
{
    return moduleinit();
}
Beispiel #5
0
PyMODINIT_FUNC
PyInit_subr(void)
{
    return moduleinit();
}
PyMODINIT_FUNC initcext(void)
{
    moduleinit();
}
Beispiel #7
0
 PyMODINIT_FUNC
 PyInit_osk(void)
 {
     return moduleinit();
 }
 PyMODINIT_FUNC init_ecos(void)
 {
   import_array(); // for numpy arrays
   moduleinit();
 }
Beispiel #9
0
 PyMODINIT_FUNC
 initlru(void)
 {
     moduleinit();
 }
Beispiel #10
0
PyMODINIT_FUNC PyInit__sky_lib(void)
{
    import_array();
    return moduleinit();
}
Beispiel #11
0
 PyMODINIT_FUNC
 PyInit_virtkey(void)
 {
     return moduleinit();
 }
Beispiel #12
0
 PyMODINIT_FUNC
 initvirtkey(void)
 {
     moduleinit();
 }
Beispiel #13
0
PyObject *PyInit__librsync(void)
{
  return moduleinit();
}
Beispiel #14
0
void init_librsync(void)
{
  moduleinit();
}
Beispiel #15
0
PyMODINIT_FUNC
initrepos(void)
{
	moduleinit();
}
Beispiel #16
0
PyMODINIT_FUNC
PyInit_repos(void)
{
	return moduleinit();
}
Beispiel #17
0
/* The init function name has to match that of the compiled module
 * with the pattern 'init<module name>'. This module is called '_sky_lib' */
PyMODINIT_FUNC init_sky_lib(void)
{
    import_array();
    moduleinit();
    return;
}
Beispiel #18
0
PyMODINIT_FUNC
PyInit_libhivexmod (void)
{
  return moduleinit ();
}
 PyMODINIT_FUNC PyInit__ecos(void)
 {
   import_array(); // for numpy arrays
   return moduleinit();
 }
Beispiel #20
0
void
initlibhivexmod (void)
{
  (void) moduleinit ();
}
/* The init function name has to match that of the compiled module
 * with the pattern 'init<module name>'. This module is called '_measurement_set_lib' */
PyMODINIT_FUNC init_measurement_set_lib(void)
{
    import_array();
    moduleinit();
    return;
}
Beispiel #22
0
init_scs_direct(void)
#endif
{
    import_array(); /* for numpy arrays */
    moduleinit();
}
Beispiel #23
0
 PyMODINIT_FUNC
 initosk(void)
 {
     moduleinit();
 }
Beispiel #24
0
PyMODINIT_FUNC PyInit__vis_block_lib(void)
{
    import_array();
    return moduleinit();
}
PyMODINIT_FUNC PyInit_cext(void)
{
    return moduleinit();
}
Beispiel #26
0
/* The init function name has to match that of the compiled module
 * with the pattern 'init<module name>'. This module is called '_vis_block_lib' */
PyMODINIT_FUNC init_vis_block_lib(void)
{
    import_array();
    moduleinit();
    return;
}
Beispiel #27
0
PyMODINIT_FUNC
initsubr(void)
{
    moduleinit();
}
Beispiel #28
0
PyMODINIT_FUNC
init_pack(void)
{
	moduleinit();
}
PyMODINIT_FUNC
init_uinput(void)
{
    moduleinit();
}
Beispiel #30
0
PyMODINIT_FUNC initcmfcc(void) {
    moduleinit();
    import_array();
}