Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Firmware/project_1/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
<option id="com.crt.advproject.link.memory.load.image.cpp.1854760230" superClass="com.crt.advproject.link.memory.load.image.cpp" value="" valueType="string"/>
<option id="com.crt.advproject.link.memory.data.cpp.326173730" superClass="com.crt.advproject.link.memory.data.cpp" value="" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.crt.advproject.link.memory.sections.cpp.50157822" superClass="com.crt.advproject.link.memory.sections.cpp" valueType="stringList"/>
<option id="com.crt.advproject.link.cpp.multicore.master.2099620977" superClass="com.crt.advproject.link.cpp.multicore.master"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2135286474" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
Expand Down Expand Up @@ -592,4 +593,5 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="openCmsis"/>
</cproject>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#MCUXpresso IDE
#Fri Oct 03 21:18:36 CDT 2025
product.name=MCUXpresso IDE v11.9.1 [Build 2170] [2024-04-19]
product.version=11.9.1
product.build=2170
2 changes: 2 additions & 0 deletions Firmware/project_1/.mcuxpressoide_packages_support/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This folder is automatically created and contains the SDK part support for the IDE
*** DO NOT REMOVE OR MODIFY, YOUR CHANGES WILL BE OVERWRITTEN ON SDK REFRESH ***
8 changes: 4 additions & 4 deletions Firmware/project_1/inc/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* You should place those definitions here.
*/

#define P_POTENTIOMETER P0_8
#ifndef MBED15X9_SKELETON_PINS_H_
#define MBED15X9_SKELETON_PINS_H_

Expand All @@ -26,7 +26,7 @@
#define P_LED3 P0_6
#define P_LED4 P0_7
// PROJECT 1 - You can define a pin macro here

#define P_LED5 P0_4
/*
* COMMON PIN OBJECT DECLARATIONS
*/
Expand All @@ -36,13 +36,13 @@ extern DigitalOut led2;
extern DigitalOut led3;
extern DigitalOut led4;
// PROJECT 1 - You can declare a DigitalOut object here

extern DigitalOut led5;
/*
* BOARD SPECIFIC PINS
*/

// PROJECT 2 - You can declare a AnalogIn object here

extern AnalogIn pot;

/*
* BOARD SPECIFIC PIN OBJECT DECLARATIONS
Expand Down
16 changes: 14 additions & 2 deletions Firmware/project_1/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <mbed.h>
// PROJECT 1 - Include something here!
#include "pins.h"
#include "setup.h"
#include "peripherals.h"
#include "can_struct.h"
#include "CAN/can_id.h"
Expand Down Expand Up @@ -86,6 +88,11 @@ int main() {
bool overflow;
uint32_t now = common.loopTime(&timing, &overflow);

//project2-declare task2rate
uint32_t TASK_2_RATE_US;
//PROJECT 2 - use the potentiometer to change the blink rate
float pot_value = pot.read();
TASK_2_RATE_US = (uint32_t)(10000+pot_value*(2000000-10000));
//clear CAN Buffer
while(!common.readCANMessage(msg)) {
//you should do something with the relevant CAN messages here
Expand All @@ -95,11 +102,16 @@ int main() {
common.toggleReceiveCANLED();
}

if(timing.tickThreshold(last_task_1_time, TASK_1_RATE_US)){
if(timing.tickThreshold(last_task_1_time, TASK_2_RATE_US)){//if project1 here would be TASK_1_RATE_US which is 1 sec
//PROJECT 1 - add code here to actually make the LED blink
if(led5.read()==0){
led5.write(1);
}
else{
led5.write(0);
}
}

//PROJECT 2 - use the potentiometer to change the blink rate


}
Expand Down
4 changes: 3 additions & 1 deletion Firmware/project_1/src/pins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

// PROJECT 2 - You can instantiate your AnalogIn object here

AnalogIn pot(P_POTENTIOMETER);
/*
* COMMON PIN OBJECT INSTANTIATIONS
*/
Expand All @@ -22,4 +22,6 @@ DigitalOut led1(P_LED1);
DigitalOut led2(P_LED2);
DigitalOut led3(P_LED3);
DigitalOut led4(P_LED4);

// PROJECT 1 - You can instantiate your DigitalOut object here
DigitalOut led5(P_LED5);
266 changes: 266 additions & 0 deletions Hardware/prog1/Title_Block.kicad_wks

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions Hardware/prog1/fp-lib-table

Large diffs are not rendered by default.

Loading