-
Notifications
You must be signed in to change notification settings - Fork 43
Arm firmware implementation #407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TateKolton
wants to merge
24
commits into
master
Choose a base branch
from
arm-firmware-implementation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0844c36
Arm Firmware Progress
TateKolton c006f77
updated comments
TateKolton b929a07
uncommented code
TateKolton 1423da3
Updated by removing useless compiler files from firmware folder
TateKolton 586d383
Update src/firmware/arm_firmware/SerialCom1/SerialCom/Form1.cs
TateKolton 7cc105c
Update src/firmware/arm_firmware/SerialCom1/SerialCom/Form1.cs
TateKolton 68d19a5
Update src/firmware/arm_firmware/SerialCom1/SerialCom/Form1.cs
TateKolton f8d7295
Update src/firmware/arm_firmware/SerialCom1/SerialCom/Form1.cs
TateKolton 308ec3d
Update src/firmware/arm_firmware/armSketchRev3.ino
TateKolton 3dc74ad
Update src/firmware/arm_firmware/armSketchRev3.ino
TateKolton 906afe3
Added arduino sketch to a folder so it can run in IDE. Totally refact…
TateKolton df2dfb0
whoopsies, wrong pin mode
TateKolton 170c6ea
new file! for xbox control. this version has not been tested but it w…
TateKolton ea90ea5
firmware updated to include wrist motion special case
TateKolton 4ff1907
updated switch firmware
TateKolton f7e16b0
progress
TateKolton bf4197e
actual-progress
TateKolton c01198d
test
TateKolton 4ba0340
prog
TateKolton 7d98817
progress
TateKolton fbd3c36
progress
TateKolton fcb9330
updated
TateKolton 00002db
prog
TateKolton 9c5c2fa
progress
TateKolton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.31624.102 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SerialCom", "SerialCom\SerialCom.csproj", "{293C7DFD-2AF8-4E61-927A-46072A9F6182}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {293C7DFD-2AF8-4E61-927A-46072A9F6182}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {293C7DFD-2AF8-4E61-927A-46072A9F6182}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {293C7DFD-2AF8-4E61-927A-46072A9F6182}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {293C7DFD-2AF8-4E61-927A-46072A9F6182}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {D52D6B80-3854-499E-8028-35CA40DD7D18} | ||
| EndGlobalSection | ||
| EndGlobal |
649 changes: 649 additions & 0 deletions
649
src/firmware/arm_firmware/SerialCom1/SerialCom/Form1.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
257 changes: 257 additions & 0 deletions
257
src/firmware/arm_firmware/SerialCom1/SerialCom/Form1.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,257 @@ | ||
| #define CRT_SECURE_NO_WARNINGS | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel; | ||
| using System.Data; | ||
| using System.Drawing; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Windows.Forms; | ||
| using System.IO.Ports; | ||
| using System.IO; | ||
|
|
||
|
|
||
|
|
||
|
|
||
| namespace SerialCom | ||
| { | ||
|
|
||
| public partial class Form1 : Form | ||
| { | ||
|
|
||
| bool inc_flag; | ||
| bool abs_flag; | ||
|
|
||
| const int a1_max = 360; | ||
| const int a2_max = 360; | ||
| const int a3_max = 90; | ||
| const int a4_max = 90; | ||
| const int a5_max = 90; | ||
| const int a6_max = 90; | ||
|
|
||
| string dataOUT; | ||
| string homeOUT = "H"; | ||
| string moveOUT = "M"; | ||
| string inc = "I"; | ||
| string abs = "A"; | ||
| string dataIN; | ||
|
|
||
| string A1; //angles | ||
| string A2; | ||
| string A3; | ||
| string A4; | ||
| string A5; | ||
| string A6; | ||
|
|
||
| public Form1() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| private void label1_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void progressBar1_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
| private void button1_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
|
|
||
| private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void groupBox1_Enter(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void tBoxDATAOUT_TextChanged(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void Form1_Load_1(object sender, EventArgs e) | ||
| { | ||
| string[] ports = SerialPort.GetPortNames(); | ||
| cBoxCOMPORT.Items.AddRange(ports); | ||
| } | ||
|
|
||
| private void btnOPEN_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| try | ||
| { | ||
| serialPort1.PortName = cBoxCOMPORT.Text; | ||
| serialPort1.BaudRate = Convert.ToInt32(cBoxBAUDRATE.Text); | ||
| serialPort1.DataBits = Convert.ToInt32(cBoxDATABITS.Text); | ||
| serialPort1.StopBits = (StopBits)Enum.Parse(typeof(StopBits), cBoxSTOPBITS.Text); | ||
| serialPort1.Parity = (Parity)Enum.Parse(typeof(Parity), cBoxPARITYBITS.Text); | ||
|
|
||
| serialPort1.Open(); | ||
| progressBar1.Value = 100; | ||
| } | ||
| catch (Exception err) | ||
| { | ||
| MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
| } | ||
| } | ||
|
|
||
| private void button2_Click(object sender, EventArgs e) /* Close button */ | ||
| { | ||
| if(serialPort1.IsOpen) | ||
| { | ||
| serialPort1.Close(); | ||
| progressBar1.Value = 0; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| private void button3_Click(object sender, EventArgs e) /* send data button*/ | ||
| { | ||
| if (serialPort1.IsOpen) | ||
| { | ||
| dataOUT = tBoxDATAOUT.Text; | ||
|
|
||
| if (abs_flag) | ||
| { | ||
| dataOUT = abs + dataOUT; | ||
| } | ||
|
|
||
| else if(inc_flag) | ||
| { | ||
| dataOUT = inc + dataOUT; | ||
| } | ||
|
|
||
| serialPort1.WriteLine(inc+dataOUT); | ||
| tBoxDATAOUT.Text = ""; | ||
| } | ||
| } | ||
|
|
||
| private void label7_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void label6_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void absPosition_TextChanged(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
| private void label10_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void label11_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e) | ||
| { | ||
| if (serialPort1.ReadLine().Contains('r')) | ||
| { | ||
| A1 = serialPort1.ReadLine(); | ||
| A2 = serialPort1.ReadLine(); | ||
| A3 = serialPort1.ReadLine(); | ||
| A4 = serialPort1.ReadLine(); | ||
| A5 = serialPort1.ReadLine(); | ||
| A6 = serialPort1.ReadLine(); | ||
| } | ||
| } | ||
|
|
||
| private void timer1_Tick(object sender, EventArgs e) | ||
| { | ||
| label11.Text = A1; | ||
| label14.Text = A2; | ||
| label16.Text = A3; | ||
| label22.Text = A4; | ||
| label20.Text = A5; | ||
| label18.Text = A6; | ||
|
|
||
| if (A1 != null) | ||
| { | ||
| a1prog.Value = (int)((100 * Int64.Parse(A1)) / a1_max); | ||
| } | ||
| if (A2 != null) | ||
| { | ||
| a2prog.Value = (int)((100 * Int64.Parse(A2)) / a2_max); | ||
| } | ||
| if (A3 != null) | ||
| { | ||
| a3prog.Value = (int)((100 * Int64.Parse(A3)) / a3_max); | ||
| } | ||
| if (A4 != null) | ||
| { | ||
| a4prog.Value = (int)((100 * Int64.Parse(A4)) / a4_max); | ||
| } | ||
| if (A5 != null) | ||
| { | ||
| a5prog.Value = (int)((100 * Int64.Parse(A5)) / a5_max); | ||
| } | ||
| if (A6 != null) | ||
| { | ||
| a6prog.Value = (int)((100 * Int64.Parse(A6)) / a6_max); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| private void button1_Click_1(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void button1_Click_2(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void label15_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void label16_Click(object sender, EventArgs e) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| private void button1_Click_3(object sender, EventArgs e) // HOME BUTTON // | ||
| { | ||
| serialPort1.WriteLine(homeOUT); | ||
| } | ||
|
|
||
| private void btnMOVE_Click(object sender, EventArgs e) // MOTION DEMO BUTTON // | ||
| { | ||
| serialPort1.WriteLine(moveOUT); | ||
| } | ||
|
|
||
| private void btnINC_CheckedChanged(object sender, EventArgs e) | ||
| { | ||
| inc_flag = !inc_flag; | ||
| } | ||
|
|
||
| private void btnABS_CheckedChanged(object sender, EventArgs e) | ||
| { | ||
| abs_flag = !abs_flag; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Windows.Forms; | ||
|
|
||
| namespace SerialCom | ||
| { | ||
| static class Program | ||
| { | ||
| /// <summary> | ||
| /// The main entry point for the application. | ||
| /// </summary> | ||
| [STAThread] | ||
| static void Main() | ||
| { | ||
| Application.EnableVisualStyles(); | ||
| Application.SetCompatibleTextRenderingDefault(false); | ||
| Application.Run(new Form1()); | ||
| } | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
src/firmware/arm_firmware/SerialCom1/SerialCom/Properties/AssemblyInfo.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| using System.Reflection; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| // General Information about an assembly is controlled through the following | ||
| // set of attributes. Change these attribute values to modify the information | ||
| // associated with an assembly. | ||
| [assembly: AssemblyTitle("SerialCom")] | ||
| [assembly: AssemblyDescription("")] | ||
| [assembly: AssemblyConfiguration("")] | ||
| [assembly: AssemblyCompany("HP Inc.")] | ||
| [assembly: AssemblyProduct("SerialCom")] | ||
| [assembly: AssemblyCopyright("Copyright © HP Inc. 2021")] | ||
| [assembly: AssemblyTrademark("")] | ||
| [assembly: AssemblyCulture("")] | ||
|
|
||
| // Setting ComVisible to false makes the types in this assembly not visible | ||
| // to COM components. If you need to access a type in this assembly from | ||
| // COM, set the ComVisible attribute to true on that type. | ||
| [assembly: ComVisible(false)] | ||
|
|
||
| // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
| [assembly: Guid("293c7dfd-2af8-4e61-927a-46072a9f6182")] | ||
|
|
||
| // Version information for an assembly consists of the following four values: | ||
| // | ||
| // Major Version | ||
| // Minor Version | ||
| // Build Number | ||
| // Revision | ||
| // | ||
| // You can specify all the values or you can default the Build and Revision Numbers | ||
| // by using the '*' as shown below: | ||
| // [assembly: AssemblyVersion("1.0.*")] | ||
| [assembly: AssemblyVersion("1.0.0.0")] | ||
| [assembly: AssemblyFileVersion("1.0.0.0")] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.