<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.penfieldrobotics.com/wiki/index.php?action=history&amp;feed=atom&amp;title=2009%3ACorrect_Dashboard_Update_Function</id>
	<title>2009:Correct Dashboard Update Function - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.penfieldrobotics.com/wiki/index.php?action=history&amp;feed=atom&amp;title=2009%3ACorrect_Dashboard_Update_Function"/>
	<link rel="alternate" type="text/html" href="https://wiki.penfieldrobotics.com/wiki/index.php?title=2009:Correct_Dashboard_Update_Function&amp;action=history"/>
	<updated>2026-04-13T13:39:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.penfieldrobotics.com/wiki/index.php?title=2009:Correct_Dashboard_Update_Function&amp;diff=1740&amp;oldid=prev</id>
		<title>Heydowns: Correct Dashboard Update Function moved to 2009:Correct Dashboard Update Function</title>
		<link rel="alternate" type="text/html" href="https://wiki.penfieldrobotics.com/wiki/index.php?title=2009:Correct_Dashboard_Update_Function&amp;diff=1740&amp;oldid=prev"/>
		<updated>2009-12-31T03:42:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/index.php?title=Correct_Dashboard_Update_Function&amp;amp;action=tinymceedit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Correct Dashboard Update Function (page does not exist)&quot;&gt;Correct Dashboard Update Function&lt;/a&gt; moved to &lt;a href=&quot;/wiki/index.php?title=2009:Correct_Dashboard_Update_Function&quot; title=&quot;2009:Correct Dashboard Update Function&quot;&gt;2009:Correct Dashboard Update Function&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:42, 30 December 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Heydowns</name></author>
	</entry>
	<entry>
		<id>https://wiki.penfieldrobotics.com/wiki/index.php?title=2009:Correct_Dashboard_Update_Function&amp;diff=500&amp;oldid=prev</id>
		<title>Angry: Initial checkin</title>
		<link rel="alternate" type="text/html" href="https://wiki.penfieldrobotics.com/wiki/index.php?title=2009:Correct_Dashboard_Update_Function&amp;diff=500&amp;oldid=prev"/>
		<updated>2009-01-14T01:20:56Z</updated>

		<summary type="html">&lt;p&gt;Initial checkin&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= This function should be used if/when WPILib is updated&amp;lt;br&amp;gt;  =&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;quot;WPILib.h&amp;quot;&lt;br /&gt;
#include &amp;quot;ThunderDrive.h&amp;quot;&lt;br /&gt;
#include &amp;quot;DashboardDataFormat.h&amp;quot;&lt;br /&gt;
#include &amp;quot;AnalogModule.h&amp;quot;&lt;br /&gt;
#include &amp;quot;DigitalModule.h&amp;quot;&lt;br /&gt;
#include &amp;quot;iomap.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	//This function requires you to modify WPIlib/DigitalModule.h and&lt;br /&gt;
	//		make m_fpgaDIO a public member instead of private.  The reason is&lt;br /&gt;
	//		that there are no publicly accessible ways of reading the value of&lt;br /&gt;
	//		a digital output or the output enables.  Exposing m_fpgaDIO lets you use&lt;br /&gt;
	//		the ChipObject functions readDI, readDO, and readOutputEnable.  The bitmasking&lt;br /&gt;
	//		of the DI and DO vectors versus the OE ensure that DIO&amp;#039;s that are not inputs are&lt;br /&gt;
	//		not falsely set because those specific bits are actually outputs, and vice versa.&lt;br /&gt;
	//		&lt;br /&gt;
	//		The same lack of ability to get() the status of the relayFWD and relayREV bits &lt;br /&gt;
	//		requires exposing m_fpgaDIO to use the readSlowValue_Relay[Fwd|Rev] function&lt;br /&gt;
void UpdateDashboard(void)&lt;br /&gt;
	{&lt;br /&gt;
		tRioStatusCode status = 0;&lt;br /&gt;
		UINT16 channum = 0;	//analog/digital channel number&lt;br /&gt;
		AnalogModule *amodule = AnalogModule::GetInstance(1);&lt;br /&gt;
		DigitalModule *dmodule = DigitalModule::GetInstance(4);&lt;br /&gt;
		for (channum = 1; channum &amp;amp;lt;= SensorBase::kAnalogChannels; channum++)&lt;br /&gt;
		{&lt;br /&gt;
			dashboardDataFormat.m_AnalogChannels[0][channum-1] = amodule-&amp;amp;gt;GetValue(channum);&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		for (channum = 1; channum &amp;amp;lt;= SensorBase::kPwmChannels; channum++)&lt;br /&gt;
		{&lt;br /&gt;
			dashboardDataFormat.m_PWMChannels[0][channum-1] = dmodule-&amp;amp;gt;GetPWM(channum);&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		unsigned short digin = 0, digout = 0, dio = 0;&lt;br /&gt;
		unsigned short dio_oe = dmodule-&amp;amp;gt;m_fpgaDIO-&amp;amp;gt;readOutputEnable(&amp;amp;amp;status);&lt;br /&gt;
		&lt;br /&gt;
		digin = dmodule-&amp;amp;gt;m_fpgaDIO-&amp;amp;gt;readDI(&amp;amp;amp;status);&lt;br /&gt;
		digin &amp;amp;amp;= ~dio_oe;&lt;br /&gt;
		digout = dmodule-&amp;amp;gt;m_fpgaDIO-&amp;amp;gt;readDO(&amp;amp;amp;status);&lt;br /&gt;
		digout &amp;amp;amp;= dio_oe;&lt;br /&gt;
		&lt;br /&gt;
		dio  = digin | digout;&lt;br /&gt;
		&lt;br /&gt;
		dashboardDataFormat.m_DIOChannels[0] = dio;	//cast from ushort to UINT16&lt;br /&gt;
		dashboardDataFormat.m_DIOChannelsOutputEnable[0] = dio_oe;	//another ushort to UINT16 cast&lt;br /&gt;
		dashboardDataFormat.m_RelayFwd[0] = dmodule-&amp;amp;gt;m_fpgaDIO-&amp;amp;gt;readSlowValue_RelayFwd(&amp;amp;amp;status);&lt;br /&gt;
		dashboardDataFormat.m_RelayRev[0] = dmodule-&amp;amp;gt;m_fpgaDIO-&amp;amp;gt;readSlowValue_RelayRev(&amp;amp;amp;status);&lt;br /&gt;
		//no solenoid feedback - we&amp;#039;re not using it.&lt;br /&gt;
		dashboardDataFormat.PackAndSend();&lt;br /&gt;
	}	&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Angry</name></author>
	</entry>
</feed>