Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Suggested changes in Module Structure and Arduino code #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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
33 changes: 33 additions & 0 deletions code/Arduino/PreciseSimpleIR.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//Authors: Pedram Shirinbolaghi and Love from CRF.
#include <Smartcar.h>
#define pin1 A0

GP2D120 rearLeftIR;
//Declare variables for filter
int value;

int lastY, Y, X;

const float alpha = 0.75;

void setup() {


Serial.begin(9600);

rearLeftIR.attach(pin1);

}

void loop() {


//Digital noise filter
Serial.print("Sensor value is ");
X = float(rearLeftIR.getDistance());

Y = (1-alpha)*lastY + alpha*X;
lastY =Y;

Serial.println(Y);
}
1 change: 1 addition & 0 deletions code/Driver/DriverExample.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the Driver module do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late response, the Driver module is from the se-research/CaroloCup repo it's the module structure of the 2016 year CaroloCup, it handles parking and obstacle-avoidance.

1 change: 1 addition & 0 deletions code/LaneDetection/LaneDetection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions code/Parking/ParkingExample.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions code/Proxy/Proxy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@