├── .gitattributes
├── .gitignore
├── README.md
├── controller
├── .ccsproject
├── .cdtbuild
├── .cdtproject
├── .launches
│ └── controller.launch
├── .project
├── CapacitiveTouchLibrary
│ ├── CTS_HAL.c
│ ├── CTS_HAL.h
│ ├── CTS_Layer.c
│ ├── CTS_Layer.h
│ ├── structure.c
│ └── structure.h
├── MSP430G2452.ccxml
├── lnk_msp430g2452.cmd
└── src
│ ├── i2c.c
│ ├── i2c.h
│ ├── main.c
│ ├── wheel.c
│ └── wheel.h
├── kinematicstest
├── Makefile
├── common.h
├── derivative.c
├── kinematics.cpp
├── kinematics.h
└── main.cpp
├── mbed-stepper
├── common.h
├── kinematics.cpp
├── kinematics.h
├── main.cpp
├── mbed.lib
├── patterns.cpp
├── patterns.h
├── plan-position.cpp
├── plan-position.h
├── stepper.cpp
└── stepper.h
├── mbed
├── common.h
├── dials.cpp
├── dials.h
├── i2c.cpp
├── i2c.h
├── main.cpp
├── mbed.lib
├── patterns.c
├── patterns.cpp
├── patterns.h
├── planner.cpp
├── planner.h
├── positioner.cpp
├── positioner.h
├── servo.cpp
└── servo.h
├── pythagoras_android
├── .classpath
├── .project
├── AndroidManifest.xml
├── bin
│ ├── classes.dex
│ ├── com
│ │ └── aaronbot3000
│ │ │ └── pythagorasandroid
│ │ │ ├── R$attr.class
│ │ │ ├── R$drawable.class
│ │ │ ├── R$id.class
│ │ │ ├── R$layout.class
│ │ │ ├── R$string.class
│ │ │ ├── R.class
│ │ │ ├── StageOne$ButtonCallback.class
│ │ │ ├── StageOne$SeekbarChangeCallback.class
│ │ │ └── StageOne.class
│ └── resources.ap_
├── default.properties
├── gen
│ ├── com
│ │ └── aaronbot3000
│ │ │ └── pythagorasandroid
│ │ │ └── R.java
│ └── org
│ │ └── opencv
│ │ └── R.java
├── proguard.cfg
├── res
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-ldpi
│ │ └── icon.png
│ ├── drawable-mdpi
│ │ └── icon.png
│ ├── layout
│ │ └── main.xml
│ └── values
│ │ └── strings.xml
└── src
│ └── com
│ └── aaronbot3000
│ └── pythagorasandroid
│ └── StageOne.java
├── solidworks_models
├── #4 Screw.sldprt
├── 4-40_125_screw.sldprt
├── 4-40_14_screw.sldprt
├── 4-40_38_screw.sldprt
├── 4-40_nut.sldprt
├── 4-40_nut_wide.sldprt
├── 4-40_spacer.sldprt
├── arm.sldasm
├── balljoint.sldasm
├── balljoint_ball.sldprt
├── balljoint_joint.sldprt
├── baseplate.sldprt
├── cut_prep.dxf
├── cut_prep.sldasm
├── cut_prep.slddrw
├── elbow.sldasm
├── elbow_rod.sldprt
├── hand.sldasm
├── hand_base.sldprt
├── knife.sldprt
├── lower_arm.sldprt
├── pen.sldprt
├── robot.sldasm
├── servo.sldprt
├── servo_cover.sldprt
├── servo_with_horn.sldasm
├── servohorn1.sldprt
├── servohorn2.sldprt
├── servohorn3.sldprt
├── shaft_collar.sldprt
├── support.sldasm
├── support_lower.sldprt
├── support_upper.sldprt
├── upperarm.sldprt
├── wrist.sldasm
└── wrist_connector.sldprt
├── solidworks_models_v2
├── 4-40_12_screw.sldprt
├── 4-40_38_screw.sldprt
├── 4-40_nut.sldprt
├── 4-40_nut_wide.sldprt
├── 4-40_spacer.sldprt
├── M3-6_screw.sldprt
├── arm_collar.dxf
├── arm_collar.slddrw
├── arm_collar.sldprt
├── arm_lower.sldasm
├── arm_lower_rod.sldprt
├── arm_upper.sldprt
├── arm_upper_complete.sldasm
├── balljoint.sldasm
├── balljoint_ball.sldprt
├── balljoint_joint.sldprt
├── baseplate.sldprt
├── cut_parts_14.dxf
├── cut_parts_14.sldasm
├── cut_parts_14.slddrw
├── cut_parts_18.dxf
├── cut_parts_18.sldasm
├── cut_parts_18.slddrw
├── elbow.sldasm
├── elbow_rod.sldprt
├── gear.sldprt
├── gear_pot.sldprt
├── gear_stepper.sldprt
├── gusset_assm.dxf
├── gusset_assm.sldasm
├── gusset_assm.slddrw
├── gusset_plate.sldprt
├── hand.sldasm
├── hand_base.sldprt
├── motor_plate.sldprt
├── motor_plate_support.sldprt
├── new_support.sldasm
├── new_support_lower.sldprt
├── new_support_upper.sldprt
├── pen holder.sldprt
├── potentiometer.sldprt
├── potentiometer2.sldprt
├── robot.sldasm
├── robot_base.sldasm
├── stepper.sldprt
├── support.sldasm
├── support_lower.sldprt
├── support_support.dxf
├── support_support.sldprt
├── support_upper.sldprt
├── upperarm.sldprt
├── wrist.sldasm
└── wrist_connector.sldprt
├── sympy_scripts
├── inv_kinematics.py
├── inv_kinematics_plain.py
├── resolved_rate.py
└── test_idea.py
├── vectorizer-cpp
├── Makefile
└── send-serial.cpp
└── vectorizer
├── lena.bmp
├── rasterize.py
├── send-serial.py
└── vectorize.py
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sld* -text
2 | *.dxf -text
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | *.pyc
3 | *.class
4 | *.apk
5 | *.gch
6 | *.out
7 | .metadata
8 | ~*
9 | *~
10 | controller/Debug/*
11 | controller/Release/*
12 | controller/.settings*
13 | controller/.launches*
14 | pythagoras/Debug/*
15 | pythagoras/Release/*
16 | pythagoras/.settings*
17 | pythagoras/.launches*
18 | vectorizer/*.jpg
19 | vectorizer/*.png
20 | vectorizer/*.gif
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Pythagoras, the Drawing Delta Robot
2 | ===================================
3 |
4 | By Aaron Fan
5 |
6 | A drawing delta robot with edge detecting vectorizing software. Read more at:
7 |
8 | http://aaronbot3000.blogspot.com/p/pythagoras.html
9 |
--------------------------------------------------------------------------------
/controller/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/controller/.cdtbuild:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
17 |
18 |
19 |
22 |
23 |
24 |
27 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
62 |
63 |
64 |
67 |
68 |
69 |
72 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
89 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/controller/.cdtproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/controller/.launches/controller.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/controller/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | controller
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.cdt.core.cnature
16 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
17 | org.eclipse.cdt.core.ccnature
18 | com.ti.ccstudio.managedbuild.core.ccsNature
19 |
20 |
21 |
--------------------------------------------------------------------------------
/controller/CapacitiveTouchLibrary/CTS_HAL.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | *
3 | * CTS_HAL.h
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in the
14 | * documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * Neither the name of Texas Instruments Incorporated nor the names of
18 | * its contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | *
33 | ******************************************************************************/
34 |
35 | /***************************************************************************//**
36 | * @file CTS_HAL.h
37 | *
38 | * @brief
39 | *
40 | * @par Project:
41 | * MSP430 Capacitive Touch Library
42 | *
43 | * @par Developed using:
44 | * IAR Version : 5.10.6 [Kickstart] (5.10.6.30180)
45 | * CCS Version : 4.2.1.00004, w/support for GCC extensions (--gcc)
46 | *
47 | *
48 | * @version 1.0.0 Initial Release
49 | *
50 | * @par Supported Hardware Configurations:
51 | * - TI_CTS_RO_COMPAp_TA0_WDTp_HAL()
52 | * - TI_CTS_fRO_COMPAp_TA0_SW_HAL()
53 | * - TI_CTS_fRO_COMPAp_SW_TA0_HAL()
54 | * - TI_CTS_RO_COMPAp_TA1_WDTp_HAL()
55 | * - TI_CTS_fRO_COMPAp_TA1_SW_HAL()
56 | * - TI_CTS_RC_PAIR_TA0_HAL()
57 | * - TI_CTS_RO_PINOSC_TA0_WDTp_HAL()
58 | * - TI_CTS_RO_PINOSC_TA0_HAL()
59 | * - TI_CTS_fRO_PINOSC_TA0_SW_HAL()
60 | * - TI_CTS_RO_COMPB_TA0_WDTA_HAL()
61 | * - TI_CTS_RO_COMPB_TA1_WDTA_HAL()
62 | * - TI_CTS_fRO_COMPB_TA0_SW_HAL()
63 | * - TI_CTS_fRO_COMPB_TA1_SW_HAL()
64 | ******************************************************************************/
65 |
66 | #ifndef CAP_TOUCH_HAL
67 | #define CAP_TOUCH_HAL
68 |
69 | #include "structure.h"
70 |
71 | void TI_CTS_RO_COMPAp_TA0_WDTp_HAL(const struct Sensor *, uint16_t *);
72 |
73 | void TI_CTS_fRO_COMPAp_TA0_SW_HAL(const struct Sensor *, uint16_t *);
74 |
75 | void TI_CTS_fRO_COMPAp_SW_TA0_HAL(const struct Sensor *, uint16_t *);
76 |
77 | void TI_CTS_RO_COMPAp_TA1_WDTp_HAL(const struct Sensor *, uint16_t *);
78 |
79 | void TI_CTS_fRO_COMPAp_TA1_SW_HAL(const struct Sensor *, uint16_t *);
80 |
81 | void TI_CTS_RC_PAIR_TA0_HAL(const struct Sensor *, uint16_t *);
82 |
83 | void TI_CTS_RO_PINOSC_TA0_WDTp_HAL(const struct Sensor *, uint16_t *);
84 |
85 | void TI_CTS_RO_PINOSC_TA0_HAL(const struct Sensor *, uint16_t *);
86 |
87 | void TI_CTS_fRO_PINOSC_TA0_SW_HAL(const struct Sensor *, uint16_t *);
88 |
89 | void TI_CTS_RO_COMPB_TA0_WDTA_HAL(const struct Sensor *, uint16_t *);
90 |
91 | void TI_CTS_fRO_COMPB_TA0_SW_HAL(const struct Sensor *, uint16_t *);
92 |
93 | void TI_CTS_RO_COMPB_TA1_WDTA_HAL(const struct Sensor *, uint16_t *);
94 |
95 | void TI_CTS_fRO_COMPB_TA1_SW_HAL(const struct Sensor *, uint16_t *);
96 |
97 | #endif
98 |
--------------------------------------------------------------------------------
/controller/CapacitiveTouchLibrary/CTS_Layer.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | *
3 | * CTS_HAL.h
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in the
14 | * documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * Neither the name of Texas Instruments Incorporated nor the names of
18 | * its contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | *
33 | ******************************************************************************/
34 |
35 | /***************************************************************************//**
36 | * @file CTS_Layer.h
37 | *
38 | * @brief
39 | *
40 | * @par Project:
41 | * MSP430 Capacitive Touch Library
42 | *
43 | * @par Developed using:
44 | * IAR Version : 5.10.6 [Kickstart] (5.10.6.30180)
45 | * CCS Version : 4.2.1.00004, w/support for GCC extensions (--gcc)
46 | *
47 | *
48 | * @version 1.0.0 Initial Release
49 | *
50 | * @par Supported API Calls:
51 | * - TI_CAPT_Init_Baseline()
52 | * - TI_CAPT_Update_Baseline()
53 | * - TI_CAPT_Reset_Tracking()
54 | * - TI_CAPT_Update_Tracking_DOI()
55 | * - TI_CAPT_Update_Tracking_Rate()
56 | * - TI_CAPT_Update_Baseline()
57 | * - TI_CAPT_Raw()
58 | * - TI_CAPT_Custom()
59 | * - TI_CAPT_Button()
60 | * - TI_CAPT_Buttons()
61 | * - TI_CAPT_Slider()
62 | * - TI_CAPT_Wheel()
63 | ******************************************************************************/
64 |
65 | #ifndef CTS_LAYER
66 | #define CTS_LAYER
67 |
68 | #include "CTS_HAL.h"
69 |
70 | //! \name Status Register Definitions
71 | //! @{
72 | //
73 | //! (bit 0): Event Flag: this indicates that a threshold crossing occured
74 | #define EVNT 0x01
75 | //! (bit 1): Direction of Interest: This indicates if the measurement is looking
76 | //! for an increasing (set) or decreasing (clr) capacitance.
77 | #define DOI_MASK 0x02
78 | #define DOI_INC 0x02
79 | #define DOI_DEC 0x00
80 | //! (bit 2): Past Event Flag: this indicates that a prior element within the
81 | //! sensor group has detected a threshold crossing
82 | #define PAST_EVNT 0x04
83 | //! (bits 4-5): Tracking Rate in Direction of Interest: this indicates at what
84 | //! rate the baseline will adjust to the current measurement when the
85 | //! when the measurement is changing in the direction of interst but does not
86 | //! result in a threshold crossing:
87 | //! \n Very Slow
88 | //! \n Slow
89 | //! \n Medium
90 | //! \n Fast
91 | #define TRIDOI_VSLOW 0x00
92 | #define TRIDOI_SLOW 0x10
93 | #define TRIDOI_MED 0x20
94 | #define TRIDOI_FAST 0x30
95 | //! (bits 5-6): Tracking Rate Against Direction of Interest: this indicates at
96 | //! what rate the baseline will adjust to the current measurement when the
97 | //! when the measurement is changing against the direction of interst:
98 | //! \n Fast
99 | //! \n Medium
100 | //! \n Slow
101 | //! \n Very Slow
102 | #define TRADOI_FAST 0x00
103 | #define TRADOI_MED 0x40
104 | #define TRADOI_SLOW 0x80
105 | #define TRADOI_VSLOW 0xC0
106 |
107 | //! @}
108 |
109 |
110 | // API Calls
111 | void TI_CAPT_Init_Baseline(const struct Sensor*);
112 | void TI_CAPT_Update_Baseline(const struct Sensor*, uint8_t);
113 |
114 | void TI_CAPT_Reset_Tracking(void);
115 | void TI_CAPT_Update_Tracking_DOI(uint8_t);
116 | void TI_CAPT_Update_Tracking_Rate(uint8_t);
117 |
118 | void TI_CAPT_Raw(const struct Sensor*, uint16_t*);
119 |
120 | void TI_CAPT_Custom(const struct Sensor *, uint16_t*);
121 |
122 | uint8_t TI_CAPT_Button(const struct Sensor *);
123 | const struct Element * TI_CAPT_Buttons(const struct Sensor *);
124 | uint16_t TI_CAPT_Slider(const struct Sensor*);
125 | uint16_t TI_CAPT_Wheel(const struct Sensor*);
126 |
127 | // Internal Calls
128 | uint8_t Dominant_Element (const struct Sensor*, uint16_t*);
129 |
130 | #endif
131 |
--------------------------------------------------------------------------------
/controller/CapacitiveTouchLibrary/structure.c:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | *
3 | * structure.c
4 | *
5 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | *
14 | * Redistributions in binary form must reproduce the above copyright
15 | * notice, this list of conditions and the following disclaimer in the
16 | * documentation and/or other materials provided with the
17 | * distribution.
18 | *
19 | * Neither the name of Texas Instruments Incorporated nor the names of
20 | * its contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | *
36 | ******************************************************************************/
37 | //******************************************************************************
38 | // structure.c
39 | //
40 | // 4 elements configured as a wheel.
41 | // 1 element configured as a button. [Center Button]
42 | // 1 element configured as a proximity sensor.
43 | // This file contains the structure names and the variable assingments.
44 | //
45 | // Revision 1.00 Baseline
46 | // Developed with IAR 5.10.4 [Kickstart] (5.10.4.30168)
47 | //
48 | // 09/24/10 Rev1.00 Pre-Alpha Version. Added "max_cnts" slider variable in
49 | // CT_Handler object.
50 | //
51 | // 09/29/10 0.02 Update naming convention for elements and sensors.
52 | //
53 | // 10/11/10 0.03 Update
54 | //
55 | //******************************************************************************
56 |
57 | #include "structure.h"
58 |
59 | //PinOsc Volume down P2.2
60 | const struct Element volume_down = {
61 |
62 | .inputPxselRegister = (uint8_t *)&P2SEL,
63 | .inputPxsel2Register = (uint8_t *)&P2SEL2,
64 | .inputBits = BIT2,
65 | // measured for a 1Mhz SMCLK
66 | .maxResponse = 121+655, // actual measure was 980
67 | .threshold = 121
68 |
69 | };
70 |
71 | //PinOsc forward right P2.3
72 | const struct Element right = {
73 |
74 | .inputPxselRegister = (uint8_t *)&P2SEL,
75 | .inputPxsel2Register = (uint8_t *)&P2SEL2,
76 | .inputBits = BIT3,
77 | // 1Mhz SMCLK
78 | .maxResponse = 113+655,
79 | .threshold = 113
80 | };
81 |
82 | //PinOsc Volume up, P2.4
83 | const struct Element volume_up = {
84 |
85 | .inputPxselRegister = (uint8_t *)&P2SEL,
86 | .inputPxsel2Register = (uint8_t *)&P2SEL2,
87 | .inputBits = BIT4,
88 | // 1Mhz SMCLK
89 | .maxResponse = 118+655,
90 | .threshold = 118
91 | };
92 |
93 | //PinOsc reverse left P2.1
94 | const struct Element left = {
95 |
96 | .inputPxselRegister = (uint8_t *)&P2SEL,
97 | .inputPxsel2Register = (uint8_t *)&P2SEL2,
98 | .inputBits = BIT1,
99 | // 1Mhz SMCLK
100 | .maxResponse = 111+655,
101 | .threshold = 111
102 | };
103 |
104 | //PinOsc Wheel: middle button P2.5
105 | const struct Element middle_element = {
106 |
107 | .inputPxselRegister = (uint8_t *)&P2SEL,
108 | .inputPxsel2Register = (uint8_t *)&P2SEL2,
109 | .inputBits = BIT5,
110 | // When using an abstracted function to measure the element
111 | // the 100*(maxResponse - threshold) < 0xFFFF
112 | // ie maxResponse - threshold < 655
113 | .maxResponse = 350+655,
114 | .threshold = 350
115 | };
116 |
117 | //PinOsc proximity: P2.0
118 | const struct Element proximity_element = {
119 |
120 | .inputPxselRegister = (uint8_t *)&P2SEL,
121 | .inputPxsel2Register = (uint8_t *)&P2SEL2,
122 | .inputBits = BIT0,
123 | .maxResponse = 200,
124 | .threshold = 130
125 | };
126 |
127 | //*** CAP TOUCH HANDLER *******************************************************/
128 | // This defines the grouping of sensors, the method to measure change in
129 | // capacitance, and the function of the group
130 |
131 | const struct Sensor wheel =
132 | {
133 | //.halDefinition = fRO_PINOSC_TA0_SW,
134 | .halDefinition = RO_PINOSC_TA0_WDTp,
135 | .numElements = 4,
136 | .points = 64,
137 | .sensorThreshold = 75,
138 | .baseOffset = 0,
139 | // Pointer to elements
140 | .arrayPtr[0] = &volume_up, // point to first element
141 | .arrayPtr[1] = &right,
142 | .arrayPtr[2] = &volume_down,
143 | .arrayPtr[3] = &left,
144 | // Timer Information
145 | //.measGateSource= GATE_WDT_SMCLK, // 0->SMCLK, 1-> ACLK
146 | //.accumulationCycles= WDTp_GATE_32768 //32768
147 | .accumulationCycles= WDTp_GATE_8192 // 8192
148 | //.accumulationCycles= WDTp_GATE_512 //512
149 | //.accumulationCycles= WDTp_GATE_64 //64
150 | //.accumulationCycles = 32
151 | };
152 |
153 | const struct Sensor middle_button =
154 | {
155 | .halDefinition = RO_PINOSC_TA0_WDTp,
156 | .numElements = 1,
157 | .baseOffset = 4,
158 | // Pointer to elements
159 | .arrayPtr[0] = &middle_element, // point to first element
160 | // Timer Information
161 | .measGateSource= GATE_WDT_SMCLK, // 0->SMCLK, 1-> ACLK
162 | //.accumulationCycles= WDTp_GATE_32768 //32768
163 | .accumulationCycles= WDTp_GATE_8192 // 8192
164 | //.accumulationCycles= WDTp_GATE_512 //512
165 | //.accumulationCycles= WDTp_GATE_64 //64
166 | };
167 |
168 | const struct Sensor proximity_sensor =
169 | {
170 | .halDefinition = RO_PINOSC_TA0_WDTp,
171 | .numElements = 1,
172 | .baseOffset = 5,
173 | // Pointer to elements
174 | .arrayPtr[0] = &proximity_element, // point to first element
175 | // Timer Information
176 | .measGateSource= GATE_WDT_SMCLK, // 0->SMCLK, 1-> ACLK
177 | //.accumulationCycles= WDTp_GATE_32768 //32768
178 | .accumulationCycles= WDTp_GATE_8192 // 8192
179 | //.accumulationCycles= WDTp_GATE_512 //512
180 | //.accumulationCycles= WDTp_GATE_64 //64
181 | };
182 |
--------------------------------------------------------------------------------
/controller/CapacitiveTouchLibrary/structure.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronbot3000/deltadraw/ea16c73fc33f5fe422921deabf831bd977202c64/controller/CapacitiveTouchLibrary/structure.h
--------------------------------------------------------------------------------
/controller/MSP430G2452.ccxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/controller/lnk_msp430g2452.cmd:
--------------------------------------------------------------------------------
1 | /******************************************************************************/
2 | /* lnk_msp430g2452.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2452 PROGRAMS */
3 | /* */
4 | /* Usage: lnk430 -o -m