Example project for the Rioux Chem control box
Rioux Chem Control Box
This is the example project for the Rioux Chem Control Box. I have posted some youtube videos to guide you through the hardware and software:
Rioux Chem Control Box - Hardware
http://www.youtube.com/watch?v=MoZ92GRYa4s
Rioux Chem Control Box - Software - Part I
http://www.youtube.com/watch?v=_MwaTLL4dyA==
Rioux Chem Control Box - Software - Part II
http://www.youtube.com/watch?v=j_P89izfgoQ
Diff: main.cpp
- Revision:
- 3:cb48919cd5e8
- Parent:
- 2:73a028278c5c
- Child:
- 7:de452fceafc1
--- a/main.cpp Mon Aug 31 13:00:37 2020 +0000
+++ b/main.cpp Thu Aug 05 02:12:29 2021 +0000
@@ -13,6 +13,7 @@
#define VT100_WHITE "\033[37;40m"
#define VT100_RESET "\033c"
+extern void WriteRAW_DAC_Value(uint8_t Channel,uint16_t Data);
int main()
{
@@ -21,91 +22,45 @@
//This function always needs called before you do anythign wit the CHEM BOX.
InitChemBox();
+ GREEN_LED = 1;
+ RED_LED = 0;
+
//Beep 6 times
for(i=0;i<6;i++)
{
Buzz(.05); //Since the Buzz function immediately returns we should wait a bit before calling it again in the loop
wait(.1); //I want a 50% duty cycle so I will wait twice as long as my previous Buzz() call
+
+ GREEN_LED = !GREEN_LED;
+ RED_LED = !RED_LED;
+
}
-
+
- //Here is an example of how to draw on the screen!
-
- //This makes the backlight white. Each color can be between 0 and 3 (integers... 0,1,2,3)
- SmartSwitch_SetBackLightColor(3, 3, 3);
-
- //The display routines are fully buffered. When you call the draw routines, the write to the backbuffer, not the screen.
- //The flow is to clear the backbuffer, call all the drawing routines, then dump the backbuffer to the screen.
-
- //This clears the back buffer
- GFX_FullDisplayBufferClear(&BackBuffer);
-
- //Draw a box around the edge of the screen
-
- GFX_DrawLine(&BackBuffer, 0,0, PHYSICAL_DISPLAY_XRES - 1,0);
- GFX_DrawLine(&BackBuffer, PHYSICAL_DISPLAY_XRES - 1,0,PHYSICAL_DISPLAY_XRES - 1 ,PHYSICAL_DISPLAY_YRES - 1);
- GFX_DrawLine(&BackBuffer, PHYSICAL_DISPLAY_XRES - 1 ,PHYSICAL_DISPLAY_YRES - 1,0,PHYSICAL_DISPLAY_YRES - 1);
- GFX_DrawLine(&BackBuffer,0, PHYSICAL_DISPLAY_YRES - 1,0,0);
-
- //Draw a plain string using the 5x7 font.
- GFX_DrawString(&BackBuffer,"Rioux Box",6,2, &Font5x7);
-
- GFX_DrawHline(&BackBuffer,0,PHYSICAL_DISPLAY_XRES - 1 ,12);
-
- //This shows how to do a printf. Using this allows you to put internal variables, etc on the screen.
- //Just lookup documentation on printf on the web to see examples of escape sequences in the control strings
- //In this example API_VERSION is a string so we use %s to display it
- GFX_printf(&BackBuffer,15,20, &Font3x5,"Ver: %s",API_VERSION);
-
- //Move the backbuffer to the actual display
- GFX_DumpRenderContextToPhysicalScreen(&BackBuffer);
-
+ GREEN_LED = 1;
+ RED_LED = 0;
//Here is the main super loop
//reset and start our control loop Timer
ControlLoopTimer.reset();
ControlLoopTimer.start();
-
+
while(1)
{
//Call this often if you want the USB interface/Terminal
ProcessTerminal();
- /*RS232_0.printf(" RUN\r");
+
+
+
+ /*
if(ControlLoopTimer.read_ms() >= 1000)
{
ControlLoopTimer.reset();
PC.printf(VT100_RESET);
-
- for(int channel=0;channel<12;channel++)
- {
- if(channel & 0x01)
- Color = VT100_CYAN;
- else
- Color = VT100_GREEN ;
-
-
- float ThermocoupleTemperature = ReadThermocouple(channel);
- float InternalReferenceTemperature = ReadInternalTemperature(channel);
-
- bool IsDisconnected = (ReadThermocouple_OC() & (1<<channel));
-
- if(IsDisconnected == true)
- {
- PC.printf(VT100_WHITE"Channel %i: ",channel);
- PC.printf(VT100_RED"disconnected\r\n");
- }
- else
- {
- PC.printf(VT100_WHITE"Channel %i: ",channel);
- PC.printf(VT100_WHITE"%s%.2f ",Color,ThermocoupleTemperature);
- PC.printf(VT100_WHITE"INT: ",channel);
- PC.printf(VT100_WHITE"%s%.2f\r\n",Color,InternalReferenceTemperature);
- }
-
- }
+
}*/
Eli Hughes

