<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.lvl1.org/index.php?action=history&amp;feed=atom&amp;title=Pseudo-Medical_Monitor_Code_AMG_STUFF</id>
	<title>Pseudo-Medical Monitor Code AMG STUFF - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.lvl1.org/index.php?action=history&amp;feed=atom&amp;title=Pseudo-Medical_Monitor_Code_AMG_STUFF"/>
	<link rel="alternate" type="text/html" href="http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;action=history"/>
	<updated>2026-11-10T23:36:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;diff=14901&amp;oldid=prev</id>
		<title>Unknown user: Blanked the page</title>
		<link rel="alternate" type="text/html" href="http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;diff=14901&amp;oldid=prev"/>
		<updated>2021-12-14T20:45:33Z</updated>

		<summary type="html">&lt;p&gt;Blanked the page&lt;/p&gt;
&lt;a href=&quot;http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;amp;diff=14901&amp;amp;oldid=14832&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
	<entry>
		<id>http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;diff=14832&amp;oldid=prev</id>
		<title>Unknown user at 22:56, 11 December 2021</title>
		<link rel="alternate" type="text/html" href="http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;diff=14832&amp;oldid=prev"/>
		<updated>2021-12-11T22:56:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:56, 11 December 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l135&quot;&gt;Line 135:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 135:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Pseudo-Medical_Monitor_Code#Custom_Includes]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
	<entry>
		<id>http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;diff=14831&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot; &lt;nowiki&gt;  #define AMG_INT_PIN 5  //low range of the sensor (this will be blue on the screen) #define MINTEMP 20  //high range of the sensor (this will be red on the screen) #...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.lvl1.org/index.php?title=Pseudo-Medical_Monitor_Code_AMG_STUFF&amp;diff=14831&amp;oldid=prev"/>
		<updated>2021-12-11T22:56:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; &amp;lt;nowiki&amp;gt;  #define AMG_INT_PIN 5  //low range of the sensor (this will be blue on the screen) #define MINTEMP 20  //high range of the sensor (this will be red on the screen) #...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define AMG_INT_PIN 5&lt;br /&gt;
&lt;br /&gt;
//low range of the sensor (this will be blue on the screen)&lt;br /&gt;
#define MINTEMP 20&lt;br /&gt;
&lt;br /&gt;
//high range of the sensor (this will be red on the screen)&lt;br /&gt;
#define MAXTEMP 28&lt;br /&gt;
&lt;br /&gt;
//the colors we will be using&lt;br /&gt;
const uint16_t camColors[] = {0x480F,&lt;br /&gt;
                              0x400F, 0x400F, 0x400F, 0x4010, 0x3810, 0x3810, 0x3810, 0x3810, 0x3010, 0x3010,&lt;br /&gt;
                              0x3010, 0x2810, 0x2810, 0x2810, 0x2810, 0x2010, 0x2010, 0x2010, 0x1810, 0x1810,&lt;br /&gt;
                              0x1811, 0x1811, 0x1011, 0x1011, 0x1011, 0x0811, 0x0811, 0x0811, 0x0011, 0x0011,&lt;br /&gt;
                              0x0011, 0x0011, 0x0011, 0x0031, 0x0031, 0x0051, 0x0072, 0x0072, 0x0092, 0x00B2,&lt;br /&gt;
                              0x00B2, 0x00D2, 0x00F2, 0x00F2, 0x0112, 0x0132, 0x0152, 0x0152, 0x0172, 0x0192,&lt;br /&gt;
                              0x0192, 0x01B2, 0x01D2, 0x01F3, 0x01F3, 0x0213, 0x0233, 0x0253, 0x0253, 0x0273,&lt;br /&gt;
                              0x0293, 0x02B3, 0x02D3, 0x02D3, 0x02F3, 0x0313, 0x0333, 0x0333, 0x0353, 0x0373,&lt;br /&gt;
                              0x0394, 0x03B4, 0x03D4, 0x03D4, 0x03F4, 0x0414, 0x0434, 0x0454, 0x0474, 0x0474,&lt;br /&gt;
                              0x0494, 0x04B4, 0x04D4, 0x04F4, 0x0514, 0x0534, 0x0534, 0x0554, 0x0554, 0x0574,&lt;br /&gt;
                              0x0574, 0x0573, 0x0573, 0x0573, 0x0572, 0x0572, 0x0572, 0x0571, 0x0591, 0x0591,&lt;br /&gt;
                              0x0590, 0x0590, 0x058F, 0x058F, 0x058F, 0x058E, 0x05AE, 0x05AE, 0x05AD, 0x05AD,&lt;br /&gt;
                              0x05AD, 0x05AC, 0x05AC, 0x05AB, 0x05CB, 0x05CB, 0x05CA, 0x05CA, 0x05CA, 0x05C9,&lt;br /&gt;
                              0x05C9, 0x05C8, 0x05E8, 0x05E8, 0x05E7, 0x05E7, 0x05E6, 0x05E6, 0x05E6, 0x05E5,&lt;br /&gt;
                              0x05E5, 0x0604, 0x0604, 0x0604, 0x0603, 0x0603, 0x0602, 0x0602, 0x0601, 0x0621,&lt;br /&gt;
                              0x0621, 0x0620, 0x0620, 0x0620, 0x0620, 0x0E20, 0x0E20, 0x0E40, 0x1640, 0x1640,&lt;br /&gt;
                              0x1E40, 0x1E40, 0x2640, 0x2640, 0x2E40, 0x2E60, 0x3660, 0x3660, 0x3E60, 0x3E60,&lt;br /&gt;
                              0x3E60, 0x4660, 0x4660, 0x4E60, 0x4E80, 0x5680, 0x5680, 0x5E80, 0x5E80, 0x6680,&lt;br /&gt;
                              0x6680, 0x6E80, 0x6EA0, 0x76A0, 0x76A0, 0x7EA0, 0x7EA0, 0x86A0, 0x86A0, 0x8EA0,&lt;br /&gt;
                              0x8EC0, 0x96C0, 0x96C0, 0x9EC0, 0x9EC0, 0xA6C0, 0xAEC0, 0xAEC0, 0xB6E0, 0xB6E0,&lt;br /&gt;
                              0xBEE0, 0xBEE0, 0xC6E0, 0xC6E0, 0xCEE0, 0xCEE0, 0xD6E0, 0xD700, 0xDF00, 0xDEE0,&lt;br /&gt;
                              0xDEC0, 0xDEA0, 0xDE80, 0xDE80, 0xE660, 0xE640, 0xE620, 0xE600, 0xE5E0, 0xE5C0,&lt;br /&gt;
                              0xE5A0, 0xE580, 0xE560, 0xE540, 0xE520, 0xE500, 0xE4E0, 0xE4C0, 0xE4A0, 0xE480,&lt;br /&gt;
                              0xE460, 0xEC40, 0xEC20, 0xEC00, 0xEBE0, 0xEBC0, 0xEBA0, 0xEB80, 0xEB60, 0xEB40,&lt;br /&gt;
                              0xEB20, 0xEB00, 0xEAE0, 0xEAC0, 0xEAA0, 0xEA80, 0xEA60, 0xEA40, 0xF220, 0xF200,&lt;br /&gt;
                              0xF1E0, 0xF1C0, 0xF1A0, 0xF180, 0xF160, 0xF140, 0xF100, 0xF0E0, 0xF0C0, 0xF0A0,&lt;br /&gt;
                              0xF080, 0xF060, 0xF040, 0xF020, 0xF800,&lt;br /&gt;
                             };&lt;br /&gt;
&lt;br /&gt;
Adafruit_AMG88xx amg;&lt;br /&gt;
unsigned long delayTime;&lt;br /&gt;
&lt;br /&gt;
#define AMG_COLS 8&lt;br /&gt;
#define AMG_ROWS 8&lt;br /&gt;
float pixels[AMG_COLS * AMG_ROWS];&lt;br /&gt;
bool AMG_first_pass = true;&lt;br /&gt;
&lt;br /&gt;
#define INTERPOLATED_COLS 24&lt;br /&gt;
#define INTERPOLATED_ROWS 24&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
float get_point(float *p, uint8_t rows, uint8_t cols, int8_t x, int8_t y);&lt;br /&gt;
void set_point(float *p, uint8_t rows, uint8_t cols, int8_t x, int8_t y, float f);&lt;br /&gt;
void get_adjacents_1d(float *src, float *dest, uint8_t rows, uint8_t cols, int8_t x, int8_t y);&lt;br /&gt;
void get_adjacents_2d(float *src, float *dest, uint8_t rows, uint8_t cols, int8_t x, int8_t y);&lt;br /&gt;
float cubicInterpolate(float p[], float x);&lt;br /&gt;
float bicubicInterpolate(float p[], float x, float y);&lt;br /&gt;
void interpolate_image(float *src, uint8_t src_rows, uint8_t src_cols,&lt;br /&gt;
                       float *dest, uint8_t dest_rows, uint8_t dest_cols);&lt;br /&gt;
&lt;br /&gt;
bool setup_AMG()&lt;br /&gt;
{&lt;br /&gt;
  if (!amg.begin()) &lt;br /&gt;
    {&lt;br /&gt;
      Serial.println(&amp;quot;Could not find a valid AMG88xx sensor, check wiring!&amp;quot;);&lt;br /&gt;
      return(false);&lt;br /&gt;
    }&lt;br /&gt;
  return(true);    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void AMG_Reset()&lt;br /&gt;
{&lt;br /&gt;
  AMG_first_pass = true;  &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void drawpixels(int x_offset, int y_offset, float *p, uint8_t rows, uint8_t cols, uint8_t block_Width, uint8_t block_Height) &lt;br /&gt;
{&lt;br /&gt;
  int colorTemp;&lt;br /&gt;
  &lt;br /&gt;
  for (int y = 0; y &amp;lt; rows; y++) &lt;br /&gt;
  {&lt;br /&gt;
    for (int x = 0; x &amp;lt; cols; x++) &lt;br /&gt;
    {&lt;br /&gt;
      float val = get_point(p, rows, cols, x, y);&lt;br /&gt;
      &lt;br /&gt;
      if (val &amp;gt;= MAXTEMP) &lt;br /&gt;
        colorTemp = MAXTEMP;&lt;br /&gt;
       else &lt;br /&gt;
        if (val &amp;lt;= MINTEMP) &lt;br /&gt;
          colorTemp = MINTEMP;&lt;br /&gt;
         else &lt;br /&gt;
          colorTemp = val;&lt;br /&gt;
&lt;br /&gt;
      uint8_t colorIndex = map(colorTemp, MINTEMP, MAXTEMP, 0, 255);&lt;br /&gt;
      colorIndex = constrain(colorIndex, 0, 255);&lt;br /&gt;
      //draw the pixels!&lt;br /&gt;
      uint16_t color;&lt;br /&gt;
      color = val * 2;&lt;br /&gt;
      DrawScreenBlock(x_offset + (block_Width * x), y_offset + (((rows-1)  - y) * block_Height), block_Width, block_Height, camColors[colorIndex]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int AMG_x_offset = 44;&lt;br /&gt;
int AMG_y_offset = 0;&lt;br /&gt;
int AMG_x_width = 74;&lt;br /&gt;
int AMG_y_height = 74;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void AMG_Frame()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  int AMG_box_top = AMG_y_offset;&lt;br /&gt;
  int AMG_box_left = AMG_x_offset;&lt;br /&gt;
&lt;br /&gt;
  int AMG_box_width = AMG_x_width;&lt;br /&gt;
  int AMG_box_height = AMG_y_height;&lt;br /&gt;
  &lt;br /&gt;
  int block_size = 3;&lt;br /&gt;
  &lt;br /&gt;
  //read all the pixels&lt;br /&gt;
  amg.readPixels(pixels);&lt;br /&gt;
  float dest_2d[INTERPOLATED_ROWS * INTERPOLATED_COLS];&lt;br /&gt;
  int32_t t = millis();&lt;br /&gt;
  interpolate_image(pixels, AMG_ROWS, AMG_COLS, dest_2d, INTERPOLATED_ROWS, INTERPOLATED_COLS);&lt;br /&gt;
  if (AMG_first_pass)&lt;br /&gt;
    {&lt;br /&gt;
      DrawScreenCompartment(AMG_box_left, AMG_box_top, AMG_box_width, AMG_box_height, COMMON_BLACK, COMMON_ORANGE);&lt;br /&gt;
      AMG_first_pass = false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  drawpixels(AMG_box_left+1,AMG_box_top+1,dest_2d, INTERPOLATED_ROWS, INTERPOLATED_COLS, block_size, block_size);  &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>