Pseudo-Medical Monitor Code CONFIGURATION STUFF: Difference between revisions

From LVL1
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
  <nowiki>
   
<nowiki>


char * I2C_Device_Name(int I2C_Bus, byte I2C_Address)
char * I2C_Device_Name(int I2C_Bus, byte I2C_Address)
Line 48: Line 49:
int CNFG_y_height = 160;
int CNFG_y_height = 160;


void ConfigurationMainUnit()
{
  byte error, address;
  int nDevices;
  int box_top = CNFG_y_offset;
  int box_bottom = box_top + CNFG_y_height;
 
  int box_left = CNFG_x_offset;
  int box_right = box_left + CNFG_x_width;
 
  int box_width = CNFG_x_width;
  int box_height = CNFG_y_height;
  int I2C_text_y_offset = 20;
  int text_x_offset = 5;
  int text_y_offset = 10;
  int text_y_spacing = 8;


  char I2CLabel[16]="--------------";
 
  DrawScreenCompartment(box_left,box_top,box_width,box_height,COMMON_BLUE,COMMON_WHITE);
  DrawScreenText(box_left+20,box_top+4,"Main Unit",COMMON_YELLOW,COMMON_BLUE);


  DrawScreenText(box_left+10,I2C_text_y_offset,"I2C Scan...",COMMON_YELLOW,COMMON_BLUE);
  DrawScreenText(box_left+10,box_top+I2C_text_y_offset+8,"HEX",COMMON_YELLOW,COMMON_BLUE);
  DrawScreenText(box_left+40,box_top+I2C_text_y_offset+8,"Device",COMMON_YELLOW,COMMON_BLUE);
 
  nDevices = 0;
  for(address = 1; address < 127; address++ )
    {
      Wire.beginTransmission(address);
      error = Wire.endTransmission();


 


  </nowiki>
  </nowiki>


[[Pseudo-Medical_Monitor_Code#Custom_Includes]]
[[Pseudo-Medical_Monitor_Code#Custom_Includes]]

Revision as of 19:03, 11 December 2021

char * I2C_Device_Name(int I2C_Bus, byte I2C_Address) { switch(I2C_Address) { case 0x26: if (I2C_Bus == 0) return("????"); if (I2C_Bus == 1) return("ECG w/ NPXL"); break; case 0x29: return("VL53L0X"); break; case 0x57: return("MAX30102"); break; case 0x5A: return("MLX9164"); break; case 0x68: if (I2C_Bus == 0) return("????"); if (I2C_Bus == 1) return("MPU6050 R"); break; case 0x69: if (I2C_Bus == 0) return("AMG8833"); if (I2C_Bus == 1) return("MPU6050 G"); break; case 0x70: return("TCA9548A"); case 0x38: return("PCF8574"); break; default: return("????"); break; } } int CNFG_x_offset = 0; int CNFG_y_offset = 0; int CNFG_x_width = 128; int CNFG_y_height = 160;

Pseudo-Medical_Monitor_Code#Custom_Includes