-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard_psuedo.c
75 lines (62 loc) · 1.52 KB
/
dashboard_psuedo.c
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
===============================================================================
Name : dashboardP.c
Author : Eric Tu & Terence Cho
Version : 0.1v
Copyright : Copyright (C)
Description : main Psuodocode
===============================================================================
*/
#include <LPC11xx.h>
#include <can++.h>
#include <uart++.h>
#include "util.h"
#include <mbed.h>
#include "pins.h"
#include "peripherals.h"
#include "ltc680x.h"
#include "pitches.h"
#include "bms_defs.h"
#include "can_id.h"
void setup() {
configure_CAN();
configure_PINS(); //in another file with pins
start polling stuff (Serial);
}
void loop() {
checkAcceleratorInput;
checkSteeringWheelInput;
//Steering Wheel Actions
//LEDS
if (hazardControl) {
rightTurnLED();
leftTurnLED();
} else if (leftTurn) {
leftTurnLED();
} else if (rightTurn) {
rightTurnLED();
}
if (cruiseControl) {
cruiseControlLED();
}
//spareI/O
//GP101.8
//Accelerator Actions
if (braking) {
RegenControl(sendOutput);
} else if (acclerating) {
ForwardControl(sendOutput);
} else if (reversing) {
ReverseControl(sendOutput);
}
//ADC
//AINs
//spare steering wheel/accelerator
//Prints to Display and Debugging
print("accel: ");
print("brake: ");
print("cruise speed: ");
print("current speed: ");
print("Cruis On/Off: ");
print("Driving mode: ");
}