<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://socialledge.com/sjsu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Proj+user22</id>
		<title>Embedded Systems Learning Academy - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://socialledge.com/sjsu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Proj+user22"/>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php/Special:Contributions/Proj_user22"/>
		<updated>2026-04-29T19:55:59Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S19:_Tech_Savy&amp;diff=61303</id>
		<title>S19: Tech Savy</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S19:_Tech_Savy&amp;diff=61303"/>
				<updated>2020-07-10T21:05:48Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Project Source Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
[[File:TechSavy_logo.jpeg| 300px |LOGO|bottom|right]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Tech Savy RC Car''' ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|[[File:CMPE243_Tech_Savy_Car_Side.jpg|300px|thumb|left|Tech_Savy Side Open view]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|[[File:CMPE243_Tech_Savy_Car_RearView.jpg|500px|thumb|center|Tech_Savy View]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|[[File:CMPE243_Tech_Savy_Car_Top_View.jpeg|300px|thumb|right|Tech_Savy Top Open view]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
In this project our main aim to build a Self-Navigating Car named Tech Savy, that navigates from a source location to a selected destination by avoiding obstacles in its path using sensors and motors.&lt;br /&gt;
&lt;br /&gt;
[[File:Car_Working.png|800px|thumb|center|Main Building Blocks of Tech Savy]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features support by the system are &lt;br /&gt;
&lt;br /&gt;
1. A Google-map based &amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Android application&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; is developed which will update the live location of RC car given by GPS to Bridge over Bluetooth.Android app is used to get information from all the Modules and will show live data of &amp;lt;B&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;MOTOR&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;SENSORS&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;GPS and COMPASS&amp;lt;/font&amp;gt;&amp;lt;/B&amp;gt; and we can set the final destination so that car can drive to the destination.&lt;br /&gt;
&lt;br /&gt;
2. The car will be integrated with the &amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;&amp;lt;B&amp;gt;GPS, Compass&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;maroon&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Bluetooth&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;, multiple sensors such as &amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Ultrasonic sensors and RPM sensors&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; to fulfill the purpose of navigation, obstacle detection, and avoidance&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;LIDAR and Ultrasonic Sensor&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; is used for obstacle detection and avoidance in all the angles in the view of 360 degrees.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Motor&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; drives the car by Route Calculation done on GPS using the shortest distance path algorithm between current location and destination and connects to the self-driving RC car via Bluetooth to send the GPS Coordinates and Maneuvering to the selected destination and Self- Adjusting the speed of the car on Ramp.&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;font color=&amp;quot;fire&amp;quot;&amp;gt;&amp;lt;B&amp;gt;LEDs and LED Display&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; are used for debugging and to get all relevant information about the status of the car, in real time and &amp;lt;font color=&amp;quot;fire&amp;quot;&amp;gt;&amp;lt;B&amp;gt;LCD Display&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; is used to give more detailed information related to the car.&lt;br /&gt;
&lt;br /&gt;
The system is built on FreeRTOS running on LPC1758 SJOne controller and Android application.&lt;br /&gt;
The main building blocks of Tech Savy are the five controllers communicating through High Speed CAN network designed to handle dedicated tasks. The controllers integrate various sensors that are used for navigation of the car. &lt;br /&gt;
&lt;br /&gt;
'''CAR Objectives'''&lt;br /&gt;
      '''1. Master Controller''' - Handles the Route Manuevering,Path Planning and Obstacle Avoidance &lt;br /&gt;
      '''2. Sensor Controller''' - Detects the surrounding objects&lt;br /&gt;
      '''3. Geo Controller''' - Provides current location in the form of coordinates and navigate car using CMPS11&lt;br /&gt;
      '''4. Motor Controller''' - controls the movement of the Car.&lt;br /&gt;
      '''5. Bridge controller''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an industrial product.&lt;br /&gt;
      '''2.''' Achieve 100% code coverage, during unit testing. &lt;br /&gt;
      '''3.''' Document and track all the bugs encountered during development, unit testing, and field testing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[ File: CmpE243_TechSavy_System_Design.png|650px|thumb|left|System Architecture]]&lt;br /&gt;
&lt;br /&gt;
[[ File: App_log.jpeg |300px|thumb|right|Android  Application]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe243_S19_TechSavy_members.jpeg|thumb|500x500px|TEAM TECH SAVY|right]]&lt;br /&gt;
&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/tech-savycmpe243/cmpe243_techsavy_rc_car Tech Savy ]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;PURPLE&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Master Controller&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Motor Controller&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[https://www.linkedin.com/in/jay-parsana-59059a860 Jay Parsana]'''''  &lt;br /&gt;
**'''''[http://linkedin.com/in/vatsal-makani-540650b2 Vatsal Makani]'''''&lt;br /&gt;
**'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Geographical Controller&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Sensor Controller&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[https://www.linkedin.com/in/halak-vyas-4646a4145 Halak Vyas]'''''&lt;br /&gt;
**'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;MAROON&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Communication Bridge Controller&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[https://www.linkedin.com/in/akshata-kulkarni-a9145b62 Akshata Kulkarni]'''''&lt;br /&gt;
**'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
**'''''[https://www.linkedin.com/in/saumil-shah-a49849166 Saumil Shah]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Android Application&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[https://www.linkedin.com/in/saumil-shah-a49849166 Saumil Shah]'''''&lt;br /&gt;
**'''''[https://www.linkedin.com/in/akshata-kulkarni-a9145b62 Akshata Kulkarni]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;fire&amp;quot;&amp;gt;&amp;lt;B&amp;gt;LCD Interfacing &amp;amp; UI Designing&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
**'''''[http://linkedin.com/in/vatsal-makani-540650b2 Vatsal Makani]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Hardware PCB Integration&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[https://www.linkedin.com/in/prashantgandhi27 Prashant Gandhi]'''''&lt;br /&gt;
**'''''[http://linkedin.com/in/vatsal-makani-540650b2 Vatsal Makani]'''''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=&amp;quot;LIGHTCORAL&amp;quot;&amp;gt;&amp;lt;B&amp;gt;Testing&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
**'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
**'''''[https://www.linkedin.com/in/jay-parsana-59059a860 Jay Parsana]'''''  &lt;br /&gt;
**'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#7acee2&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;&amp;lt;B&amp;gt; Aakash Chitroda &amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;B&amp;gt; Halak Vyas&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;B&amp;gt; Vatsal Makani&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;indianred&amp;quot;&amp;gt;&amp;lt;B&amp;gt; Vidushi Jain&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;&amp;lt;B&amp;gt; Jay Parsana&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''1''' || '''26 Feb 2019''' || '''4 March 2019''' || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Create and establish GitLab repository'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Establish slack channel and invite Preet'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Look through previous years projects and study it'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Distribute major roles among team members'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| '''2''' || '''05 March 2019''' || '''12 March 2019''' || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Create a Bill of Materials.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Select and order an RC car.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Make Repo on Gitlab for all modules - Follow Naming Convention.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed&lt;br /&gt;
|-&lt;br /&gt;
| '''3''' || '''13 March 2019'''|| '''19 March 2019''' || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Select Part Number for Sensors (Halak, Aakash)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Designing and deciding PCB tool(Prashant, Vatsal)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Finalizing GPS module by doing some research (Vidushi)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Finalize and order LCD (Aakash, Vidushi)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Finalize Motor and Order it (Vatsal)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Environmental setup of Android (Saumil, Akshata)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;Completed &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| '''4''' || '''20 March 2019'''|| '''26 March 2019'''||&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''Understand DBC and implement the DBC file compatible with all the controllers.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Test motor driving in different situations, begin to listen to CAN for controls.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''Establish communication across all the CAN controllers over CAN bus based on the DBC file.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;'''Verify the power-up interactions and configurations between Master and the other controllers.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''03/26/2019	DBC File'''&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''03/26/2019 DEMO: CAN communication between controllers.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;Completed &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| '''5''' || '''27 March 2019'''|| '''09 April 2019'''||&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;'''Check and Resolve power issue for RC Car.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;'''Finalize high-level system block diagram and control scheme.'''&amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;'''Circuit Simulation in Diptrace Tool.'''&amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;'''PCB Layout Design in Diptrace Tool.'''&amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;#148F77&amp;quot;&amp;gt;'''Finalize Components placement on PCB.'''&amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Establish a connection over Bluetooth and Android app.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Establish a communication between Bluetooth devices.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Interfacing of ultrasonic sensors to the SJOne board and check for basic functionality.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Interface and get the reading of Lidar sensor with SJOne over UART.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''Chalk out the Message IDs based on the priority of the messages and the data to be sent across nodes.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Interface of Servo &amp;amp; DC motor to the SJOne board and check for basic functionality.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Interface Compass module with SJOne board using I2C serial bus.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;MAROON&amp;quot;&amp;gt;'''Interface bluetooth HC-05 module with SJOne board using serial Communication.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;MAROON&amp;quot;&amp;gt;'''Configure bluetooth HC-05 module name as Tech Savy using HC-05 Communication Mode.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;fire&amp;quot;&amp;gt;'''Explore UI designing of LCD.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Finish motor controller API. Test motor driving in different situations, begin to listen to CAN for controls.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Add a TextView for displaying the Bluetooth connection status in Android App.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''6''' || '''10 April 2019'''|| '''16 April 2019'''|| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Parse data of Lidar Sensor depending on distance and angle and send it to master using dbc.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Implement basic obstacle avoidance algorithm based on sensor data and test the same.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Continue testing motor driver via commands from CAN bus.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Build in speed steps to reverse motor for reverse to work correctly.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Mount all the sensors and test for any dead band and modify their positions for maximum coverage.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Integrate the fusion of LIDAR and Ultrasound sensor to get overall feedback from all the directions.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Develop algorithm to avoid obstacles and plan the car's further navigation path.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Complete final prototype of the obstacle avoidance feature.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Calibrate Compass Module. Develop code for Compass module communication over CAN.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''16 April 2019 DEMO: Motors driven by wheel feedback and sensors, Basic obstacle avoidance.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Final Wiki Schedule.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
||Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''7''' || '''17 April 2019'''|| '''23 April 2019'''|| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Configure GPS device baud rate and interface it with SJOne board using UART.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Send and receive current location, destination and checkpoint coordinates to and from App and Geo module via BRIDGE.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Calibrate sensors readings and work on filtering algorithm with Master &amp;amp; Sensor'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;fire&amp;quot;&amp;gt;'''Begin work on LCD to show vehicle live status(speed, fuel-status, obstacles, distance to destination etc.) in a GUI.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''Finish implementing speed control on motor (to make sure requested speed is met based on RPM read).'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Work on Car reversing using Motor Controllers.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''Integrate all modules with the Master to test the data flow.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Validation &amp;amp; Verification of obstacle avoidance, steering logic with rear sensor inputs and reversing.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Start incorporating GEO Controller information to Master module Steering logic.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;maroon&amp;quot;&amp;gt;'''Decide, implement and test data exchange between Geo Controller and BRIDGE.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Calculate and send simple bearing angle and destination status on CAN to figure out initial challenges.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Add a Google Map for setting the car's destination.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Send car location to app and check points received to Geo module.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;maroon&amp;quot;&amp;gt;'''Verify the stringent requirement of Start-up Sync, Periodic heart-beat messages.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Update Wiki Schedule with Test Reports.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;In Progress &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''8''' || '''24 April 2019'''|| '''30 April 2019'''|| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;fire&amp;quot;&amp;gt;'''Testing &amp;amp; Validation of the LCD UI and display run time vehicle status and looking forward for feedback from team if any.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Improve &amp;amp; Validate Navigation logic with multiple checkpoints, bearing angle and destination information.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Identify and mitigate GPS locking, Location Accuracy and Number of Satellite-In-View coming.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Validate Accuracy of Compass Calibration with iPhone Compass.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;'''Determine and add DBC Changes and finalized.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Implement the steering logic with bearing angle and status provided by GEO-Module.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Consistently Communicate current car location to App, get check points from App and relay them to Geo module.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;MAROON&amp;quot;&amp;gt;'''Send additional vehicle status information from can bus to the App for display.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;'''Send the request to Google for getting the checkpoints(use the Google Maps Directions API).'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Field test and check for obvious issues in obstacle avoidance, navigation, maintaining speed (up/down hill).'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Provide feed backs to each team on identified short comings.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Update Wiki with new details and information.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''DEMO: GPS driving'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|| Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''9''' || '''1 May 2019'''|| '''7 May 2019'''|| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''FIELD TESTING - CRITICAL WEEK '''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''Implement turning indicators, break lights and head light.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Check for Corner cases for steering logic under various conditions and locations.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;'''Analyse field test results for GPS and CMPS and work on it if required.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''Test the accuracy of check-points from the Blue-tooth controller, location data from the Geo-controller sensor and Navigation Algorithm.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Check overall robustness of the complete system.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Establish complete connection on PCB'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Update wiki with details.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
||Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''10''' || '''8 May 2019'''|| '''21 May 2019'''|| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''All hands on testing and final bug fixes.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Check for tuning or calibration of modules if required.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Complete end-to-end testing for various scenarios and conditions.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Create the semester long project activity video and upload to YouTube.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;'''Update and finalize wiki.'''&amp;lt;/font&amp;gt;&lt;br /&gt;
||Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed  &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''11''' || '''22 May 2019'''||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''DEMO: Final Project '''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''SUBMISSION: Final Project Wiki'''&amp;lt;/font&amp;gt;&lt;br /&gt;
||Completed &amp;lt;br&amp;gt; Completed &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''BILL OF MATERIALS (GENERAL PARTS)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''Micro-Controller Eval-Boards'''&lt;br /&gt;
| &lt;br /&gt;
* LPC 1758 '''(Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 5&lt;br /&gt;
|&lt;br /&gt;
* 80.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''RC Car'''&lt;br /&gt;
|&lt;br /&gt;
*  [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd Traxxas 1/10 Slash 2WD RTR with 2.4GHz Radio]&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 205.99&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''Lithium-Ion Battery'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/Traxxas-7600mAh-7-4V-2-Cell-Battery/dp/B00S1R0VEY/ref=sr_1_7?s=toys-and-games&amp;amp;ie=UTF8&amp;amp;qid=1474748332&amp;amp;sr=1-7&amp;amp;keywords=traxxas+battery Traxxas 7600mAh 7.4V 2-Cell 25C LiPo Battery]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 74.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''Lithium-Ion Battery 2'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/Traxxas-11-1V-5000mAh-3-Cell-Battery/dp/B07D691FPT Traxxas 2872X 5000mAh 11.1V 3S 25C LiPo Battery]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 69.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''RC Car Battery Charger'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Amazon Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''Bluetooth Breakout Board'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05 Bluetooth Module HC-05]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 8.49&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''RC Car Display'''&lt;br /&gt;
| &lt;br /&gt;
* [http://www.4dsystems.com.au/product/uLCD_32PTU/ 4D systems 4D systems LCD Display]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 79.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''Ultrasonic Sensors'''&lt;br /&gt;
| &lt;br /&gt;
* [http://www.robotshop.com/en/maxbotix-ez0-ultrasonic-ranger.html LV Maxsonar EZ0 &amp;amp; Ultrasonic sensors]&lt;br /&gt;
| &lt;br /&gt;
* 2&lt;br /&gt;
| &lt;br /&gt;
* 30.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''RP-LIDAR Sensor'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull LIDAR Sensor]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 99.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''GPS Antenna'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/SaferCCTV-Coaxial-Pigtail-Connector-Transmitter/dp/B06WCZ9JPL/ref=sr_1_4?keywords=GPS+Antenna+PCIe&amp;amp;qid=1557263057&amp;amp;s=gateway&amp;amp;sr=8-4 Amazon]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 5.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''CAN Transreceivers'''&lt;br /&gt;
| &lt;br /&gt;
* [http://www.microchip.com/samples/Default.aspx?DeviceFamily=MCP2551 Microchip Samples]&lt;br /&gt;
| &lt;br /&gt;
* 20&lt;br /&gt;
| &lt;br /&gt;
* FREE&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''Compass'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.dfrobot.com/product-1275.html DFRobot CMPS11 Compass]&lt;br /&gt;
| &lt;br /&gt;
* 2&lt;br /&gt;
| &lt;br /&gt;
* 30.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''RPM Sensor'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM Amazon RPM Sensor]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 10.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''GPS Breakout Board'''&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM Amazon GPS Module]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 43.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''PCB parts and other Miscellaneous parts'''&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 130.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''PCB Fabrication'''&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
We designed the custom PCB using DipTrace Software in which we implemented connections for all the controller modules(SJOne Board LPC1758) all communicating/sending data via CAN bus. The data is sent by individual sensors to the respective controllers. GPS and Compass are connected to Geographical Controller. RPM sensor, DC and Servo Motors are connected to Motor Controller. Ultrasonic and Lidar are connected to Sensor Controller. LCD is connected to Motor Controller. Bluetooth is connected to Bridge Controller. CAN Bus is implemented using CAN Transceivers MCP2551 terminated by 120Ohms; with PCAN for monitoring CAN Debug Messages and Data. &lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We implemented separate power modules for LIDAR and remaining modules of the PCB. The micro USB mini B supplies 5V to LIDAR Motor and Scanner (max current rating estimated @ 1A). Another power is supplied through USB 2.0 Type A connector with a rating of 5V@2A. Since GPS requires 3.3V, we have used a linear regulator REG1117-3.3. All the parts are through-hole components.&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 with the lead time of 1 week. We implemented 2 layers of PCB with most of the parts in top layer. We implemented rectangular header connector for SJOne boards, RPM sensor, DC &amp;amp; Servo Motor and GPS modules on the bottom layer.&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
There were 2 iterations of this board. The first one was designed without validation and had problems with orientation of the SJOne board header &amp;amp; pin connections. We also need to change the header for LCD since it was having different pitch.This design lacked several necessary power connections and was limited by functionality. These problems were fixed in the 2nd iteration.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:DipTrace1.jpg|1000x1200px|thumb|center|PCB Layout Design in DipTrace]]&lt;br /&gt;
[[File:Top_layer.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
[[File:Bottom_layer.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''CAN Communication'''==&lt;br /&gt;
*As the DBC file shows, master is given the highest priority after bridge start/stop command message.&lt;br /&gt;
*All messages from every controller are send to Bridge and Motor as well along with Master, to display it on Android app and LCD Controller for debugging and testing.&lt;br /&gt;
*Every controller is also sending Initialization Debug messages over CAN, to verify it on BusMaster.&lt;br /&gt;
*1Hz task is used to check CAN_bus_off() condition, along with send heartbeat and debug message messages over can.&lt;br /&gt;
*As master is the major receiver of all the signals, it perform MIA handling of all necessary signals along with heartbeat as well.&lt;br /&gt;
*We have also used plenty of LEDs for confirming we get correct heartbeat and data.&lt;br /&gt;
*The code for master MIA initialization is as shown below,&lt;br /&gt;
&lt;br /&gt;
  const uint32_t                             BRIDGE_NODE__MIA_MS = 3000;&lt;br /&gt;
  const BRIDGE_NODE_t                        BRIDGE_NODE__MIA_MSG = { 0, {0} };&lt;br /&gt;
  const uint32_t                             SENSOR_NODE__MIA_MS = 3000;&lt;br /&gt;
  const SENSOR_NODE_t                        SENSOR_NODE__MIA_MSG = { 0 };&lt;br /&gt;
  const uint32_t                             GPS_LOCATION__MIA_MS = 3000;&lt;br /&gt;
  const GPS_LOCATION_t                       GPS_LOCATION__MIA_MSG = { 37.3686485, -121.9153289, {0} };&lt;br /&gt;
  const uint32_t                             COMPASS__MIA_MS = 3000;&lt;br /&gt;
  const COMPASS_t                            COMPASS__MIA_MSG = { 37.3686485, -121.9153289, 0.0, {0} };&lt;br /&gt;
  const uint32_t                             SENSOR_HEARTBEAT__MIA_MS = 3000;&lt;br /&gt;
  const SENSOR_HEARTBEAT_t                   SENSOR_HEARTBEAT__MIA_MSG = {0, {0}};&lt;br /&gt;
  const uint32_t                             MOTOR_HEARTBEAT__MIA_MS = 3000;&lt;br /&gt;
  const MOTOR_HEARTBEAT_t                    MOTOR_HEARTBEAT__MIA_MSG = {0, {0}};&lt;br /&gt;
  const uint32_t                             GPS_HEARTBEAT__MIA_MS = 3000;&lt;br /&gt;
  const GPS_HEARTBEAT_t                      GPS_HEARTBEAT__MIA_MSG = {0, {0}};&lt;br /&gt;
  const uint32_t                             BRIDGE_HEARTBEAT__MIA_MS = 3000;&lt;br /&gt;
  const BRIDGE_HEARTBEAT_t                   BRIDGE_HEARTBEAT__MIA_MSG = {0, {0}};&lt;br /&gt;
&lt;br /&gt;
==Hardware Design==&lt;br /&gt;
The CAN bus hardware implementation between all the controller module for this project is shown below. It is necessary to terminate the CAN bus at 120 Ohms to prevent any signal reflections.&lt;br /&gt;
[[File:CAN_Hardware.jpg|1000x1200px|thumb|center|PCB Layout Design in DipTrace]]&lt;br /&gt;
&lt;br /&gt;
We have implemented some LEDs for indicating the heartbeat signals sent by the master, sensor readings and motor movements. Below is the table explaining the LEDs in PCBs along with the color, pin and signal description&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
LED DESIGNATION&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
GPIO PINS&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
DESCRIPTION &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#7acee2;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COLOR &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D1'''&lt;br /&gt;
|VCC and GND&lt;br /&gt;
|POWER&lt;br /&gt;
|RED&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D2 MOTOR'''&lt;br /&gt;
|P2.5 and VCC &lt;br /&gt;
|RPM&lt;br /&gt;
|RED&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D3 MOTOR'''&lt;br /&gt;
|P0.29 &lt;br /&gt;
|Motor Heartbeat&lt;br /&gt;
|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D4 MOTOR'''&lt;br /&gt;
|P0.30 &lt;br /&gt;
|DC Motor&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D5 MOTOR'''&lt;br /&gt;
|P1.19 &lt;br /&gt;
|Servo Motor&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D6 BRIDGE'''&lt;br /&gt;
|P0.29 &lt;br /&gt;
|Bridge Heartbeat&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D7 BRIDGE'''&lt;br /&gt;
|P0.30&lt;br /&gt;
|DC Motor&lt;br /&gt;
|BLUE&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D8 GPS'''&lt;br /&gt;
|P0.30&lt;br /&gt;
|Geographical FIX&lt;br /&gt;
|BLUE&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D9 GPS'''&lt;br /&gt;
|P0.29&lt;br /&gt;
|Geographical Heartbeat&lt;br /&gt;
|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D10 GPS'''&lt;br /&gt;
|P1.19&lt;br /&gt;
|Compass Data&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D11 SENSOR'''&lt;br /&gt;
| P0.29&lt;br /&gt;
| Sensor Heartbeat&lt;br /&gt;
| Green&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D12 SENSOR'''&lt;br /&gt;
| P0.30&lt;br /&gt;
| Left Obstacle&lt;br /&gt;
| Yellow&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D13 SENSOR'''&lt;br /&gt;
| P1.19&lt;br /&gt;
| Right Obstacle&lt;br /&gt;
| Blue&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D14 SENSOR'''&lt;br /&gt;
| P1.20&lt;br /&gt;
| Front Obstacle&lt;br /&gt;
| Green&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D15 SENSOR'''&lt;br /&gt;
| P1.19&lt;br /&gt;
| Right Obstacle&lt;br /&gt;
| Blue&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D16 MASTER'''&lt;br /&gt;
| P0.29&lt;br /&gt;
| Sensor Heartbeat&lt;br /&gt;
| Red&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D17 MASTER'''&lt;br /&gt;
| P0.30&lt;br /&gt;
| Motor Heartbeat&lt;br /&gt;
| Green&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D18 MASTER'''&lt;br /&gt;
| P1.19&lt;br /&gt;
| Bridge Heartbeat&lt;br /&gt;
| Yellow&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''D19 MASTER'''&lt;br /&gt;
| P1.20&lt;br /&gt;
| Geographical Heartbeat&lt;br /&gt;
| Blue&lt;br /&gt;
|-&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''DBC File'''==&lt;br /&gt;
A Link to the DBC file that defines the CAN communication of the system is as follows:&lt;br /&gt;
[https://gitlab.com/tech-savycmpe243/cmpe243_techsavy_rc_car/blob/master/PROJ_DBC_File/243_techSavvy.dbc DBC link on GitLab]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DBC is a format that enables fewer hassles while developing code to either interpret data received or send data over the CAN bus. This project used DBC effectively.&lt;br /&gt;
&lt;br /&gt;
Shown below is the DBC implementation for this project. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_ :&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: MASTER BRIDGE MOTOR SENSOR GPS DBG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BO_ 103 BRIDGE_NODE: 1 BRIDGE&lt;br /&gt;
 SG_ BRIDGE_START_cmd : 0|1@1+ (1,0) [0|1] &amp;quot;&amp;quot; MASTER,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 104 CAR_CONTROL: 4 MASTER&lt;br /&gt;
 SG_ MOTOR_DRIVE_cmd : 0|2@1+ (1,0) [0|0] &amp;quot;&amp;quot; MOTOR,BRIDGE&lt;br /&gt;
 SG_ MOTOR_STEER_cmd : 2|15@1+ (0.1,-90.0) [-90|90] &amp;quot;&amp;quot; MOTOR,BRIDGE&lt;br /&gt;
 SG_ MOTOR_kph : 17|12@1+ (0.01,0) [0.00|20.00] &amp;quot;kph&amp;quot; MOTOR,BRIDGE&lt;br /&gt;
 &lt;br /&gt;
BO_ 105 SENSOR_NODE: 5 SENSOR&lt;br /&gt;
 SG_ SENSOR_FRONT_cm : 0|10@1+ (1,0) [0|645] &amp;quot;cm&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 SG_ LIDAR_Obstacle_FRONT : 10|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 SG_ LIDAR_Obstacle_RIGHT : 13|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 SG_ LIDAR_Obstacle_LEFT : 16|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 SG_ LIDAR_Obstacle_BACK : 19|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 SG_ LIDAR_Obstacle_BACK_RIGHT : 22|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 SG_ LIDAR_Obstacle_BACK_LEFT : 25|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
&lt;br /&gt;
BO_ 106 MOTOR_NODE: 2 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_kph : 0|12@1+ (0.01,0) [0.00|20.00] &amp;quot;kph&amp;quot; MASTER,BRIDGE&lt;br /&gt;
 &lt;br /&gt;
BO_ 107 BRIDGE_CHECKPOINTS: 8 BRIDGE&lt;br /&gt;
 SG_ CHECKPOINT_LAT_deg : 0|28@1+ (0.000001,-90.000000) [-90|90] &amp;quot;Degrees&amp;quot; MASTER,GPS,MOTOR&lt;br /&gt;
 SG_ CHECKPOINT_LONG_deg : 28|29@1+ (0.000001,-180.000000) [-180|180] &amp;quot;Degrees&amp;quot; MASTER,GPS,MOTOR&lt;br /&gt;
 &lt;br /&gt;
BO_ 108 GPS_LOCATION: 8 GPS&lt;br /&gt;
 SG_ CURRENT_LAT_deg : 0|28@1+ (0.000001,-90.000000) [-90|90] &amp;quot;Degrees&amp;quot; MASTER,BRIDGE,MOTOR&lt;br /&gt;
 SG_ CURRENT_LONG_deg : 28|29@1+ (0.000001,-180.000000) [-180|180] &amp;quot;Degrees&amp;quot; MASTER,BRIDGE,MOTOR&lt;br /&gt;
 &lt;br /&gt;
BO_ 109 COMPASS: 8 GPS&lt;br /&gt;
 SG_ CMP_HEADING_deg : 0|12@1+ (0.1,0) [0|359.9] &amp;quot;Degrees&amp;quot; MASTER,BRIDGE,MOTOR&lt;br /&gt;
 SG_ CMP_BEARING_deg : 12|12@1+ (0.1,0) [0|359.9] &amp;quot;Degrees&amp;quot; MASTER,BRIDGE,MOTOR&lt;br /&gt;
 SG_ CMP_DISTANCE_meters : 24|17@1+ (0.01,0) [0|0] &amp;quot;Meters&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
 &lt;br /&gt;
BO_ 110 MASTER_HEARTBEAT: 1 MASTER&lt;br /&gt;
 SG_ MASTER_hbt : 0|1@1+ (1,0) [0|1] &amp;quot;&amp;quot; SENSOR,MOTOR,BRIDGE,GPS&lt;br /&gt;
   &lt;br /&gt;
BO_ 111 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_hbt : 0|1@1+ (1,0) [0|1] &amp;quot;&amp;quot; MASTER&lt;br /&gt;
  &lt;br /&gt;
BO_ 112 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_hbt : 0|1@1+ (1,0) [0|1] &amp;quot;&amp;quot; MASTER&lt;br /&gt;
       &lt;br /&gt;
BO_ 113 GPS_HEARTBEAT: 1 GPS&lt;br /&gt;
 SG_ GPS_hbt : 0|1@1+ (1,0) [0|1] &amp;quot;&amp;quot; MASTER&lt;br /&gt;
    &lt;br /&gt;
BO_ 114 BRIDGE_HEARTBEAT: 1 BRIDGE&lt;br /&gt;
 SG_ BRIDGE_hbt : 0|1@1+ (1,0) [0|1] &amp;quot;&amp;quot; MASTER&lt;br /&gt;
&lt;br /&gt;
BO_ 115 SENSOR_DEBUG: 1 SENSOR&lt;br /&gt;
 SG_ IO_DEBUG_CAN_init : 0|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_sensor_init : 1|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_CAN_TX : 2|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_bus_off : 3|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 &lt;br /&gt;
BO_ 116 MOTOR_DEBUG: 2 MOTOR&lt;br /&gt;
 SG_ IO_DEBUG_CAN_init : 0|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_bus_off : 1|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_RPM_kph : 2|12@1+ (0.01,0) [0.00|20.00] &amp;quot;kph&amp;quot; DBG&lt;br /&gt;
 &lt;br /&gt;
BO_ 117 MASTER_DEBUG: 1 MASTER&lt;br /&gt;
 SG_ IO_DEBUG_CAN_init : 0|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_bus_off : 1|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_drive_mode : 2|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_HBT_FROM_ALL_CONTR : 3|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 118 GPS_DEBUG: 1 GPS&lt;br /&gt;
 SG_ IO_DEBUG_CAN_init : 0|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_HBT_Transmit : 1|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_bus_off : 2|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_GPS_rx : 3|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_GPS_Fix : 4|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_Compass_Rx : 5|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 119 BRIDGE_DEBUG: 1 BRIDGE&lt;br /&gt;
 SG_ IO_DEBUG_CAN_init : 0|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_HBT_Transmit : 1|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_bus_off : 2|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_Connected : 3|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ IO_DEBUG_Bridge_rx : 4|1@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG &lt;br /&gt;
&lt;br /&gt;
CM_ BU_ MASTER &amp;quot;The master controller driving the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ BRIDGE &amp;quot;The bridge controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GPS &amp;quot;The gps controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ DBG &amp;quot;The debug node of the car&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 103 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 104 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 105 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 106 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 107 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 108 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 109 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 110 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 111 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 112 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 113 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 114 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 115 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 116 100;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 117 100;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 MOTOR_DRIVE_cmd &amp;quot;MOTOR_DRIVE_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VAL_ 104 MOTOR_DRIVE_cmd 2 &amp;quot;MOTOR_STOP&amp;quot; 1 &amp;quot;MOTOR_REV&amp;quot; 0 &amp;quot;MOTOR_FORWARD&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A screenshot of the Bus Master Application is as shown below:&lt;br /&gt;
[[File:Busmaster.jpg|800px|thumb|center|]]&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''3D printing models''' ==&lt;br /&gt;
We used a 3D mount model to mount the ultrasonic sensor and compass.  After testing the ultrasonic sensor at different angles we noticed that best results are when sensors are mounted at 70 degrees with respect to the ground. Most important thing to consider was the mount should be able to adjust tilt of the sensors since we were receiving lot of reflection from the ground. So in order to satisfy that requirement mount is constructed from two parts, the stand and part that holds the sensor what gave us freedom to test sensors positioning. We used the 3D mount design from Thingiverse.&lt;br /&gt;
&lt;br /&gt;
Since we needed to keep the Compass sensor away from DC Motor's interference, we decided to keep the compass at certain height above the PCB. So we used 3D printing to print the support plate with the mounting holes of same dimension as M3X10 screw standoffs.&lt;br /&gt;
&lt;br /&gt;
[[File:Ultrasonic_mount.jpg|300px|thumb|left|Ultrasonic Sensor Mount]]&lt;br /&gt;
[[File:Actual_mount.jpg|160px|thumb|right|Actual Mount]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Compass_mount.JPG|280px|thumb|center|Compass Mount]]&lt;br /&gt;
&lt;br /&gt;
=='''Sensor Node'''==&lt;br /&gt;
We used 2 sensor modules to achieve accurate and reliable obstacle avoidance system.&amp;lt;br&amp;gt;&lt;br /&gt;
'''1. Lidar''' - Main controller to detect obstacle. Giving 360-degree view with a range up to 6 meters in distance.&amp;lt;br&amp;gt;&lt;br /&gt;
*RPLidar works on a mechanism known as laser triangulation ranging principle. The system measures distance data in more than 2000 times’ per second and with high-resolution distance output. RPLIDAR emits modulated infrared laser signal and the laser signal is then reflected by the object to be detected. The returning signal is sampled by vision acquisition system in RPLIDAR A1 and the DSP embedded in RPLIDAR starts processing the sample data and output distance value and angle value between object and RPLIDAR A1 through the communication interface.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Lidar_RPLidar_working_schematic.png|500x900px|thumb|center|Lidar Working Schematic]]&lt;br /&gt;
&lt;br /&gt;
'''2. Ultrasonic Sensor (Maxbotix LV-MaxSonar-EZ0)''' - One Ultrasonic sensor with a maximum range of 600 cm was used to detect very small objects at the front that Lidar might miss because of it's leveled placement.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ultrasonicbeam.png|100px|thumb|right|ultrasonic beam]]&lt;br /&gt;
*Ultrasonic sensor uses a high-frequency beam to detect an object. It first throws light and reads the time taken for light to receive back, depending on the time calculated, it identifies the obstacle. It calibrates after it's first to read cycle, then it can continuously read data of light. The beam depending on the range is shown in figure.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sensor Node Code====&lt;br /&gt;
[https://gitlab.com/tech-savycmpe243/cmpe243_techsavy_rc_car/tree/master/Sensor_Controller_Module GitLab link to Sensor Code]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
*The Lidar is communicating with SJOne board through UART, we have used UART 2 here as shown in Pin config below. &amp;lt;br&amp;gt;&lt;br /&gt;
*Ultrasonic Sensor is simple Interrupt based, hence it connected through GPIO pins of SJOne board as shown in diagram.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:TechSavy_Lidar_pincon.png|500x900px|thumb|center|Sensor Pin connection]]&lt;br /&gt;
&lt;br /&gt;
*Figure shows the usage of 4 LEDS and LCD display to notify us the position of obstacle.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:techsavy_lidar_led.jpg|300px|thumb|left|LED indication]]&lt;br /&gt;
[[File:TechSavy_sensor_lcd_screen.jpeg|300px|thumb|center|LCD screen showing the value of track of obstacle at respective direction]]&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
=====&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;'''Ultrasonic'''&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;=====&lt;br /&gt;
LV Maxsonar ultrasonic sensor is used at the very front of the RC car to provide wide range sonar detection ranging from 0 to 645 cm. It supports LiDAR sensor to detect very small obstacles like stone that can hinder car from moving forward. so we have purposefully mounted it at a lower level than LiDAR.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''LiDAR'''&amp;lt;/font&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;=====&lt;br /&gt;
RPLidar works on UART. We have used UART 2 of SJOne Board to establish communication between them. &lt;br /&gt;
&lt;br /&gt;
*Figure shows the several operation provided by RPLidar for better performance and reliable data.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: lidar_operation.png|700px|thumb|center| Various Operations of RPLidar]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Algorithm to establish communication through UART'''&lt;br /&gt;
* In order to start the scanning of Lidar, first send the 0X20 via &amp;lt;code&amp;gt;uart2.putchar(0x20)&amp;lt;/code&amp;gt;. Before that, we can check the health status of RPLidar by sending 0x52. It waits for some time (timeout = 500ms), and if return status is not true throws error indicating Lidar is not initialized properly and hence it gets reset. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* As soon as correct scan command is received by Lidar, it starts sending data frames continuously on UART. The frame consists of 5 bytes including the start bit, Angle, quality and distance, which are useful to identify the exact position of obstacle.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:RPLidar_data_frame.png|500px|thumb|center|]]&lt;br /&gt;
&lt;br /&gt;
* This data is processed and divided into tracks of 25 cm each. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* By looking at the track, we choose the sector value which depends on angle detected. Below figure shows the division of angle for respective sector value.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:TechSavy_Lidar_angle.png|700px|thumb|center|Figure shows the division of angles]]&lt;br /&gt;
* The obstacle information is sent to Master Node through CAN.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
====&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;'''Ultrasonic'''&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;====&lt;br /&gt;
*It works with the help of interrupt. &lt;br /&gt;
* After configuring GPIO pins as RX and TX, set RX pin high.&lt;br /&gt;
* PW pin gets the input, identify the type of interrupt&lt;br /&gt;
**Rising edge interrupt.&lt;br /&gt;
**Falling edge interrupt&lt;br /&gt;
*Calculate distance to obstacle, &lt;br /&gt;
** &amp;lt;code&amp;gt;ultrasonic_data.distance = (stop_time - start_time)/147; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''LiDAR'''&amp;lt;/font&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;====&lt;br /&gt;
Below diagram shows the code flow of sensor module. A separate task was used to send sensor data over CAN, which continuously sends data in while(1) loop.&lt;br /&gt;
[[File:TechSavy_Sensor_flowchart.png|770x770px|center|Sensor Flowchart]]&lt;br /&gt;
&lt;br /&gt;
====CAN DBC Messages Send from Sensor====&lt;br /&gt;
&lt;br /&gt;
   BO_ 105 SENSOR_NODE: 5 SENSOR&lt;br /&gt;
    SG_ SENSOR_FRONT_cm : 0|10@1+ (1,0) [0|645] &amp;quot;cm&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
    SG_ LIDAR_Obstacle_FRONT : 10|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
    SG_ LIDAR_Obstacle_RIGHT : 13|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
    SG_ LIDAR_Obstacle_LEFT : 16|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
    SG_ LIDAR_Obstacle_BACK : 19|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
    SG_ LIDAR_Obstacle_BACK_RIGHT : 22|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
    SG_ LIDAR_Obstacle_BACK_LEFT : 25|3@1+ (1,0) [0|0] &amp;quot;&amp;quot; MASTER,MOTOR,BRIDGE&lt;br /&gt;
&lt;br /&gt;
===='''LED Blinking signals for SENSOR CONTROLLER ON CAR'''====&lt;br /&gt;
 * RED LED ON: MASTER HEARTBEAT STATUS on CAR&lt;br /&gt;
 * BLUE LED ON: Obstacle detected at front of CAR&lt;br /&gt;
 * Rightmost GREEN LED ON: Obstacle detected at right of CAR&lt;br /&gt;
 * YELLOW LED ON: Obstacle detected at back of CAR&lt;br /&gt;
 * Leftmost GREEN LED ON: Obstacle detected at left of CAR.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;'''Ultrasonic'''&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;====&lt;br /&gt;
*When mounted initially on CAR, ultrasonic was giving sometimes faulty readings as it was detecting ground as and obstacle.&lt;br /&gt;
**We designed a 3D mount for it and adjusted it on such a angle that it gives perfect readings.&lt;br /&gt;
*Initialization issue: Sometimes on power-up we noticed that Ultrasonic sensor was giving faulty readings(it was getting stuck on some fixed value).&lt;br /&gt;
**After reading the datasheet accurately, I found that it calibrates itself during the first read cycle and so the obstacle should be at least 14 inches far from the sensor. &lt;br /&gt;
*Ultrasonic Failure - When the CAR got crashed, Ultrasonic sensor failed and started giving incorrect data.&lt;br /&gt;
**We replaced it's wired to get it working.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;&amp;lt;B&amp;gt;&amp;lt;font color=&amp;quot;FUCHSIA&amp;quot;&amp;gt;'''LiDAR'''&amp;lt;/font&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;====&lt;br /&gt;
* Identifying obstacle data and separating it.&lt;br /&gt;
** Initially I lost a lot of time in figuring out the data frame as it consists of quality, angle, distance and start bit.&lt;br /&gt;
** Dividing the frame bits appropriately and storing it separately in struct variables resolved the issue. Also after that depending on the angle, every 360 times data was fetched in a loop to cover each and every angle value.&lt;br /&gt;
* Task overrun because of receiving a large number of data continuously over UART.&lt;br /&gt;
** Used a separate task, that receives data continuously in a loop, i.e while(1).&lt;br /&gt;
** Instead of receiving whole data in a single frame, took data character by character in a for loop 360 times, to get the value of obstacle at each degree. &lt;br /&gt;
* Angle detection problem - When large angles were taken, for example, 30 degrees on the right, it was detecting nearer objects correctly but far objects were getting detected in some other range (for example in front instead of right) of angle because of angle spread. I divided the range into 10 degrees each and store it in the same variable to send it over CAN.&amp;lt;br&amp;gt; For example, to get 30 degrees in right, 0-10,10-20 &amp;amp; 20-30 values are taken.&lt;br /&gt;
* Received variable initialization problem.&lt;br /&gt;
** I didn't initialize the character variable to get data from UART to 0 and hence it was taking garbage value.&amp;lt;br&amp;gt; Thanks to Preet, at time of my code review he pointed out this problem and later I checked it with Unit Testing.&lt;br /&gt;
* Some bugs here and there in the code.&lt;br /&gt;
** I identified and resolved a few bugs after Unit testing the code.&lt;br /&gt;
* Delay in sending data because of large CAN buffer size.&lt;br /&gt;
** We were facing this issue with master, motor and sensor communication. The response time was slow as data was getting accumulated before sending because of large buffer size taken.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Motor Controller'''==&lt;br /&gt;
Motor Controller is responsible to control the DC and Servo Motor, RPM Sensor measurements and LCD control. The motor control logic controls the steering and the speed of the vehicle using a servo and DC motor respectively based on the CAR_CONTROL_t CAN message from the master. It takes input from RPM sensor as a feedback for maintaining a constant speed and based on the RPM sensor reading, a PID loop calculates duty-cycle for PWM signal which are then given to DC motor. Based on other can messages from the sensor controller, geo controller and bridge controller, motor controller processes and communicates the information to the LCD by refreshing the data periodically in 10Hz function.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware interface details of '''MOTOR Module''' with SJOne board are given below:&lt;br /&gt;
&lt;br /&gt;
[[ File: RPM Sensor, DC and Servo Motor Hardware Design.jpeg|600px|thumb|left|RPM Sensor, DC and Servo Motor Hardware Interfacing]]&lt;br /&gt;
[[ File: LCD.JPG |520px|thumb|center|LCD Hardware Connections]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
====Electronic Speed Controller (ESC)====&lt;br /&gt;
We made use of the Traxxas ESC XL-05 which comes with the RC car. ESC stands for Electronic Speed Control. It is used to control the DC motor using PWM signals from the controller. It powers up when we connect a LiPo or NiMH battery of 7.4v. The ESC has a dc-to-dc converter which converts 7.4v to 6v and provides it to DC motor. It can provide high current to the power hungry DC motors running at faster speeds. It has an LED and a button which is used for calibration and setting different modes for the car.&lt;br /&gt;
 &lt;br /&gt;
[[File:CMPE243 F17 nano ESC.jpg|220px|thumb|right|Traxxas ESC XL5]]&lt;br /&gt;
&lt;br /&gt;
====DC Motor====&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE_S19_techsavy_dc.jpg‎|350px|thumb|right|Traxxas DC Motor]]&lt;br /&gt;
The DC motor is controlled using the ESC which get PWM pulses for controlling it. A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. Below table shows  the LED functionality implemented in PCB for all the controllers.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| S.No&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Wires - DC Motor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1. &lt;br /&gt;
| Positive Wire (already Connected)&lt;br /&gt;
| Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2. &lt;br /&gt;
| Negative Wire (already Connected)&lt;br /&gt;
| Negative terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The DC motor is controlled using PWM at 100Hz.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ DC MOTOR Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation !! Pulse Width Range(ms) !! Duty-cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
| FORWARD      || 1.51 - 2.00     || 15.1 - 20.0      &lt;br /&gt;
|-&lt;br /&gt;
| STOP      || 1.50     || 15.0&lt;br /&gt;
|-&lt;br /&gt;
| REVERSE      || 1.00 - 1.49     || 10.0 - 14.9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': Before using the Traxxas ESC to give PWM signal to DC motor calibrate it by going to this website:&amp;lt;br&amp;gt;&lt;br /&gt;
:https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The ESC must be given a pulse of 1.5ms when we turn it on or else the DC motor won't respond to PWM pulses.&amp;lt;br&amp;gt;&lt;br /&gt;
:Step 1: Give 2.00ms on-time pulses when LED blinks red once.&amp;lt;br&amp;gt;&lt;br /&gt;
:Step 2: Give 1.50ms on-time pulses when LED blinks red twice.&amp;lt;br&amp;gt;&lt;br /&gt;
:Step 3: Give 1.00ms on-time pulses and the LED color changes from red to green showing that the calibration was successful.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Servo Motor====&lt;br /&gt;
[[File:CMPE243_F17_nano_servo.jpg ‎|200px|thumb|right|Traxxas Servo Motor]]&lt;br /&gt;
The direction the vehicle's front wheels turn is dependent on the servo motor in the vehicle. Based on various PWM signals, the servo steers the front wheels of the vehicle in the left and right direction. The servo has 3 wires of which one is for the PWM input signal whereas the other two are to power up the servo. We powered our servo motor using the 6v power supply from the battery elimination circuit present in the ESC so that a single switch to turn on and off both the servo and DC motor. PWM signals to control the servo is provided by the motor controller. Based on the PWM signal from the SJOne board, the &lt;br /&gt;
shaft shall be rotated to a certain degree left or right&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| S.No&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Wires - Servo Motor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Function&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1. &lt;br /&gt;
| PWM connected to P2.1&lt;br /&gt;
| PWM signal from SJOne board&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2. &lt;br /&gt;
| VCC&lt;br /&gt;
| 6V power supply from ESC&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3. &lt;br /&gt;
| Ground&lt;br /&gt;
| Common ground to system&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====RPM Sensor====&lt;br /&gt;
[[File:CMPE243_F17_nano_Speed_Sensor.jpg ‎|250px|thumb|right|Traxxas Speed Sensor]]&lt;br /&gt;
RPM sensor is used as a feedback element in the PID to maintain a constant speed of the vehicle. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. We make use of one magnet and we get one pulse on one wheel rotation The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. These pulses are read by the SJOne board and fed to the speed control algorithm. The RPM sensor has 3 wires, the white where are the output wire that provides the pulses to the SJone board and the other wires power the sensor. &lt;br /&gt;
&lt;br /&gt;
=====Implementation=====&lt;br /&gt;
1. The idea is that every time the motor completes 1 whole revolution, it reaches very close to the sensor. And when the sensor detects the magnet nearby, it sends out a high pulse until the magnet moves away from it. Therefore, upon detecting the X number of a rising edge in Y seconds we can say that rpm was X revolutions/Y seconds.&amp;lt;br&amp;gt;&lt;br /&gt;
2. During our initial testing of RPM Sensor with SJOne board, we saw that regardless of whether we bring the magnet close to the sensor or not, the signal voltage was always high. After some trail and errors, we found out that the signal pin(white wire) had to be connected to the VCC(red wire) across a 1K resistor which can act as weak pull down when it detects the magnet.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| S.No&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Wires - RPM Sensor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Function&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1. &lt;br /&gt;
| Signal wire connected to P2.5&lt;br /&gt;
| GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2. &lt;br /&gt;
| VCC&lt;br /&gt;
| 6V power supply from ESC&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3. &lt;br /&gt;
| GND&lt;br /&gt;
| Common ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== uLCD32-PTU ====&lt;br /&gt;
&lt;br /&gt;
uLCD32-PTU by 4D systems has a 3.2&amp;quot; TFT LCD Display module. The module comes with a display resolution of 240x320 pixels. 4D Systems provides a programming cable based on UART for burning the LCD code to the module. The project is burnt to a uSD card which is used for display during booting of the LCD. It is recommended that we use the programming adapter provided by 4D systems as it has a special reset button that can be used to download the built project to the LCD display.Once the LCD display was configured with different widgets and screens, the motor module was coded to display information in LCD through UART. Workshop4 IDE was used to program the GUI, and data was transmitted from the SJOne board through UART communication. The LCD displays the main menu screen with options of all the modules: Sensor, Motor, Bridge, GPS, Compass and MIA information.&lt;br /&gt;
&lt;br /&gt;
These modules represent the page numbers of the display whose information can be found from the pre-processed data format of the LCD.This data format contains the following fields:&lt;br /&gt;
*The write command&lt;br /&gt;
*Type of the object&lt;br /&gt;
*Object ID&lt;br /&gt;
*MSB and LSB values to be displayed in the LED. &lt;br /&gt;
*The last pair of hex value is for checksum. &lt;br /&gt;
&lt;br /&gt;
The following figure shows the programming cable and the pins used for uLCD32-PTU.&lt;br /&gt;
[[File:CMPE243_F17_nano_LCD-connection.JPG|thumb|300px|LCD connections|right]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ LCD Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| S.No&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Wires - LCD interface&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Function&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1. &lt;br /&gt;
| TX&lt;br /&gt;
| Data Transmission connected to UART RX of SJ1 board&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2. &lt;br /&gt;
| RX&lt;br /&gt;
| Data Reception connected to UART TX of SJ1 board&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2. &lt;br /&gt;
| VCC&lt;br /&gt;
| Input 5v supply&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3. &lt;br /&gt;
| GND&lt;br /&gt;
| Common ground&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4. &lt;br /&gt;
| RES&lt;br /&gt;
| Reset Pulse(Not Required for our project)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The dc motor and servo motor operation is fundamentally based on PWM (Pulse Width Modulation). We set the PWM frequency to 100Hz for both dc and servo motor.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pseudo code for initializing PWM to 100Hz. &amp;lt;br&amp;gt;&lt;br /&gt;
 PWM *motor_control;     //pointer object defined globally&lt;br /&gt;
 PWM *servo_control;&lt;br /&gt;
 void init_pwm(long unsigned int freq) {&lt;br /&gt;
     motor_control = new PWM(PWM::pwm1, freq);      // using PWM constructor to initialize the PWM 2.0 pin to desired frequency&lt;br /&gt;
     servo_control = new PWM(PWM::pwm2, freq);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
====DC Motor====&lt;br /&gt;
The DC motor is connected to pin P2.0 on SJONE board. The DC motor is commanded every 100ms to change or maintain its speed or direction(FORWARD, REVERSE and STOP). A switch case is used to check the command that we are receiving over CAN bus from master.&lt;br /&gt;
&lt;br /&gt;
Pseudo code for dc motor and speed control&lt;br /&gt;
 float speed = get_speed();&lt;br /&gt;
 float _error = calculate_error_PID(drive_forward-&amp;gt;MOTOR_mps, speed, &amp;amp;dc_motor);&lt;br /&gt;
 *PWM_percent += _error&lt;br /&gt;
 set_pwm_value(motor_1, *PWM_percent);&lt;br /&gt;
&lt;br /&gt;
====Servo Motor====&lt;br /&gt;
The Servo motor is connected to pin P2.1 on SJONE board. The servo motor is commanded every 10ms to change or maintain its angle between 0 and 180 degrees. We receive angle in the range of -90(full left), 0(neutral) and +90(full right) from master. The calculate PWM_duty_cycle_servo function maps the angle received from master to PWM signal and rotates the servo motor accordingly.&lt;br /&gt;
&lt;br /&gt;
Pseudo code for servo motor and angle calculation&lt;br /&gt;
 on_time = 10 + ((servo-&amp;gt;MOTOR_STEER_cmd + 90) * (10/180));&lt;br /&gt;
 set_pwm_value(servo_2, on_time);&lt;br /&gt;
&lt;br /&gt;
====RPM Sensor====&lt;br /&gt;
The RPM sensor is connected to pin P2.6 of SJONE board. When the wheel rotates once we get one pulse. We make use of interrupt to register these pulses in a 400ms time frame and then calculate the speed in m/s based on the formula:&lt;br /&gt;
 speed_m_per_sec = (circumference * rotation_per_sec) / (constant);&lt;br /&gt;
After every 400ms we reset the pulse counter. We have an ISR which increments these pulses.&lt;br /&gt;
 void eint3_handler(void){&lt;br /&gt;
     pulse++;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
====LED Blinking signals for MOTOR CONTROLLER====&lt;br /&gt;
*RED LED ON: MASTER HEARTBEAT STATUS on CAR&lt;br /&gt;
*BLUE LED ON: Car is moving in reverse direction&lt;br /&gt;
*YELLOW LED ON: Car is stopped&lt;br /&gt;
*GREEN LED ON: Car is moving in forward direction&lt;br /&gt;
&lt;br /&gt;
====LCD Software Flow Chart====&lt;br /&gt;
[[File:CMPE_243_TechSavy_LCD_Refresh.JPG|450px|thumb|center|LCD Software Flowchart: 1Hz Task]]&lt;br /&gt;
&lt;br /&gt;
====Programming SJONE Board for LCD Display====&lt;br /&gt;
*As raw data often cannot be displayed on the LCD directly, the values to be displayed had to be converted to appropriate byte-sized values.&lt;br /&gt;
*Communication with SJOne board was established at the baud rate of 115200 bps.&lt;br /&gt;
*Commands for writing data and reading acknowledgment for various gauges were coded in the SJ1 board.&lt;br /&gt;
&lt;br /&gt;
====Creating a project using Workshop 4 IDE and programming the LCD display====&lt;br /&gt;
* After finalizing the design of the LCD's layout, a genie project was created using Workshop 4.&lt;br /&gt;
* The layout was split into different forms (pages) and appropriate buttons and gauges were added for display.&lt;br /&gt;
* uLCD-32PTU was programmed with the help of programming cable provided by 4D systems.&lt;br /&gt;
&lt;br /&gt;
The steps taken for interfacing the LCD display with the SJONE board is shown on the right:&lt;br /&gt;
&lt;br /&gt;
Each of the reading is considered as a object with the object type ID and object number. Below are the list of objects used for lcd.&lt;br /&gt;
 #define GPS_DEST_LATITUDE_OBJ        0&lt;br /&gt;
 #define GPS_DEST_LONGITUDE_OBJ       1&lt;br /&gt;
 #define GPS_CURRENT_LATITUDE_OBJ     2&lt;br /&gt;
 #define GPS_CURRENT_LONGITUDE_OBJ    3&lt;br /&gt;
 #define GPS_HEADING_OBJ              13&lt;br /&gt;
 #define GPS_BEARING_OBJ              14&lt;br /&gt;
 #define GPS_DISTANCE_OBJ             3&lt;br /&gt;
 #define MOTOR_SPEED_MS_OBJ           8&lt;br /&gt;
 #define MOTOR_PWM_OBJ                12&lt;br /&gt;
 #define MOTOR_RPM_OBJ                4&lt;br /&gt;
 #define MOTOR_TURNING_ANGLE_OBJ      9&lt;br /&gt;
 #define MOTOR_DISTANCE_COVERED_OBJ   10&lt;br /&gt;
 #define MOTOR_DISTANCE_LEFT_OBJ      11&lt;br /&gt;
&lt;br /&gt;
So our approach was to send a LCDquery at 1Hz task using the below function.&lt;br /&gt;
 void lcd_screen_query(void)&lt;br /&gt;
 {&lt;br /&gt;
    char comm[] = {0, 0x0a, 0, 0x0a};&lt;br /&gt;
    for (int i = 0; i &amp;lt; (int)sizeof(comm); i++)&lt;br /&gt;
    {&lt;br /&gt;
        uart3_put_char(comm[i], 0);&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This query sends a a array of character to LCD and LCD acknowledges it and sends the pre-formated data to the controller using lcd_receive() called at every 10Hz. The receive() will contain the page number(lcd_screen) based on the screen it is currently into and prints the data corresponding to that screen i.e. GPS screen will call GPS_print function to print the GPS values.&lt;br /&gt;
&lt;br /&gt;
 void lcd_print()&lt;br /&gt;
 {&lt;br /&gt;
    switch (lcd_screen)&lt;br /&gt;
    {&lt;br /&gt;
        case menu:&lt;br /&gt;
            lcd_print_menu_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case bridge:&lt;br /&gt;
            lcd_print_bridge_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case gps:&lt;br /&gt;
            lcd_print_gps_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case sensor:&lt;br /&gt;
            lcd_print_sensor_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case motor:&lt;br /&gt;
            lcd_print_motor_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case home:&lt;br /&gt;
            lcd_print_home_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case mia:&lt;br /&gt;
            lcd_print_mia_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        case compass:&lt;br /&gt;
            lcd_print_compass_screen();&lt;br /&gt;
            break;&lt;br /&gt;
        default:&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=='''LCD Screens'''==&lt;br /&gt;
{|&lt;br /&gt;
|[[File:screen8.PNG|thumb|220px|left|Main Screen]]&lt;br /&gt;
|[[File:screen1.PNG|thumb|220px|none|Module Selection Screen]]&lt;br /&gt;
|[[File:screen5.PNG|thumb|220px|right|MOTOR Screen]]&lt;br /&gt;
|[[File:screen4.PNG|thumb|220px|none|Sensors Screen]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:screen6.PNG|thumb|220px|left|MID Status Screen]]&lt;br /&gt;
|[[File:screen7.PNG|thumb|220px|none|GPS Screen]]&lt;br /&gt;
|[[File:screen3.PNG|thumb|220px|right|Compass Screen]]&lt;br /&gt;
|[[File:screen2.PNG|thumb|220px|none|Bluetooth Screen]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Flow charts==&lt;br /&gt;
{|&lt;br /&gt;
|[[ File: DC_motor_control.jpg|500px|frameless|right]]&lt;br /&gt;
|&lt;br /&gt;
|[[ File: Servo_motor_control.jpeg|300px|frameless|center]]&lt;br /&gt;
|&lt;br /&gt;
|[[ File: Speed_calc.jpg|270px|frameless|left]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;'''DC motor speed and direction control using RPM sensor, Servo motor control and Speed calculator flow-chart'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
'''PWM frequency setting problem'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The PWM frequency won't set if we were making use of global objects directly using the SJONE PWM drivers. We verified using logic analyzer that our frequency was getting set to 1.19KHz instead of 100Hz.&amp;lt;br&amp;gt;&lt;br /&gt;
 PWM motor_control(PWM::pwm1, freq);&lt;br /&gt;
 PWM servo_control(PWM::pwm2, freq);&lt;br /&gt;
:'''Solution:''' After trying out many things we made use of global pointer objects to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
 PWM *motor_control;     //pointer object defined globally&lt;br /&gt;
 PWM *servo_control;&lt;br /&gt;
 void init_pwm(long unsigned int freq) {&lt;br /&gt;
     motor_control = new PWM(PWM::pwm1, freq);      // using PWM constructor to initialize the PWM 2.0 pin to desired frequency&lt;br /&gt;
     servo_control = new PWM(PWM::pwm2, freq);&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
'''DC motor shooting randomly'''&amp;lt;br&amp;gt;&lt;br /&gt;
: When we were testing our DC motor, we found that our dc motor would shoot randomly in forward and reverse direction when using GPP board. We checked our code and the entire wiring but were not able to fix it.&amp;lt;br&amp;gt;&lt;br /&gt;
:'''Solution:''' When our PCB arrived we tested the DC motor on it and it worked fine. One suggestion would be to use the PCB as soon as possible as it won't waste your time on debugging unnecessary problems.&lt;br /&gt;
&lt;br /&gt;
'''PID Calibration for uphill and downhill'''&amp;lt;br&amp;gt;&lt;br /&gt;
: It uses an extensive amount of time to get the PID loop working which gives proper error values which maneuvers the car without stopping on uphill and controls speed during the downhill.&lt;br /&gt;
: '''Solution:'''You should start using PID for maneuvering uphill and downhill conditions from the beginning.&lt;br /&gt;
&lt;br /&gt;
'''LCD Refreshing'''&amp;lt;br&amp;gt;&lt;br /&gt;
: During testing the data received in LCD, we noticed that LCD was not getting refreshed quickly i.e even though PCAN dongle was updating data quickly but LCD was showing the data after a few seconds. At one point, the LCD stopped updating data.&lt;br /&gt;
: '''Solution:'''We used snprintf() for GPS and Sensor values.For Compass and Motor, we implemented MSB and LSB approach where lower 8 bits of data(int) was stored in LSB and upper 8 bits in MSB, followed by our custom display function lcd_put_comm() which converted the data to the pre-formatted data and displayed data over UART using uart_put_char(). Below is an example&lt;br /&gt;
    char msb,lsb = 0;&lt;br /&gt;
    int local_heading = gps_bearing * 100;&lt;br /&gt;
    lsb = (char)((char) local_heading &amp;amp; 0xff);&lt;br /&gt;
    msb = (char)((char) (local_heading &amp;gt;&amp;gt; 8) &amp;amp; 0xff);&lt;br /&gt;
    lcd_put_comm(WRITE_OBJ, LED_DIGITS, GPS_HEADING_OBJ, msb, lsb);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Geographical Controller'''==&lt;br /&gt;
&lt;br /&gt;
Geographical Controller is one the most important controller in the autonomous car which helps it to navigate to its destination. This modules continuously update the position and orientation of the car with respect to geographical north and send the data to Master, Motor and Android controller boards. We are using the Adafruit Ultimate GPS module and CMPS11.&lt;br /&gt;
&lt;br /&gt;
* GEO CONTROLLER Git Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/tech-savycmpe243/cmpe243_techsavy_rc_car/tree/master/Geographical_Controller_Module]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
 &lt;br /&gt;
The hardware interface details of '''GPS and Compass Module''' with SJOne board are given below:&lt;br /&gt;
&lt;br /&gt;
[[ File: CmpE243_TechSavy_GEO_Controller.jpg|679px|thumb|centre||GPS &amp;amp; CMPS11 Module Hardware Interfacing]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''LED Blinking signals for GEO CONTROLLER ON CAR'''&lt;br /&gt;
 * RED LED ON: MASTER HEARTBEAT STATUS on CAR&lt;br /&gt;
 * BLUE LED ON: Shows GPS FIX STATUS on CAR&lt;br /&gt;
 * GREEN LED ON: COMPASS Data Indication&lt;br /&gt;
&lt;br /&gt;
'''GPS'''&lt;br /&gt;
&lt;br /&gt;
* '''GPS PinOut''' &lt;br /&gt;
 * VCC: 3.3V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD2 of SJOne board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD2 of SJOne board &lt;br /&gt;
 * FIX: States if GPS is fixed not&lt;br /&gt;
&lt;br /&gt;
[[ File: Gps Dump.png|700px|thumb|centre|| GPRMC NMEA DATA]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GPS is a global navigation satellite system that provides geolocation and time information to a GPS receiver anywhere on or near the Earth where there is an unobstructed line of sight to four or more GPS satellites.&lt;br /&gt;
&lt;br /&gt;
The GPS module used in this project runs on UART communication protocol. Its default baud rate is 9600bps and we are working on the same baud rate to extract GPS data. The GPS module works on NMEA 0183 standards which define the electrical and data specification for communication between the GPS module and its controller. We are using the Recommended minimum specific GPS/Transit data (GPRMC) command. It provides us with three important data which are Fix, Latitude, and Longitude, required for localization and navigation of the car. The update rate of these data from the GPS module is configured at 10Hz and 5Hz for fix control status.&lt;br /&gt;
&lt;br /&gt;
* GPS Configurations:&lt;br /&gt;
&lt;br /&gt;
GPS configuration Settings that we have used for the Adafruit GPS module is shown in the following picture. As per Arduino data-sheet, we can use different commands setting to set the different update rate from once a second (1 Hz) to 10 times a second (10 Hz) as per user requirements.&lt;br /&gt;
&lt;br /&gt;
[[ File: CMPE243_TechSavy_GPS_Config.JPG|600px|thumb|center|| GPS Configuration Settings]]&lt;br /&gt;
&lt;br /&gt;
'''Compass'''&lt;br /&gt;
&lt;br /&gt;
* '''Compass PinOut''' &lt;br /&gt;
 * VCC: 3.3V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * SCL: Serial Clock pin connected to SCL of SJOne board&lt;br /&gt;
 * SDA: Serial DATA pin connected to SDA of SJOne board&lt;br /&gt;
&lt;br /&gt;
A Compass is an instrument used for navigation and orientation that shows direction relative to the geographic cardinal directions (or points). Compass is communicating over I2C with SJ One board. The register 2 and 3 of the compass provide the compass bearing angle (0- 360 range). Calibrating the compass is an important part. We are calibrating it on ‘horizontal calibration mode’, it works for us because the compass has tilt calibration.&lt;br /&gt;
&lt;br /&gt;
We are using the compass in I2C mode of operation. The following table on the left shows the registers and their functions and the software flow chart for getting/setting compass data and calibration on demand and We are using the Compass bearing (16-bit) given by the compass registers 2 and 3 to calculate our car heading.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:CmpE243_I2c_compass_registers.png|thumb|500px|left|thumb|Registers of CMPS11]]&lt;br /&gt;
|[[File:CMPE_243_TechSavy_Compass_Calibration.jpg|thumb|450px|Right|thumb|Registers of CMPS11]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Software Design &amp;amp; Implementation===&lt;br /&gt;
&lt;br /&gt;
The Geographical Controller is in place for navigation purpose. It has two essential parts, namely GPS and compass. It provides direction to the car, by calculating the heading angle and the distance between the coordinates, based on GPS and compass readings. To calculate the heading angle, we need a compass bearing angle and angle between the line joining the two coordinates and the true north(bearing angle for GPS). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ File: Power_On_SMFC.JPG|600px|thumb|center||Hard Power ON Flow Chart]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ File: Periodic_task_SMFC.JPG|500px|thumb|right|| SFMC for 1HZ]]&lt;br /&gt;
[[ File: Periodic_task_10Hz_SMFC.JPG|600px|thumb|centre|| SFMC for 10Hz]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Distance between the two coordinates calculation ====&lt;br /&gt;
&lt;br /&gt;
The distance between the two coordinates can be calculated using the Haversine formula.&lt;br /&gt;
&lt;br /&gt;
  a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
  c = 2 ⋅ atan2(√a, √(1−a))&lt;br /&gt;
  d = R ⋅ c&lt;br /&gt;
  where,&lt;br /&gt;
        φ1 = Latitude of 1st Coordinate&lt;br /&gt;
        φ2 = Latitude of 2nd Coordinate&lt;br /&gt;
        λ1 = Longitude of 1st Coordinate&lt;br /&gt;
        λ2 = Longitude of 2nd Coordinate&lt;br /&gt;
        Δφ = φ2 - φ1&lt;br /&gt;
        Δλ = λ2 - λ1&lt;br /&gt;
        d  = distance between the two coordinates&lt;br /&gt;
        R  = earth’s radius (mean radius = 6,371km)&lt;br /&gt;
  Note: All the angles should be in radians.&lt;br /&gt;
&lt;br /&gt;
==== GPS Heading angle calculation ====&lt;br /&gt;
&lt;br /&gt;
[[File:Bearing Angle.JPG|500px|thumb|center|Bearing angle calculation ]]&lt;br /&gt;
&lt;br /&gt;
With reference to the figure, the Heading angle for GPS is the angle between the line joining the two coordinates and the true north. To calculate it graphically, draw a vector pointing towards the destination coordinates from the start point coordinate and measure the angle between the vector and the true north. Use the below formula to calculate the angle mathematically.&lt;br /&gt;
&lt;br /&gt;
  Heading angle(α) = atan2(sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ)&lt;br /&gt;
  where,&lt;br /&gt;
        φ1 = Latitude of 1st Coordinate&lt;br /&gt;
        φ2 = Latitude of 2nd Coordinate&lt;br /&gt;
        λ1 = Longitude of 1st Coordinate&lt;br /&gt;
        λ2 = Longitude of 2nd Coordinate&lt;br /&gt;
        Δλ = λ2 - λ1&lt;br /&gt;
&lt;br /&gt;
==== GPS Checkpoint Navigation ====&lt;br /&gt;
The car reads the value of current coordinates from the GPS module to determine its Euclidean distance from the first checkpoint. It also checks the value on the compass to know which direction it should preferably move in i.e. Heading angle. The sensor readings help it ascertain that there isn't an obstacle to hinder its movement in the determined direction.&lt;br /&gt;
&lt;br /&gt;
We have selected 23 checkpoints on the location where the demo is going to takes place and we have filled these coordinates in a Checkpoint Array as shown below.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Checkpoints.JPG|thumb|400px|left|thumb|Selected Checkpoints]]&lt;br /&gt;
|[[File:CheckPointsArray.JPG|thumb|350px|Right|thumb|Checkpoints Array]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The Car begins navigating its way from its current location to the final destination using enlisted checkpoints. When the car arrives at a first checkpoint, then GEO Controller will look into its GPS checkpoints constant array to look for next nearest checkpoint. &lt;br /&gt;
* While selecting Checkpoint we are using Linear Searching technique to select next checkpoint which is closer to the current location and as well as closer to the final destination.&lt;br /&gt;
&lt;br /&gt;
The Software state machine flow chart for GPS Navigation is shown below:&lt;br /&gt;
[[File:Cmpe243_TechSavy_GPS_Navigation.JPG|600px|thumb|centre|GPS Checkpoint Navigation]]&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
* '''Issues 1''' - GPS doesn’t retain configuration settings; GPS module was forgetting its baud setting of 57600bps configuration settings after a long run testing of GPS module(we kept GPS for overnight testing to capture logs of GPRMC to check its location consistency) before the implementation of Distance calculation so after 4-5 hours its start giving Null values for latitude and longitude after reviewing the logs of the data captured that was giving garbage data as UART baud mismatching gives then it has to be configured again that means baud rate setting using PMTK command. &lt;br /&gt;
&lt;br /&gt;
  '''Solution''' - As per recommendation is given in Arduino Data sheet we should use default baud settings of 9600 later we never faced this issue and it was giving a good fix.&lt;br /&gt;
&lt;br /&gt;
*'''Issue 2''' - One of the most important thing with GPS is to get a quick fix. Our First Time to fix was coming approx 50seconds even in the open sky which is not good for self-driving car the moment engine of the car turns on we should have Coordinates of the car to navigate this to the destination location. So first Time to fix was one the hurdle for us.&lt;br /&gt;
&lt;br /&gt;
  '''Solution''' - We have followed one of the Arduino Forum in which one of the experts give few tips on how to improve this GPS Fix issue and one of the tips worked for us was the of the Cell battery with the voltage of more than 2.89v. This resolves GPS fix the issue for us. &lt;br /&gt;
&lt;br /&gt;
*'''Issue 3''' - Compass frequently losing its calibration when we were using CMPS11 in calibrated Mode.&lt;br /&gt;
  '''Solution''' - Using CMPS11 in default calibration mode helped us to get rid of this problem&lt;br /&gt;
&lt;br /&gt;
*'''Issue 4''' Ahhhh!! Faced task overrun issue with GPS NMEA data. When we were using NMEA parsing and shortest path algorithm in one task or even in two different tasks code was crashing like anything. However, NMEA parsing and Path Finding algorithm were working fine.&lt;br /&gt;
  '''Solution''' - Preet's easy parsing function(using sscanf) and his advice of using separate task using FreeRTOS helped us resolving this problem.&lt;br /&gt;
&lt;br /&gt;
*'''Issue 5''' During parsing of GPS Coordinates we have faced one issue with data type Float. Due to can transmission, we were using float data type for Latitude and longitude and what we have noticed that after getting data in string/char* and converting it to float then last two-three decimal places of latitude and longitude were changing frequently due to which Calculated distance from SOurce to destination was changing randomly even car is sitting at one location.&lt;br /&gt;
&lt;br /&gt;
  '''Solution''' - GPS coordinates require double datatype so, we took coordinates as double and then while sending data on CAN we were typecasting that to float. As we were doing all calculation related to coordinates, distance and checkpoints calculations on GEO Controller itself. So after doing all the calculations in double, we were type casting data to float and we were sending that to MASTER &amp;amp; BRIDGE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Bridge Controller Communication'''==&lt;br /&gt;
Bridge Controller is used for communication between the SJOne board and the android phone using the HC-05 Bluetooth module. The main purpose of the bridge Controller is to receive the start/stop command and destination location from the Android app. Bridge controller will transmit all the sensor information and debug information and this information will be displayed on the android app. &lt;br /&gt;
&lt;br /&gt;
* BRIDGE CONTROLLER Git Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/tech-savycmpe243/cmpe243_techsavy_rc_car/tree/master/Bridge_Controller_Module]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hardware Design===&lt;br /&gt;
'''Bluetooth Module Hardware Interfacing:'''&lt;br /&gt;
 &lt;br /&gt;
We are using an HC-05 Bluetooth module to send and receive the data from our android application to Controller. The Bridge controller is connected to the Bluetooth module through the Serial interface(UART2) of SjOne board and we have configured HC-05 at 38400 baud rate 8-bit data and 1 stop bit using modules Communication Mode. Bridge Controller is connected to other SJOne Boards using CAN bus. The Bluetooth module communicates with the SJOne board using UART communication at 38400 baud rate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ File: CmpE243_TechSavy_bridge_HC-05_pin_conf.png|679px|thumb|centre||HC-05 Module Hardware Interfacing]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the Car and the Android phone. &lt;br /&gt;
This module is based on the Cambridge Silicon Radio BC417 2.4 GHz BlueTooth Radio chip. This is a complex chip which uses an external 8 Mbit flash memory &lt;br /&gt;
It includes the Radio and Memory chips, 26 MHz crystal, antenna, and RF matching network. &lt;br /&gt;
The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
* '''HC-05 PinOut''' &lt;br /&gt;
 * EN:  In a case brought HIGH before power is applied, forces AT Command Setup Mode &lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD2 of SJOne board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD2 of SJOne board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
* '''LED Blinking signals'''&lt;br /&gt;
 * Flashing RED Fast: Ready for Pairing with nearby Bluetooth device available&lt;br /&gt;
 * Flashing RED Slow: Paired and Connected&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
[[File:tasktableBle.png]]&lt;br /&gt;
[[File:Flowchart-reception-1.jpeg]]&lt;br /&gt;
[[File:BleTransmission.png]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
* Android App was crashing due to the parsing function when there was no GPS data coming from the Bluetooth module. To solve this problem we added checks in the bridge controller to not to send GPS data if the GPS is not yet fixed. &lt;br /&gt;
* Bridge controller's task was getting overrun when used snprint and printf in a task. (printf was just used for initial testing).Then after debugging, we found this problem and removed printf. snprintf and sprintf are working fine in 100Hz function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Master Module'''==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
====Design and Implementation====&lt;br /&gt;
*As name suffice, Master Node acts as the brain of the RC car and gives controlled signals to every other module. &amp;lt;br&amp;gt;&lt;br /&gt;
*It manages the communication among all the modules, including Motor, Sensor, Geographical and Bridge Controller.&amp;lt;br&amp;gt;&lt;br /&gt;
*Master receives periodically data from CAN bus based on message ID of the sender module.&amp;lt;br&amp;gt;&lt;br /&gt;
*Below shows the connection of Master module on the CAN bus, connected with CAN Transceiver.&lt;br /&gt;
[[ File: techsavy_master_can.png|679px|thumb|centre||Master-CAN Interfcaing]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
*As the Master takes all the decisions, it has the highest priority and hence the lowest message Id on CAN DBC.&lt;br /&gt;
*Figure illustrates the high-level bus flow from master to every module.&lt;br /&gt;
[[ File: cmpe243_techsavy_master.gif|679px|thumb|centre||Master Control Flow]]&lt;br /&gt;
====Implementation====&lt;br /&gt;
'''Heartbeat Message of All Modules'''&lt;br /&gt;
*As Master node handles all the communication from other modules, each node continuously sends its heartbeat to master, confirming that it is active and working properly. &lt;br /&gt;
* If all the heartbeats are not received by the master, it sends STOP command to bridge so CAR doesn't run into a stage when any one of a node is not working. This mechanism provides us to eliminate running into an error state.&lt;br /&gt;
* If the heartbeat is not received, Master handles this using MIA.&lt;br /&gt;
*Code below displays heartbeat synchronization and MIA handling of all nodes.&lt;br /&gt;
&lt;br /&gt;
   bool hbt_sync_from_all_node(void)&lt;br /&gt;
   {&lt;br /&gt;
     is_hbt_sync_flag = sensor_hbt_sync &amp;amp; motor_hbt_sync &amp;amp; gps_hbt_sync &amp;amp; bridge_hbt_sync;&lt;br /&gt;
     return is_hbt_sync_flag;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   void master_mia_handler(void)&lt;br /&gt;
   {&lt;br /&gt;
     if (dbc_handle_mia_SENSOR_HEARTBEAT(&amp;amp;sensor_hbt, 25))&lt;br /&gt;
     {&lt;br /&gt;
        sensor_hbt_sync = false;&lt;br /&gt;
     }&lt;br /&gt;
     if (dbc_handle_mia_MOTOR_HEARTBEAT(&amp;amp;motor_hbt, 25))&lt;br /&gt;
     {&lt;br /&gt;
        motor_hbt_sync = false;&lt;br /&gt;
     }&lt;br /&gt;
     if (dbc_handle_mia_GPS_HEARTBEAT(&amp;amp;gps_hbt, 25))&lt;br /&gt;
     {&lt;br /&gt;
        gps_hbt_sync = false;&lt;br /&gt;
     }&lt;br /&gt;
     if (dbc_handle_mia_BRIDGE_HEARTBEAT(&amp;amp;bridge_hbt, 25))&lt;br /&gt;
     {&lt;br /&gt;
        bridge_hbt_sync = false;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
[[File:master_led.jpg|400x300px|thumb|center|Heartbeat LED of all nodes on Master]]&lt;br /&gt;
&lt;br /&gt;
=== Testing and Technical Challenges ===&lt;br /&gt;
* Delay in sending steer command to the motor.&lt;br /&gt;
** Initially there was some delay observed while receiving the sensor obstacle information and sending relevant command to motor, because of this synchronization problem we were suffering from the delayed response.&lt;br /&gt;
** After plenty of hardware and software debugging, we noticed the buffer size of CAN RX/TX was much larger than required. It was corrected on sensor and motor side as well.&lt;br /&gt;
* Taking time in reversing even though the reverse command was send&lt;br /&gt;
** Motor took time to reverse as it has to break it's PID loop.&lt;br /&gt;
** The solution to this was to send a stop command(0), before sending the reverse command.&lt;br /&gt;
&amp;lt;Bullet or Headings of a module&amp;gt;&lt;br /&gt;
==== Improper Unit Testing ====&lt;br /&gt;
* The problem of CAN buffer described above was detected by Unit Testing itself.&lt;br /&gt;
** Along with that bug, I found few more bugs from unit testing the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
====1. Enable Bluetooth and Connect to bridge controller====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the car takes places with communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the car parameters.&lt;br /&gt;
&lt;br /&gt;
The android app connects to the HC-05 BLE module of the bridge controller. The Bluetooth ask the user for permission to access location and prompts to enable Bluetooth if it's already OFF. Our app is designed to connect to only TechSavy Bluetooth module and no other Bluetooth device to ease the setup of Bluetooth communication. A Bluetooth adapter connects to the HC-05 module and opens a Bluetooth Socket over which read and write messages are sent. A thread runs in the background which checks for available data, reads it and the data can then be processed. Data is written via the same Bluetooth socket. Refer to the following link to get started with Bluetooth on Android app and connection to HC-05 module ([http://mcuhq.com/27/simple-android-bluetooth-application-with-arduino-example]).&lt;br /&gt;
&lt;br /&gt;
====2. Start/Stop Command and Log Sensor values====&lt;br /&gt;
&lt;br /&gt;
Start and Stop commands are sent to the RC car via the application. When Start/Stop button is pressed 1 or 0 commands are sent to the bridge controller when then transmits it to the CAN Bus for processing. Bluetooth status, Sensor Values, Motor parameters, GPS location, compass heading angle, distance to the checkpoint is displayed for debugging purpose. Sensor, GPS, motor Messages coming from CAN bus are decoded by the bridge controller and sent to the Android application as a string. The android app parses the string and categorizes the data to store it in appropriate variables. The data is then displayed as a text view in Bluetooth activity. To visit the Map Activity for setting destination and checkpoints a button is added. The map Activity opens on pressing the button.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Bluetooth_app.jpg|230px|thumb|The user is asked to enable Bluetooth]]&lt;br /&gt;
|[[File:location1.jpg|230px|thumb|User should allow to enable Location]]&lt;br /&gt;
|[[File:app_log2.jpeg|250px|thumb|Connecting to the Tech Savy CAR]]&lt;br /&gt;
|[[File:app_log.jpeg|250px|thumb|Connected to the module]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====3. Map Activity====&lt;br /&gt;
&lt;br /&gt;
The map activity is used in our app to show the current location of the car and set the destination marker which the car will navigate too. When map loads in the app the cars current location is indicated coming from the GPS as the source location (Red Marker). The desired location on the map can be set as the destination by long clicking on the map (Light Green marker).  The destination can be changed as desired by long pressing again. When the start button is pressed command 1 is sent to the CAN bus via Bluetooth to start the car. A thread starts in the background to indicate the current position of the car when the car moves (light blue marker). Also, a polyline is drawn between the source and destination marker to indicate the direction in which the car will move. For adding Google map to app refer the following [https://www.udemy.com/the-complete-android-oreo-developer-course/](Refer to Maps and geolocation section)&lt;br /&gt;
&lt;br /&gt;
[[File:Map1.jpeg|300px]]        [[File:Car_stop.jpeg|275px]]&lt;br /&gt;
&lt;br /&gt;
=== Testing and Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
1. We faced the problem of adding Bluetooth functionality in the app. There is a lack of tutorials online which shows how to develop an android app with Bluetooth capability and communicating with the HC-05 module. Fortunately, we found this webpage [http://mcuhq.com/27/simple-android-bluetooth-application-with-arduino-example] which helped us and Youtube videos of Coding with Mitch.&lt;br /&gt;
&lt;br /&gt;
2. It was difficult to design the UI on the app with little java and Android experience. We designing UI from mainly two resources [https://www.udemy.com/the-complete-android-oreo-developer-course/] [http://www.deitel.com/Books/Android/Android6forProgrammersAnAppDrivenApproach/tabid/3671/Default.aspx]and searching online for problems faced by us.&lt;br /&gt;
&lt;br /&gt;
3. Initially, we developed the app such that we had to manually connect to a paired device to use Bluetooth functionality. This gave us problems while sending commands to the bridge controller. We solved this problem by fixing the device connection only to our HC-05 module and adding only a single Bluetooth connection button on the app bar for Bluetooth connection.&lt;br /&gt;
&lt;br /&gt;
4. When we received too many sensor values and debug messages from the bridge controller continuously, the app was crashing due to the input buffer overflow. We solved this problem by adding a 1000ms sleep time to limit the input data coming to the app.&lt;br /&gt;
&lt;br /&gt;
5. There was a requirement to continuously update a marker on the map indicating the current location of the car for user feedback. We achieved this using a thread in the background which updated cars position every 1 second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&lt;br /&gt;
* '''For Master Controller'''&lt;br /&gt;
** Don't make your obstacle avoidance complex by implementing reverse condition. Just keep your code simple.&lt;br /&gt;
** One good approach a developer should follow is to unit test their own code. Would you buy a product which is suppose to be tested later?&lt;br /&gt;
** Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
** For this controller, one should know the basics in C/ C++ and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* '''For Hardware Team'''&lt;br /&gt;
** Order Hardware and Components as early as possible.&lt;br /&gt;
** Select components wisely don't try to save money on this part of the project as bad quality hardware can't help you even with best software implementation.&lt;br /&gt;
** Try to power up all modules using 6V coming from LiPo battery. Use IC boosters for converting 6V to 5V and 3.3V. This way there won't be a need of separate power bank and overall weight will be reduced.&lt;br /&gt;
** While designing PCB keep the tracing width of power lines to 1 mm so that sufficient current can be pass through it.&lt;br /&gt;
** PCB spacing should be 12-15 mil.&lt;br /&gt;
** To reduce the magnetic interference from DC Motor, place the compass on the center or near the front side of the car at a height using standoffs.&lt;br /&gt;
** Another alternative to standoffs could be implementing ground rings for compass and GPS Antenna which allows passing the EMI directly to the ground.&lt;br /&gt;
** Get more samples of CAN transceiver IC's as it can get damaged easily.&lt;br /&gt;
* '''For SENSOR Controller Team'''&lt;br /&gt;
** LIDAR - It has some limitations when tests/demo takes place in bright sunlight. when direct light falls on it, so gives faulty readings.&lt;br /&gt;
** LIDAR Consumes more power, hence need a separate power source for it due to which battery consumption of overall CAR is double as compared to the CAR use ultrasonic sensors for obstacle detection.&lt;br /&gt;
** LIDAR is not even cost effective hence should use Ultrasonic instead we realized it very late.&lt;br /&gt;
** Sensor Implementation doesn't need any averaging or complex algorithms.&lt;br /&gt;
* '''For GEO Controller Team'''&lt;br /&gt;
** Suggestions for GEO Controller software development is used FreeRTOS separate Tasks instead of using periodic tasks for NMEA receiving and parsing.&lt;br /&gt;
** For GPS Checkpoint navigation use simple and stupid coding no need to implement Dijkstra and complex algorithms for short distance calculation on Geo Controller linear or binary searching technique is enough to implement it successfully. &lt;br /&gt;
** For Compass use default calibration mode no need to add any checks and calibrations. Factory mode should be enough to get accurate results.&lt;br /&gt;
* '''For Motor Controller Team'''&lt;br /&gt;
** Use global pointers while using PWM drivers of SJONE board and set the frequency appropriately before testing it on motor(50Hz or 100Hz is fine).&lt;br /&gt;
** Calibrate the ESC first for any RC car you purchase and get that right or the DC motor wont work.&lt;br /&gt;
** Clear the CAN buffer periodically or the car might react to the commands with some delay.&lt;br /&gt;
* '''Tips for getting GOOD Grades and to remain in top 3 teams'''&lt;br /&gt;
** Select your team mates wisely, and make sure every one dedicates them self for this project.&lt;br /&gt;
** Be an active member of your team and review rubrics every week before going to demonstrate your CAR.&lt;br /&gt;
** As soon as the professor mentioned about the project please start working on the project right from the beginning otherwise at the end you have struggled with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
** Although you can get lots of information from seniors still don't take this project light this is a really interesting and challenging project.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Compass_UnitTesting.JPG|300px|thumb|right|Unit Testing Report Example]]&lt;br /&gt;
&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries these days. We worked as a team of eight which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like &lt;br /&gt;
&lt;br /&gt;
* CAN bus: &lt;br /&gt;
** Using this bus, we were able to communicate with five devices connected which each other.&lt;br /&gt;
** Also, we learnt how to debug and interpret CAN message using BusMaster.&lt;br /&gt;
* LIDAR and ultrasonic sensor:&lt;br /&gt;
** At start we felt LIDAR would be easy to use because it gives us the obstacle data for all 360 degree. But as we started using it, we found out that keeping wider angle does not give us accurate data. Then we realised that at after certain distance the angles intersect with each other because of angle spread and we get the same reading for both angle zone. So we selected our angle zone precisely and accurately by doing some trials and error.&lt;br /&gt;
* PCB designing: &lt;br /&gt;
** We realised that using GPP for long term is not a good idea because every time our car crashed, there were some breakdown in the wires and our CAN bus stopped working. Initially we spent a lot of time debugging hardware and doing soldering. &lt;br /&gt;
** So the hardware team started designing the PCB, and when our PCB was mounted on car, we spent hardly any time debugging the hardware.&lt;br /&gt;
* We learnt about NMEA data packets while working with GPS and came to know how google map Application actaully works with the help of GPS satellites in view for navigation.&lt;br /&gt;
* Unit testing : Unity and cmock framework are great tools for learning and it helped us to get great results in less amount of time. Unit testing of code is a must and should be adopted. &lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. &lt;br /&gt;
In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
[https://youtu.be/tvjshIk-hdA Tech Savy Project Video]&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;[https://gitlab.com/tech-savycmpe243/cmpe243_techsavy_rc_car]&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project.&lt;br /&gt;
We would also like to thank the Pratap(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== LIDAR ======&lt;br /&gt;
* [http://www.slamtec.com/en/Lidar/A1 RPLidar Documentation]&lt;br /&gt;
====== PID Control ======&lt;br /&gt;
* [http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction&amp;amp;section=ControlPID PID Controller Design]&lt;br /&gt;
* [https://robotics.stackexchange.com/questions/167/what-are-good-strategies-for-tuning-pid-loops  Good Strategies for PID Tuning]&lt;br /&gt;
====== LCD ======&lt;br /&gt;
* [http://www.4dsystems.com.au/downloads/Application-Notes/4D-AN-00017_R_1_01.pdf Connecting LCD to Host]&lt;br /&gt;
====== Android GUI ======&lt;br /&gt;
*  [https://developer.android.com/studio/write/image-asset-studio.html Create App Icons with Image Asset Studio]&lt;br /&gt;
*  [https://developer.android.com/training/basics/fragments/index.html Building a Dynamic UI with Fragments]&lt;br /&gt;
*  [https://www.youtube.com/playlist?list=PL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl Android Tutorial]&lt;br /&gt;
====== Google Maps ======&lt;br /&gt;
* [https://developer.android.com/training/maps/index.html Adding Maps]&lt;br /&gt;
* [https://developers.google.com/maps/documentation/android-api/marker Markers]&lt;br /&gt;
* [https://developers.google.com/maps/documentation/directions/?authuser=1 Google Maps Directions API]&lt;br /&gt;
&lt;br /&gt;
====== PCB Design using DipTrace ======&lt;br /&gt;
* [https://diptrace.com/books/tutorial.pdf DipTrace Tutorial]&lt;br /&gt;
* [https://diptrace.com/forum/viewtopic.php?t=11533 Diptrace Forum FAQ-1]&lt;br /&gt;
* [https://diptrace.com/forum/viewtopic.php?t=10853 DipTrace Forum FAQ-2]&lt;br /&gt;
&lt;br /&gt;
==== Datasheets ====&lt;br /&gt;
&lt;br /&gt;
 [1] [https://www.maxbotix.com/documents/XL-MaxSonar-EZ_Datasheet.pdf XL-MaxSonar-EZ4 Ultrasonic Sensor]&lt;br /&gt;
 [2] [http://www.4dsystems.com.au/productpages/uLCD-32PTU/downloads/uLCD-32PTU_datasheet_R_2_2.pdf 4D Systems LCD]&lt;br /&gt;
 [3] [https://www.sparkfun.com/datasheets/DevTools/Arduino/MCP2551.pdf CAN Transceiver]&lt;br /&gt;
 [4] [https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ultimate-gps.pdf GPS Module]&lt;br /&gt;
 [5] [http://www.pishrobot.com/files/products/datasheets/cmps11.pdf Compass Module]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61295</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61295"/>
				<updated>2020-05-23T06:52:24Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation (Initial Iteration)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the &amp;lt;code&amp;gt;lcd_ui__update_ui&amp;lt;/code&amp;gt; function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of how one of our initial templates was setup.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/zkTs8o7nB6k Youtube Video]&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61294</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61294"/>
				<updated>2020-05-23T06:52:01Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation (Initial Iteration)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the &amp;lt;code&amp;gt;lcd_ui__update_ui&amp;lt;/code&amp;gt; function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of how one of our initial templates was setup.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
[https://youtu.be/zkTs8o7nB6k | Youtube Video]&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61292</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61292"/>
				<updated>2020-05-23T06:51:12Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation (Initial Iteration)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the &amp;lt;code&amp;gt;lcd_ui__update_ui&amp;lt;/code&amp;gt; function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of how one of our initial templates was setup.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
Youtube Video at [https://youtu.be/zkTs8o7nB6k]&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61287</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61287"/>
				<updated>2020-05-23T06:40:44Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation (Initial Iteration)]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the &amp;lt;code&amp;gt;lcd_ui__update_ui&amp;lt;/code&amp;gt; function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of how one of our initial templates was setup.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61286</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61286"/>
				<updated>2020-05-23T06:40:00Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* GLCD UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the &amp;lt;code&amp;gt;lcd_ui__update_ui&amp;lt;/code&amp;gt; function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of how one of our initial templates was setup.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61282</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61282"/>
				<updated>2020-05-23T06:37:46Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Git Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of how one of our initial templates was setup.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61280</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=61280"/>
				<updated>2020-05-23T06:36:08Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Advise for Future Students */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Team.jpg|thumb|center|800px| Group Picture]]&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : GPS, Compass, Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth Module&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB and common grounded the rest of the copper area.&lt;br /&gt;
'''DRC elements (in mils)'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|center|600px|PCB Top Layer]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|center|600px|PCB Bottom Layer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_CANHW.png|thumb|center|770px|  CAN Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/motor_bleeding_edge_dev GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_1.jpg|440px|thumb|center|| Servo Motor]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Servo Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - Servo Motor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| PWM Connected to P2.5 || PWM Signal from Sj-2 Board&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Electronic Speed Controller (ESC)=====&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_2.jpg|440px|thumb|center|| Electronic Speed Controller (ESC)]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.0 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====DC Motor=====&lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and a negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_3.jpg|320px|thumb|center|| DC Motor]]&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin-left:0px;&amp;quot;&lt;br /&gt;
|+ DC Motor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - DC Motor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Positive Wire (already connected) || Positive Terminal&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| Negative Wire (already connected || Negative Terminal&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px;&amp;quot;&lt;br /&gt;
|+ DC Motor Configuration&lt;br /&gt;
|-&lt;br /&gt;
! Operation&lt;br /&gt;
! Pulse Width Range (ms)&lt;br /&gt;
! Duty Cycle(%)&lt;br /&gt;
|-&lt;br /&gt;
! FORWARD &lt;br /&gt;
| 1.51 - 2.00 || 15.1-20.0&lt;br /&gt;
|-&lt;br /&gt;
! STOP&lt;br /&gt;
| 1.50 || 15.0&lt;br /&gt;
|-&lt;br /&gt;
! REVERSE&lt;br /&gt;
| 1.00 - 1.49 || 10.0-14.9&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_4.jpg|440px|thumb|center|| RPM Sensor]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: left;&amp;quot;&lt;br /&gt;
|+ Speed Sensor Pin Connection&lt;br /&gt;
|-&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Wires - RPM Sensor&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
! 1 &lt;br /&gt;
| Signal Wire Connected to P2.2 || GPIO that supplies pulses to controller&lt;br /&gt;
|-&lt;br /&gt;
! 2&lt;br /&gt;
| VCC || 6V supply from ESC &lt;br /&gt;
|-&lt;br /&gt;
! 3&lt;br /&gt;
| GND || Common Ground&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
*Servo Motor&lt;br /&gt;
*Electronic Speed Controller&lt;br /&gt;
*RPM Sensor&lt;br /&gt;
*Motor Wrapper&lt;br /&gt;
*Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Electronic Speed Controller=====&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|500px|  Feedback Loop for Motor Speed]]&lt;br /&gt;
&lt;br /&gt;
=====RPM Sensor=====&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Motor Wrapper=====&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|500px|  State Machine Flowchart for Motor Movements]]&lt;br /&gt;
&lt;br /&gt;
=====LiPo Battery Voltage=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LiPo Battery Voltage was calculated using ADC in Burst Mode. A LiPo Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Motor_Voltage_Regulator.png|thumb|center|400px| Voltage Regulator]]&lt;br /&gt;
'''LiPo Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LiPo Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''Getting LiPo Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count = 1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/geo_bleeding_edge_dev_waypoints GitLab Link]'''&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEO logic for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass ([https://www.robot-electronics.co.uk/htm/cmps11i2c.htm CMPS11 Datasheet])&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the vehicle depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/sensor_bleeding_edge_dev GitLab]'''&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5v source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11° - 30°&lt;br /&gt;
*Rear sector: 170° - 190°&lt;br /&gt;
*Left sector: 330° - 349°&lt;br /&gt;
*Front sector: 350° - 370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic Sensor====&lt;br /&gt;
*'''Power issue''' The pulses were getting triggered incorrectly and it took a while to figure out that it was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
====LIDAR====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bluetooth Module [Bridge and Sensor Controller]'''==&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
'''Bluetooth peripheral not turning on'''&lt;br /&gt;
* We initially connected the Bluetooth module directly to the SJ-Two board with (Vcc = 3.3v). But it was not giving only 2.7v and hence the device did not turn on.&lt;br /&gt;
* We had to connect it to external power source to make it function without hassles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
'''[https://gitlab.com/coder137/can-ster_truck/-/tree/driver_bleeding_edge_dev GitLab]'''&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
Technical Challenges faced during obstacle detection:&lt;br /&gt;
&lt;br /&gt;
*Due to dimensions of the car and for the perfect obstacle avoidance the values of 100cm and 150cm had to be selected for the turning radius. Hence, it is very important to calibrate these values appropriately, as these values will be unique for different car designs.&lt;br /&gt;
*For a situation, where even if the lidar doesn’t detect any obstacle at the middle, the car must take a slight right or a slight left as per our design. This is the case where the obstacle can be a moving one and that is why the lidar middle couldn’t detect it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_LCD_Diagram.png|thumb|600px|center| LCD Design]]&lt;br /&gt;
{|style=&amp;quot;text-align: center; width: 400px; height: 200px; margin: auto;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD.jpg|thumb|200px|center| GLCD Hardware]]&lt;br /&gt;
||&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_GLCD2.jpg|thumb|600px|center| GLCD Software Simulation]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&lt;br /&gt;
=====Low-Level Initialization=====&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&lt;br /&gt;
=====GLCD Wrapper for Widgets=====&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&lt;br /&gt;
=====GLCD UI=====&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
*The GLCD needs to be supplied appropriate voltage (5V) at 1A for it to work properly. The LCD does not turn on without an appropriate power supply&lt;br /&gt;
*The GLCD UART interface has an additional RES signal. This RES signal resets the GLCD when pulled low. When connecting the UART display it is recommended to always reset the GLCD display for proper working&lt;br /&gt;
*The GLCD has a latency of up to 30ms when querying and receiving data. In our case, the real-time system has hard caps on time (i.e up to 1second of delay is possible on the 1Hz function)&lt;br /&gt;
*This was rectified by putting the read functions (if any) inside the low priority 1Hz periodic_callback function.&lt;br /&gt;
*Write operations do not suffer from such a latency issue since they only send one byte (ACK or NACK) signal back.&lt;br /&gt;
*Fortunately most of our logic involved just a write (setting a value on the GLCD) rather than reading or querying the widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|220px|Info Activity (Top)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android7.jpg|thumb|none|220px|Info Activity (Middle)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|220px|Info Activity (Bottom)]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|220px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF1.gif|thumb|center|220px|App Animations]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster_Truck_Android_GIF2.gif|thumb|center|220px|Live Location]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
=====Main Activity=====&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
=====Map Activity=====&lt;br /&gt;
* For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
* Destination marker(Red Marker) is set using &amp;lt;code&amp;gt;setOnMapClickListener&amp;lt;/code&amp;gt; to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using &amp;lt;code&amp;gt;setOnMarkerClickListener&amp;lt;/code&amp;gt;.&lt;br /&gt;
* When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
* When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
=====Info Activity=====&lt;br /&gt;
* Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
* The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
* Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
=====Debug Activity=====&lt;br /&gt;
*The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
=====Bluetooth Connection Service Activity=====&lt;br /&gt;
*This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
* Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following &amp;lt;code&amp;gt;UUID: 00001101-0000-1000-8000-00805F9B34FB&amp;lt;/code&amp;gt;. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
* Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
* Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
**All messages for activities are done by &amp;lt;code&amp;gt; Handler mHandler.obtainMessage(); mHandler.sendMessage(); &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Receieved string:'''&lt;br /&gt;
* A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Manifest:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_FINE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    implementation fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-maps:17.0.0'&lt;br /&gt;
    compile 'com.google.maps.android:android-maps-utils:0.4+'&lt;br /&gt;
    implementation 'androidx.cardview:cardview:1.0.0'&lt;br /&gt;
    implementation 'com.google.android.gms:play-services-location:17.0.0'&lt;br /&gt;
    implementation 'androidx.appcompat:appcompat:1.1.0'&lt;br /&gt;
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'&lt;br /&gt;
    implementation 'com.android.support:design:28.0.0'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-fragment:2.2.1'&lt;br /&gt;
    implementation 'androidx.navigation:navigation-ui:2.2.1'&lt;br /&gt;
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
*'''Bluetooth Discovery:''' While creating the android application, we were not able to see any Bluetooth devices in the paired device list. The problem was that for the Android versions above Lillipop we would also need location access. We have solved it by writing a function to check whether to check for permissions or not.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private void checkBluetoothPermissions() {&lt;br /&gt;
        Log.d(TAG, &amp;quot;checkBTPermissions: Checking permissions&amp;quot;);&lt;br /&gt;
        int permission_check = this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_FINE_LOCATION&amp;quot;);&lt;br /&gt;
        permission_check += this.checkSelfPermission(&amp;quot;Manifest.permission.ACCESS_COARSE_LOCATION&amp;quot;);&lt;br /&gt;
        if (permission_check != 0) {&lt;br /&gt;
            this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1001); //Any number&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            Log.d(TAG, &amp;quot;checkBTPermissions: No need to check permissions. SDK version &amp;lt; LOLLIPOP.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*'''Catching NULL in a StringTokenizer: ''' When sending data using Bluetooth sometimes thee app crashes. Using debug Run log in Android Studio IDE, we have found out that this is because we get &amp;lt;code&amp;gt; NullPointerException, java.util.StringTokenizer &amp;lt;/code&amp;gt;  error. This is mainly due to passing a null value to the StringTokenizer constructor. This problem can be avoided by after reading a line from the Bluetooth StringBuffer, we check whether it is null, before passing it to the StringTokenizer, but later on, we have preferred to use &amp;lt;code&amp;gt;split();&amp;lt;/code&amp;gt; to prase the received string as StringTokenizer is now a legacy class that is retained for compatibility reasons and its use is discouraged in new code.&lt;br /&gt;
&lt;br /&gt;
*'''XML Layouts: ''' Generating layouts is difficult for new android code developers, the design layouts made should be compatible for a wide range of mobile devices but using the new android libraries we have found that, the older phones then tend to have difficulty in showing the layouts correctly. We have solved this problem by learning the design commercial XML design layouts by following tutorials on Udemy and Youtube. &lt;br /&gt;
&lt;br /&gt;
*'''Auto Connect''': During the first stages we have implemented Bluetooth connection via searching for all devices and clicking on the device from Listpair to connect. This has a lot of time to process all the discovered devices near range. To solve this we have hardcoded the HC-05 device address &amp;lt;code&amp;gt;00:14:03:06:02:83&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mBluetoothAdapter.getRemoteDevice(&amp;quot;device address&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Management''' ==&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───lidar&lt;br /&gt;
│   ├───motor&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great and memorable journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
* [https://gitlab.com/coder137/can-ster_truck GitLab Link]&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Make sure your early structure of the project is decided. Before you start to write the code make sure that all the team and code guidelines are discussed. In our case we spent most of our first week deciding how we wanted to structure and design our code. This paid off in the long run since we had robust code inside one repository that could be extended efficiently.&lt;br /&gt;
* Make sure each module is individually testable i.e through periodic callbacks as well as unit-tests. While unit-tests can help for a lot of situations and provide a robust way to map the working of the module, it cannot simulate certain real-life scenarios. For example, Lidar buffer was constantly getting full due to the large number of incoming bytes. This caused us to have certain incorrect reading appear after a few minutes of the lidar running. Our solution was to minimize the &amp;lt;code&amp;gt;printf&amp;lt;/code&amp;gt; statements inside the module that were used for debugging.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power source.&lt;br /&gt;
* Isolate the power hungry devices to other parallel connections so that the voltage drop is not high. In our case the Graphical LCD and LIDAR were both very power hungry peripherals. The LCD used to start glitching incase there was a large voltage drop and the LIDAR used to give incorrect values or not update correctly. We solved this issue by giving the lidar a dedicated power supply.&lt;br /&gt;
* PCB design involves lot of hardware components. Coordinating with multiple team members and verifying each hardware connection takes quite some time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
* You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
* Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
* CAN Reference [https://www.kvaser.com/about-can/can-dictionary/]&lt;br /&gt;
* FreeRTOS Reference [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial]&lt;br /&gt;
* Git tutorial [http://socialledge.com/sjsu/index.php/Basic_Git_Tutorial]&lt;br /&gt;
* Unit-test reference [https://gitlab.com/sibros_public/public/-/wikis/c/unit_tests#lab-1]&lt;br /&gt;
* Getting started with SJ-Two [https://sjsu-dev2.readthedocs.io/en/latest/getting_started/getting_started/]&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
* Traxxas User Manual: [https://images-na.ssl-images-amazon.com/images/I/D1NTpa7RNES.pdf]&lt;br /&gt;
* Traxxas Specification Sheet: [https://images-na.ssl-images-amazon.com/images/I/81WphBAuwIL.pdf]&lt;br /&gt;
&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts (Calculate distance, bearing and more between Latitude/Longitude points): [https://www.movable-type.co.uk/scripts/latlong.html]&lt;br /&gt;
* CMPS11 (I2C Configuration): [https://www.robot-electronics.co.uk/htm/cmps11i2c.htm]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
* [https://www.slamtec.com/en/Lidar/A1 LIDAR]&lt;br /&gt;
* [https://components101.com/ultrasonic-sensor-working-pinout-datasheet Ultrasonic sensor ]&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
* LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
* Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
* Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
* Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
* Design Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60355</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60355"/>
				<updated>2020-05-22T05:49:45Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* GEO Logic Module Computation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
=====LIPO Battery Voltage=====&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Get Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
* Distance between source and final destination (DISTsd)&lt;br /&gt;
* Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
* Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was lesser than '''DISTcd''', this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsd''' was greater than '''DISTcd''', then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to '''DISTsd'''.&lt;br /&gt;
&lt;br /&gt;
If '''DISTsc''' was lesser than the minimum value stored, '''DISTsc''' would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60354</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60354"/>
				<updated>2020-05-22T05:48:04Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* GEO Logic Module Computation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
=====LIPO Battery Voltage=====&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Get Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
&lt;br /&gt;
-	Distance between source and final destination (DISTsd)&lt;br /&gt;
&lt;br /&gt;
-	Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
&lt;br /&gt;
-	Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
&lt;br /&gt;
If DISTsd was lesser than DISTcd, this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
&lt;br /&gt;
If DISTsd was greater than DISTcd, then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to DISTsd.&lt;br /&gt;
&lt;br /&gt;
If DISTsc was lesser than the minimum value stored, DISTsc would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60350</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60350"/>
				<updated>2020-05-22T05:44:35Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
=====LIPO Battery Voltage=====&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Get Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
-	Distance between source and final destination (DISTsd)&lt;br /&gt;
-	Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
-	Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
If DISTsd was lesser than DISTcd, this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
If DISTsd was greater than DISTcd, then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to DISTsd.&lt;br /&gt;
If DISTsc was lesser than the minimum value stored, DISTsc would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&lt;br /&gt;
'''Low-Level Layer'''&lt;br /&gt;
&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''Application Layer'''&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60348</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60348"/>
				<updated>2020-05-22T05:42:51Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
=====LIPO Battery Voltage=====&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Get Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
-	Distance between source and final destination (DISTsd)&lt;br /&gt;
-	Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
-	Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
If DISTsd was lesser than DISTcd, this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
If DISTsd was greater than DISTcd, then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to DISTsd.&lt;br /&gt;
If DISTsc was lesser than the minimum value stored, DISTsc would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Low-Level Layer&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; were implemented.&lt;br /&gt;
As the name suggested, &amp;lt;code&amp;gt;bt__write&amp;lt;/code&amp;gt; took a string as its input parameter and transmitted that data to the Android application. &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;li&amp;gt;Application Layer&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;read_once&amp;lt;/code&amp;gt; function internally just called the &amp;lt;code&amp;gt;bt__read&amp;lt;/code&amp;gt; function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;code&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;code&amp;gt;$stop&amp;lt;/code&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;write_once&amp;lt;/code&amp;gt; function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;code&amp;gt;$canster&amp;lt;/code&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60347</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60347"/>
				<updated>2020-05-22T05:38:11Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* GEO Logic Module Computation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
=====LIPO Battery Voltage=====&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Get Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
-	Distance between source and final destination (DISTsd)&lt;br /&gt;
-	Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
-	Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
If DISTsd was lesser than DISTcd, this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
If DISTsd was greater than DISTcd, then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to DISTsd.&lt;br /&gt;
If DISTsc was lesser than the minimum value stored, DISTsc would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Low-Level Layer&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions '''bt__read''' and '''bt__write''' were implemented.&lt;br /&gt;
As the name suggested, '''bt__write''' took a string as its input parameter and transmitted that data to the Android application. '''bt__read''' stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;li&amp;gt;Application Layer&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate '''read_once''' and '''write_once''' functions.&lt;br /&gt;
&lt;br /&gt;
The `read_once` function internally just called the '''bt__read''' function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;pre&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;pre&amp;gt;$stop&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The '''write_once''' function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;pre&amp;gt;$canster&amp;lt;/pre&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60346</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60346"/>
				<updated>2020-05-22T05:36:17Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Motor Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
=====LIPO Battery Voltage=====&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The voltage divider circuit is stepped down from 7.4V to 2.1V using 10K and 4K Resistor pair.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Initialization'''&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
'''LIPO Get Voltage'''&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
Formula:	θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
-	Distance between source and final destination (DISTsd)&lt;br /&gt;
-	Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
-	Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
If DISTsd was lesser than DISTcd, this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
If DISTsd was greater than DISTcd, then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to DISTsd.&lt;br /&gt;
If DISTsc was lesser than the minimum value stored, DISTsc would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Low-Level Layer&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions '''bt__read''' and '''bt__write''' were implemented.&lt;br /&gt;
As the name suggested, '''bt__write''' took a string as its input parameter and transmitted that data to the Android application. '''bt__read''' stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;li&amp;gt;Application Layer&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate '''read_once''' and '''write_once''' functions.&lt;br /&gt;
&lt;br /&gt;
The `read_once` function internally just called the '''bt__read''' function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;pre&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;pre&amp;gt;$stop&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The '''write_once''' function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;pre&amp;gt;$canster&amp;lt;/pre&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60342</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=60342"/>
				<updated>2020-05-22T05:32:56Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Motor Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CMPE243_S20_T2_Canster_Truck_Logo.png|thumb|455px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
== '''Abstract''' ==&lt;br /&gt;
'''The Canster Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS, Compass and CAN modules) was divided among six team members. The aim of the project is to develop an autonomous RC Car which can navigate from one source location to the selected destination on the app by avoiding obstacles in its path using sensors. Waypoints algorithm is used as the path finding technique.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Introduction and Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
'''The project was divided into 7 modules:'''&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt; &lt;br /&gt;
* &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
* &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC Car Objectives'''&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;1. Driver and LCD Controller&amp;lt;/font color&amp;gt;''' - Handles algorithms for obstacle avoidance, route maneuvering, and waypoints&lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;2. Geological Controller&amp;lt;/font color&amp;gt;''' - Recieves coordinates from GPS and Heading from Compass for navigation &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;3. Motor Controller&amp;lt;/font color&amp;gt;''' - Controls movements of the RC Car &lt;br /&gt;
      '''&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;4. Bridge and Sensor Controller&amp;lt;/font color&amp;gt;''' - Detects surrounding objects and interfaces android application to controller via bluetooth&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_High_Level_System_Diagram.png|thumb|center|800px| High Level System Diagram]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Members and Responsibilities''' ==&lt;br /&gt;
&lt;br /&gt;
'''Gitlab Project Link''' - [https://gitlab.com/coder137/can-ster_truck  '''Canster Truck''']&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Niket Naidu''' [https://www.linkedin.com/in/niket-naidu-30090a134/  LinkedIn] [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological Controller'''&amp;lt;/font color&amp;gt; : Waypoint Algorithm, Haversine and Bearing Angle logic &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt; : GLCD&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt; : Bluetooth&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ganesh Ram Pamadi''' [https://www.linkedin.com/in/ganeshram93/  LinkedIn] [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;F1C40F&amp;quot;&amp;gt; '''Testing &amp;amp; Code Review'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Driver Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Nikhil Pabbisetty'''  [https://www.linkedin.com/in/nikhilpabbisetty/  LinkedIn] [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Akhil Cherukuri''' [https://www.linkedin.com/in/akhilcherukuri/  LinkedIn] [https://gitlab.com/akhilcherukuri  Gitlab] [https://github.com/akhilcherukuri Github]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android Application'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Ashish Anant Ladage''' [https://www.linkedin.com/in/ashish-anant-ladage-7bb3a214b/  LinkedIn] [https://gitlab.com/ashishladage1  Gitlab] &lt;br /&gt;
** &amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver and LCD Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware Integration'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Jesus De Haro De Reza''' [https://www.linkedin.com/in/jesus-de-haro-66342424/  LinkedIn] [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
** &amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge and Sensor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
** &amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor Controller'''&amp;lt;/font color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
* '''Team Lead''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Git Repository Manager''' - [https://www.linkedin.com/in/niket-naidu-30090a134/  '''Niket Naidu'''] &lt;br /&gt;
* '''Bill Of Materials Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
* '''Wiki Report Manager''' - [https://www.linkedin.com/in/akhilcherukuri '''Akhil Cherukuri''']&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/11/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/17/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Form teams and decide group name'''&lt;br /&gt;
*'''Review past projects'''&lt;br /&gt;
*'''Slack: Create project group and invite Preet'''&lt;br /&gt;
*'''GitLab: Create project groups repository'''&lt;br /&gt;
*'''Analysis of component required'''&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/18/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/24/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Study CAN Communication'''&lt;br /&gt;
*'''Create Bill of Materials'''&lt;br /&gt;
*'''Order RC Car''' &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''02/25/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/02/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Setup team finance management using Splitwise application'''&lt;br /&gt;
*'''Complete Bill of Materials'''&lt;br /&gt;
*'''Order all other required components'''&lt;br /&gt;
*'''Wikipedia: Setup project report template'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/03/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/09/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Read the respective datasheets and manuals for each component'''&lt;br /&gt;
*'''Test each component for working conditions'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/10/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/16/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Assign team responsibilities and roles'''&lt;br /&gt;
*'''Setup team project management environment (ClickUp)''' &lt;br /&gt;
*'''Define CAN DBC'''&lt;br /&gt;
*'''Research GPS antennas and order'''&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Environmental setup of Android Studio and enable version control'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Decide PCB editing software (easyEDA)'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Draft schematic for required PCB design'''&amp;lt;/font&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/17/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/23/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Create model of PCB''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;32CD32&amp;quot;&amp;gt;'''Android: Add a Button for changing bluetooth connection status in the application''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface Compass module with SJ-2 board using I2C interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Interface GPS module with SJ-2 board using the UART interface''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Parse raw data to get meaningful values for GPS and Compass''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check the functionality of ultrasonic sensors to the SJ-2 board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Interface of Servo &amp;amp; DC motor to the SJ-2 board and check for basic functionality''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/24/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/30/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware : Finalize components placement on PCB.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Add PWM functionality and test the code on DC and servo motors''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Interface and check and study the output readings of Lidar sensor with SJ-2 board over UART''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD Display: Explore UI designing of LCD''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Finalize on optimal ultrasonic sensor placements''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and show staus via text view''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Establish final wiki schedule'''&lt;br /&gt;
*'''Complete CAN communication format for each controller and link DBC file to the Wiki'''&lt;br /&gt;
*'''Complete high-level system block diagram'''&lt;br /&gt;
*'''Complete unit-level block diagrams'''&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Interface HC-5 bluetooth module with Sj-2 board using serial communicaton'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''03/31/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/06/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Analyze PCB model and order PCB Circuit board''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Initiate Bluetooth communication and send &amp;quot;Hello World&amp;quot;.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Wikipedia: Start adding information/images/diagrams to the relevant sections''' &lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Configure ESC for correct speed outcome according to frequency &amp;amp; PWM values''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Finish RPM sensor hardware and software implementation and integration''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Sensor: Read output from Lidar and setup structure for outputting for DBC''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Implement waypoints algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Implement obstacle avoidance algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Pass data such as &amp;quot;Hello World&amp;quot; from HC-05 bluetooth module to bluetooth terminal android application'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''9'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/07/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/13/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Remove Unused parts from RC Car''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Mount PCB and 3D Parts''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Decide different cut-off values from sensor to command right /slight right/ straight/ slight left/ left to motor.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Embed Google Maps API for setting the car's destination.''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Work to show RC cars live status information(battery level, current speed, long, lat, bearing, sensor data, etc)''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''Driver: Test obstacle avoidance algorithm and fine-tune sensor readings''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;052EFA&amp;quot;&amp;gt;'''Geological: Test checkpoint algorithm''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Establish two way communication between android application and bluetooth module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Update Bill of Materials for miscellaneous hardware'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''10'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/14/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/20/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;A52A2A&amp;quot;&amp;gt;'''Hardware: Integrate all hardware modules''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;8911B9&amp;quot;&amp;gt;'''LCD: Testing &amp;amp; Validation of the LCD UI and display vehicle status information''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send car location to the app and checkpoints received to Geo module''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;00CED1&amp;quot;&amp;gt;'''Motor: Optimize PID control by accelerating/decelerating as instructed by Driver''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;DF7C24&amp;quot;&amp;gt;'''Bridge: Configure HC-05 for auto reconnection if bluetooth communication disconnects''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Add multiple debug messages and transmit on CAN'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''11'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/21/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/27/2020'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Send additional vehicle status information from RC car to the Application for display''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color= &amp;quot;32CD32 &amp;quot;&amp;gt;'''Android: Finalize User Interface Design and Icon''' &amp;lt;/font&amp;gt;&lt;br /&gt;
*'''Continuously test the whole system and handling of corner cases (outside).'''&lt;br /&gt;
*'''Finalize RC Car For Project Proto 1'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''12'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''04/28/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/04/2020'''&lt;br /&gt;
|&lt;br /&gt;
*'''Gitlab: Push final code''' &lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*'''Finalize RC Car for Project Demo'''&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*'''Finalize RC Car for Project Proto 2'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| '''13'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/05/2020'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |'''05/21/2020'''&lt;br /&gt;
|&lt;br /&gt;
* '''Complete Individual Contribution Peer Grading'''&lt;br /&gt;
* '''Review and Complete Wiki Project Page'''&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''Completed'''&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;'''In Progress'''&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bill Of Materials''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| '''Microcontroller Boards'''&lt;br /&gt;
| SJ2 Boards (Purchased from Preet Kang)&lt;br /&gt;
| 4&lt;br /&gt;
| $200.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| '''CAN Transceivers''' &lt;br /&gt;
| [https://www.waveshare.com/sn65hvd230-can-board.htm  Waveshare SN65HVD230]&lt;br /&gt;
| 12&lt;br /&gt;
| $54.48&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| '''RC Car''' &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| '''Lithium-Ion Battery'''&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| '''Lithium-Ion Battery Charger'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| '''Compass Breakout Board'''&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| '''Bluetooth Breakout Board'''&lt;br /&gt;
| [https://www.amazon.com/HC-05-Bluetooth-Pass-through-Wireless-Communication/dp/B01G9KSAF6/ref=sr_1_4?ie=UTF8&amp;amp;qid=1507077325&amp;amp;sr=8-4&amp;amp;keywords=arduino+bluetooth+hc-05  DSD TECH Bluetooth HC-05]&lt;br /&gt;
| 1&lt;br /&gt;
| $8.49&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| '''LIDAR Sensor'''&lt;br /&gt;
| [https://www.amazon.com/RPLiDAR-A1M8-Degree-Laser-Scanner/dp/B07H7X3SFF/ref=sr_1_fkmrnull_1?crid=2FSUI76G4UA8K&amp;amp;keywords=rplidar+a1m8+-+360+degree+laser+scanner+development+kit&amp;amp;qid=1552764172&amp;amp;s=gateway&amp;amp;sprefix=RPlidar%2Caps%2C263&amp;amp;sr=8-1-fkmrnull SEEED STUDIO RPLIDAR A1M8]&lt;br /&gt;
| 1&lt;br /&gt;
| $109.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| '''RPM Sensor'''&lt;br /&gt;
| [https://www.amazon.com/Traxxas-6520-RPM-Sensor-long/dp/B006IRXEZM  Traxxas 6520 RPM Sensor]&lt;br /&gt;
| 1&lt;br /&gt;
| $13.70&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| '''GPS Breakout Board'''&lt;br /&gt;
| [https://www.adafruit.com/product/746 Adafruit Ultimate GPS Breakout v3]&lt;br /&gt;
| 1&lt;br /&gt;
| $44.30&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| '''LCD Display'''&lt;br /&gt;
| [https://4dsystems.com.au/ulcd-32ptu 4Dsystems 3.2 TFT-LCD ULCD-32PTU]&lt;br /&gt;
| 1&lt;br /&gt;
| $79.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| '''Ultrasonic Sensors'''&lt;br /&gt;
| [https://www.amazon.com/gp/product/B01COSN7O6/ ELEGOO HC-SR04 Ultrasonic Module]&lt;br /&gt;
| 5&lt;br /&gt;
| $12.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| '''GPS Antenna'''  &lt;br /&gt;
| [https://www.amazon.com/dp/B07RRT615K/ GPS Antenna A1-UX]&lt;br /&gt;
| 1&lt;br /&gt;
| $10.98&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 14&lt;br /&gt;
| '''PCB Fabrication''' &lt;br /&gt;
| [https://jlcpcb.com/ JLCPCB]&lt;br /&gt;
| 5&lt;br /&gt;
| $40.15&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 15&lt;br /&gt;
| '''Miscellaneous''' &lt;br /&gt;
| [https://www.amazon.com Amazon],[https://www.mouser.com/ Mouser Electronics],[https://www.digikey.com/ Digikey],[https://anchor-electronics.com/ Anchor Electronics]&lt;br /&gt;
| ~&lt;br /&gt;
| $48.07&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| '''Total'''&lt;br /&gt;
| '''$1036.15'''&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
The complete PCB (for boards and hardware peripherals) was designed using EasyEDA online software. The 4 nodes will be communicating via CAN bus and other peripherals are connected to the PCB via headers.&lt;br /&gt;
&lt;br /&gt;
=== Power Section===&lt;br /&gt;
We have 2 power banks supplying our system. And the Servo Motor, RPM sensor and DC rear Motor (via ESC) are powered using LiPo battery (6 volts).&lt;br /&gt;
* Power bank #1 - Subset 2&lt;br /&gt;
&lt;br /&gt;
* Power bank #2 - Subset 1, Subset 3, Bluetooth&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
'''Subset 1:'''&lt;br /&gt;
 1. LIDAR&lt;br /&gt;
 2. LCD&lt;br /&gt;
 3. Compass&lt;br /&gt;
&lt;br /&gt;
'''Subset 2:'''&lt;br /&gt;
 1. Motor node&lt;br /&gt;
 2. Driver node&lt;br /&gt;
 3. BS node&lt;br /&gt;
&lt;br /&gt;
'''Subset 3:'''&lt;br /&gt;
 1. Geo node&lt;br /&gt;
 2. Back ultrasonic sensor&lt;br /&gt;
&lt;br /&gt;
=== Fabrication ===&lt;br /&gt;
* PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 and 2 layers of PCB with common grounded the entire copper area.&lt;br /&gt;
'''DRC elements'''&lt;br /&gt;
* Track Width = 12&lt;br /&gt;
* Clearance = 10&lt;br /&gt;
* Via Diameter = 24&lt;br /&gt;
* Via Drill Diameter = 12&lt;br /&gt;
&lt;br /&gt;
=== Challenges ===&lt;br /&gt;
* Auto-routing gave lot of challenges (only ~60% success) and sometimes the online server even crashes and faces downtime. Even local routing had lot of issues. So make sure to plan your design accordingly.&lt;br /&gt;
* We started our PCB design well ahead of the project. So lot of pre-planning had to be done with regard to final hardware and placement of components in order to avoid spending extra time and money while re-ordering.&lt;br /&gt;
* The PCB went through a lot of internal revisions even before placing order. This was time-consuming.&lt;br /&gt;
&lt;br /&gt;
'''Other hardware challenges:'''&lt;br /&gt;
* Figuring out why various hardware peripherals (GPS, Bluetooth, LIDAR and Ultrasonic sensor) started to malfunction (devices were on but values were either inconsistent / not occurring), took a lot of time to debug. It was due to insufficient power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243 S20 T2 EasyEDA.png|1040x1200px|thumb|center|PCB Layout Design in EasyEDA]]&lt;br /&gt;
[[File:CMPE243 S20 T2 PCB SCHEMATIC.jpg|1041x550px|thumb|center|PCB Schematic]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBFRONT.jpg|thumb|none|600px|PCB Top Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:CMPE243 S20 T2 PCBBACK.jpg|thumb|none|600px|PCB Bottom Layer]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''CAN Communication''' ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management, etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&lt;br /&gt;
DBC FILE: [https://gitlab.com/coder137/can-ster_truck/-/blob/dbc-improvements/projects/lpc40xx_freertos/project.dbc Gitlab]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VERSION &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NS_:&lt;br /&gt;
	BA_&lt;br /&gt;
	BA_DEF_&lt;br /&gt;
	BA_DEF_DEF_&lt;br /&gt;
	BA_DEF_DEF_REL_&lt;br /&gt;
	BA_DEF_REL_&lt;br /&gt;
	BA_DEF_SGTYPE_&lt;br /&gt;
	BA_REL_&lt;br /&gt;
	BA_SGTYPE_&lt;br /&gt;
	BO_TX_BU_&lt;br /&gt;
	BU_BO_REL_&lt;br /&gt;
	BU_EV_REL_&lt;br /&gt;
	BU_SG_REL_&lt;br /&gt;
	CAT_&lt;br /&gt;
	CAT_DEF_&lt;br /&gt;
	CM_&lt;br /&gt;
	ENVVAR_DATA_&lt;br /&gt;
	EV_DATA_&lt;br /&gt;
	FILTER&lt;br /&gt;
	NS_DESC_&lt;br /&gt;
	SGTYPE_&lt;br /&gt;
	SGTYPE_VAL_&lt;br /&gt;
	SG_MUL_VAL_&lt;br /&gt;
	SIGTYPE_VALTYPE_&lt;br /&gt;
	SIG_GROUP_&lt;br /&gt;
	SIG_TYPE_REF_&lt;br /&gt;
	SIG_VALTYPE_&lt;br /&gt;
	VAL_&lt;br /&gt;
	VAL_TABLE_&lt;br /&gt;
&lt;br /&gt;
BS_:&lt;br /&gt;
&lt;br /&gt;
BU_: DBG DRIVER IO MOTOR SENSOR GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER&lt;br /&gt;
 SG_ DRIVER_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; GEO,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 101 GEO_HEARTBEAT: 1 GEO&lt;br /&gt;
 SG_ GEO_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,MOTOR,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 102 MOTOR_HEARTBEAT: 1 MOTOR&lt;br /&gt;
 SG_ MOTOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,SENSOR&lt;br /&gt;
&lt;br /&gt;
BO_ 103 SENSOR_HEARTBEAT: 1 SENSOR&lt;br /&gt;
 SG_ SENSOR_HEARTBEAT_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER,GEO,MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 200 MOTOR_STEERING: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_STEERING_direction: 0|8@1- (1,0) [-2|2] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 210 DRIVER_COORDINATES: 8 DRIVER&lt;br /&gt;
 SG_ DRIVER_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ DRIVER_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 220 MOTOR_SPEED: 1 DRIVER&lt;br /&gt;
 SG_ MOTOR_SPEED_processed: 0|8@1- (1,0) [-3|3] &amp;quot;&amp;quot; MOTOR&lt;br /&gt;
&lt;br /&gt;
BO_ 300 GEO_DEGREE: 8 GEO&lt;br /&gt;
 SG_ GEO_DEGREE_current: 0|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
 SG_ GEO_DEGREE_required: 32|32@1+ (0.000001,0) [0|360] &amp;quot;degrees&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 310 GEO_DESTINATION_REACHED: 1 GEO&lt;br /&gt;
 SG_ GEO_DESTINATION_REACHED_cmd: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 400 MOTOR_SPEED_FEEDBACK: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_SPEED_current: 0|32@1+ (0.1,0) [0|60] &amp;quot;kph&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 500 SENSOR_BT_COORDINATES: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
 SG_ SENSOR_BT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; GEO&lt;br /&gt;
&lt;br /&gt;
BO_ 510 SENSOR_SONARS: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_SONARS_left: 0|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_right: 21|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_SONARS_middle: 42|21@1+ (0.001,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 520 SENSOR_LIDAR: 8 SENSOR&lt;br /&gt;
 SG_ SENSOR_LIDAR_middle: 0|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_left: 16|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_slight_right: 32|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
 SG_ SENSOR_LIDAR_back: 48|16@1+ (1,0) [0|0] &amp;quot;cm&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 530 MOTOR_KEY: 1 SENSOR&lt;br /&gt;
 SG_ MOTOR_KEY_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DRIVER&lt;br /&gt;
&lt;br /&gt;
BO_ 900 GEO_CURRENT_COORDINATES: 8 GEO&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_latitude: 0|32@1- (0.000001,-90) [-90|90] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
 SG_ GEO_CURRENT_COORDINATES_longitude: 32|32@1- (0.000001,-180) [-180|180] &amp;quot;degrees&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 901 GEO_DISTANCE_FROM_DESTINATION: 4 GEO&lt;br /&gt;
 SG_ GEO_distance_from_destination: 0|32@1+ (0.001,0) [0|0] &amp;quot;meters&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 902 MOTOR_INFO_DBG: 4 MOTOR&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_rps: 0|16@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
 SG_ MOTOR_INFO_DBG_pwm: 16|16@1+ (0.001,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 903 LIPO_BATTERY_VOLTAGE_DBG: 4 MOTOR&lt;br /&gt;
 SG_ LIPO_BATTERY_VOLTAGE_val: 0|32@1+ (0.01,0) [0|0] &amp;quot;volts&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
BO_ 904 CURRENT_CHECKPOINT_DBG: 1 GEO&lt;br /&gt;
 SG_ CURRENT_CHECKPOINT_val: 0|8@1+ (1,0) [0|0] &amp;quot;&amp;quot; DBG&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BU (Network Node) Information--&amp;quot;;&lt;br /&gt;
CM_ BU_ DRIVER &amp;quot;The driver controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ GEO &amp;quot;The geo controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ MOTOR &amp;quot;The motor controller of the car&amp;quot;;&lt;br /&gt;
CM_ BU_ SENSOR &amp;quot;The sensor controller of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--BO (Message) Information--&amp;quot;;&lt;br /&gt;
CM_ BO_ 100 &amp;quot;Driver Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 101 &amp;quot;Geo Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 102 &amp;quot;Motor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
CM_ BO_ 103 &amp;quot;Sensor Sync message used to synchronize the controllers&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 200 &amp;quot;Steering direction values sent by Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 210 &amp;quot;Driver Destination coordinates sent by Driver Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 220 &amp;quot;Required motor speed computed from Driver Node to Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 300 &amp;quot;Current and computer/required degree values sent by Geo Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 310 &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 400 &amp;quot;Current motor info (rps and kph) sent as feedback to the Driver Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 500 &amp;quot;Coordinate BT values (destination coordinates) sent by Sensor Node&amp;quot;;&lt;br /&gt;
CM_ BO_ 510 &amp;quot;LIDAR - Distance from obstacle detected in each sector&amp;quot;;&lt;br /&gt;
CM_ BO_ 520 &amp;quot;Ultrasonic Sensor - Distance from obstacle detected by each sensor&amp;quot;;&lt;br /&gt;
CM_ BO_ 530 &amp;quot;Start/Stop signal from the Bluetooth app&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ BO_ 900 &amp;quot;Destination coordinates for BUSMASTER debugging&amp;quot;;&lt;br /&gt;
CM_ BO_ 901 &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ BO_ 902 &amp;quot;Supplied PWM value to the motor and its RPM&amp;quot;;&lt;br /&gt;
CM_ BO_ 903 &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ BO_ 904 &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for Heartbeats--&amp;quot;;&lt;br /&gt;
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;Heartbeat command from the driver node&amp;quot;;&lt;br /&gt;
CM_ SG_ 101 GEO_HEARTBEAT_cmd &amp;quot;Heartbeat command from the geological node&amp;quot;;&lt;br /&gt;
CM_ SG_ 102 MOTOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the motor node&amp;quot;;&lt;br /&gt;
CM_ SG_ 103 SENSOR_HEARTBEAT_cmd &amp;quot;Heartbeat command from the sensor node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for DRIVER Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 200 DRIVER_STEERING_direction &amp;quot;Calculated Driver Steering values (-2,2) for Motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_latitude &amp;quot;Destination Latitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 210 DRIVER_COORDINATES_longitude &amp;quot;Destination Longitude coordinate&amp;quot;;&lt;br /&gt;
CM_ SG_ 220 MOTOR_SPEED &amp;quot;Calculated Driver speed values (-3,3) for Motor&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for GEO Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_current &amp;quot;Current Geo Degree relative to true north&amp;quot;;&lt;br /&gt;
CM_ SG_ 300 GEO_DEGREE_required &amp;quot;Calculated Geo Degree computed by Haversine Formula&amp;quot;;&lt;br /&gt;
CM_ SG_ 310 GEO_DESTINATION_REACHED &amp;quot;Indicator signal to check if the RC car has reached the destination&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for MOTOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 400 MOTOR_SPEED_FEEDBACK &amp;quot;Feedback speed (kph) sent by Motor Node&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ &amp;quot;--SG (Signal) Information for SENSOR Node--&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_latitude &amp;quot;Destination Latitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 500 SENSOR_BT_COORDINATES_longitude &amp;quot;Destination Longitude received over Bluetooth&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_left &amp;quot;Ultrasonic Sensor attached to the left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_right &amp;quot;Ultrasonic Sensor attached to the right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_middle &amp;quot;Ultrasonic Sensor attached to the middle&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_left &amp;quot;Ultrasonic Sensor attached to the back left side&amp;quot;;&lt;br /&gt;
CM_ SG_ 510 SENSOR_SONARS_back_right &amp;quot;Ultrasonic Sensor attached to the back right side&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_middle &amp;quot;Lidar sensing the middle sector (-15 to 15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_left &amp;quot;Lidar sensing the slight left sector (-45 to -15 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_slight_right &amp;quot;Lidar sensing the slight right sector (15 to 45 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 520 SENSOR_LIDAR_back &amp;quot;Lidar sensing the back of the car (165 to 195 degrees)&amp;quot;;&lt;br /&gt;
CM_ SG_ 530 MOTOR_KEY_val &amp;quot;1 -&amp;gt; Start the motor from the app, 0 -&amp;gt; Stop&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_latitude &amp;quot;Current Latitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 900 GEO_CURRENT_COORDINATES_longitude &amp;quot;Current Longitude&amp;quot;;&lt;br /&gt;
CM_ SG_ 901 GEO_distance_from_destination &amp;quot;Distance from destination&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_rps &amp;quot;Current RPS value of the motor&amp;quot;;&lt;br /&gt;
CM_ SG_ 902 MOTOR_INFO_DBG_pwm &amp;quot;Supplied motor PWM value&amp;quot;;&lt;br /&gt;
CM_ SG_ 903 LIPO_BATTERY_VOLTAGE_val &amp;quot;LIPO Battery Voltage&amp;quot;;&lt;br /&gt;
CM_ SG_ 904 CURRENT_CHECKPOINT_val &amp;quot;Current checkpoint of the car&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_ &amp;quot;BusType&amp;quot; STRING ;&lt;br /&gt;
BA_DEF_ BO_ &amp;quot;GenMsgCycleTime&amp;quot; INT 0 0;&lt;br /&gt;
BA_DEF_ SG_ &amp;quot;FieldType&amp;quot; STRING ;&lt;br /&gt;
&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;BusType&amp;quot; &amp;quot;CAN&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;FieldType&amp;quot; &amp;quot;&amp;quot;;&lt;br /&gt;
BA_DEF_DEF_ &amp;quot;GenMsgCycleTime&amp;quot; 0;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 100 1000;&lt;br /&gt;
BA_ &amp;quot;GenMsgCycleTime&amp;quot; BO_ 200 50;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 100 DRIVER_HEARTBEAT_cmd &amp;quot;DRIVER_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 102 GEO_HEARTBEAT_cmd &amp;quot;GEO_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 103 MOTOR_HEARTBEAT_cmd &amp;quot;MOTOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 104 SENSOR_HEARTBEAT_cmd &amp;quot;SENSOR_HEARTBEAT_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 200 MOTOR_STEERING &amp;quot;MOTOR_STEERING&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 230 MOTOR_SPEED_val &amp;quot;MOTOR_SPEED_val&amp;quot;;&lt;br /&gt;
BA_ &amp;quot;FieldType&amp;quot; SG_ 310 GEO_DESTINATION_REACHED_cmd &amp;quot;GEO_DESTINATION_REACHED_cmd&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
VAL_ 100 DRIVER_HEARTBEAT_cmd 2 &amp;quot;DRIVER_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;DRIVER_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;DRIVER_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 101 GEO_HEARTBEAT_cmd 2 &amp;quot;GEO_HEARTBEAT_cmd_REBOOT&amp;quot; 1 &amp;quot;GEO_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;GEO_HEARTBEAT_cmd_NOOP&amp;quot;;&lt;br /&gt;
VAL_ 102 MOTOR_HEARTBEAT_cmd 20 &amp;quot;MOTOR_HEARTBEAT_cmd_REBOOT&amp;quot; 10 &amp;quot;MOTOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;MOTOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
VAL_ 103 SENSOR_HEARTBEAT_cmd 200 &amp;quot;SENSOR_HEARTBEAT_cmd_REBOOT&amp;quot; 100 &amp;quot;SENSOR_HEARTBEAT_cmd_SYNC&amp;quot; 0 &amp;quot;SENSOR_HEARTBEAT_cmd_NOOP&amp;quot; ;&lt;br /&gt;
&lt;br /&gt;
VAL_ 200 MOTOR_STEERING_direction -2 &amp;quot;MOTOR_STEERING_hard_left&amp;quot; -1 &amp;quot;MOTOR_STEERING_slight_left&amp;quot; 0 &amp;quot;MOTOR_STEERING_straight&amp;quot; 1 &amp;quot;MOTOR_STEERING_slight_right&amp;quot; 2 &amp;quot;MOTOR_STEERING_hard_right&amp;quot;;&lt;br /&gt;
VAL_ 220 MOTOR_SPEED_processed -3 &amp;quot;MOTOR_SPEED_reverse_fast&amp;quot; -2 &amp;quot;MOTOR_SPEED_reverse_medium&amp;quot; -1 &amp;quot;MOTOR_SPEED_reverse_slow&amp;quot; 0 &amp;quot;MOTOR_SPEED_neutral&amp;quot; 1 &amp;quot;MOTOR_SPEED_forward_slow&amp;quot; 2 &amp;quot;MOTOR_SPEED_forward_medium&amp;quot; 3 &amp;quot;MOTOR_SPEED_forward_fast&amp;quot;;&lt;br /&gt;
VAL_ 310 GEO_DESTINATION_REACHED_cmd 1 &amp;quot;GEO_DESTINATION_REACHED_cmd_REACHED&amp;quot; 0 &amp;quot;GEO_DESTINATION_REACHED_cmd_NOT_REACHED&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Motor Controller''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller is used to control the components of the car-related to motor. We can control the speed and steering of the car having interfaced with various components with the SJ-2 board. The servo motor is controlled via PWM and is used to set the steering direction of the car. The DC motor is controlled by the Electronic Speed Controller (ESC) via PWM for speed. We read the speed of the car by using an RPM sensor. By using the RPM sensor values, a feedback loop has been designed to regulate the speed of the car. A state machine has been designed to manage the forward and backward movements of the car. &lt;br /&gt;
Additionally, a voltage divider circuit has been implemented to read the battery voltage. All motor functionality and CAN message communication is run at 10 Hz. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
The following diagram details the hardware implementation of the motor module with the SJTwo board:&lt;br /&gt;
Hardware Interface&lt;br /&gt;
-	Servo Motor&lt;br /&gt;
The servo motor responds to PWM pulses. It has three pins namely Vcc, PWM Input Signal, and GND. The servo is powered using 6V from the car battery. Based on the PWM signal supplied from the SJTwo board the front wheels are turned. &lt;br /&gt;
-	Electronic Speed Controller (ESC)&lt;br /&gt;
The ESC is used to control the DC motor. It is supplied power using the 7.4 V LiPo battery. It has three pins namely Vout, PWM Input Signal, and GND. Based on the PWM input signal, the speed and forward, neutral, and backward movements of the car is changed. Vout is given to the RPM sensor and Servo motor.&lt;br /&gt;
-	DC Motor &lt;br /&gt;
The DC motor is controlled using the ESC. It has two pins, a positive and negative terminal.  A PWM signal wire is connected to the microcontroller and the required current is provided by the LiPo battery and the ESC. The DC motor is controlled using PWM at 10Hz.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor_Hardware.png|thumb|center|750px|  Motor Hardware System]]&lt;br /&gt;
&lt;br /&gt;
Note: First calibrate the DC motor or the motor will not respond to your PWM pulses. For help with calibration go to this [https://traxxas.com/support/Programming-Your-Traxxas-Electronic-Speed-Control website]&lt;br /&gt;
&lt;br /&gt;
-	RPM Sensor&lt;br /&gt;
&lt;br /&gt;
The RPM sensor is used to get the current speed of the car. We use the info for creating a feedback loop (PID) for maintaining the speed of the car in uphill and downhill situations. The RPM sensor mounts on the rear DC motor shaft compartment with a special assembly also provided by Traxxas. The magnet which attached to the inner gear generates a pulse each rotation. The sensor works on the hall effect principle where it provides a current across its terminal when placed in a magnet's field. The RPM sensor has three pins namely Vcc, Signal, and GND.&lt;br /&gt;
&lt;br /&gt;
-	Battery Voltage Divider Circuit&lt;br /&gt;
-	(Need Niket’s help)&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The software for the motor node was divided into multiple files and made modular to improve readability and understanding of the complex logic involved. The main code modules are for:&lt;br /&gt;
•	Servo Motor&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
•	Battery Voltage&lt;br /&gt;
&lt;br /&gt;
The motor wrapper module is used to wrap all the code from the esc, servo, and rpm modules into simple to use functions to be called in the periodic tasks. &lt;br /&gt;
•	Servo Motor&lt;br /&gt;
It uses the steering value sent from the driver (-2 to 2) and matches it to the appropriate PWM value for steering. This code module is run at 10Hz. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void servo__steer_processor(int16_t steering_value) {&lt;br /&gt;
  switch (steering_value) {&lt;br /&gt;
  case MOTOR_STEERING_hard_left:&lt;br /&gt;
    servo__steer_hard_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_left:&lt;br /&gt;
    servo__steer_soft_left();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_straight:&lt;br /&gt;
    servo__steer_straight();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_slight_right:&lt;br /&gt;
    servo__steer_soft_right();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_STEERING_hard_right:&lt;br /&gt;
    servo__steer_hard_right();&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive steering value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
•	Electronic Speed Controller&lt;br /&gt;
&lt;br /&gt;
This code module is used to control the DC motor. It receives the motor direction value from the driver and sets the appropriate PWM value. Based on the value the motor is commanded to move the car forward or backwards. A switch case is implemented to set PWM values for movement in different directions along with different speeds.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void esc__direction_processor(int16_t direction_value) {&lt;br /&gt;
  desired_direction_value = direction_value;&lt;br /&gt;
  switch (direction_value) {&lt;br /&gt;
  case MOTOR_SPEED_reverse_fast:&lt;br /&gt;
    esc__reverse_fast();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_medium:&lt;br /&gt;
    esc__reverse_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_reverse_slow:&lt;br /&gt;
    esc__reverse_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_neutral:&lt;br /&gt;
    esc__neutral();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_slow:&lt;br /&gt;
    esc__forward_slow();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_medium:&lt;br /&gt;
    esc__forward_medium();&lt;br /&gt;
    break;&lt;br /&gt;
  case MOTOR_SPEED_forward_fast:&lt;br /&gt;
    esc__forward_fast();&lt;br /&gt;
    break;&lt;br /&gt;
&lt;br /&gt;
  default:&lt;br /&gt;
    printf(&amp;quot;\nDid not receive direction and speed value&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a feedback loop to control the speed. The ESC code depends on the rpm sensor code for the current speed values. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
double current_speed = get_speed_kph();&lt;br /&gt;
double desired_speed = desired_speed_kph;&lt;br /&gt;
float adjusted_duty_cycle = 0.0;&lt;br /&gt;
adjusted_duty_cycle = duty_cycle + (speed_to_pwm_adjustment(desired_speed, current_speed));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor1.png|thumb|center|400px|  Motor Flowchart 1]]&lt;br /&gt;
&lt;br /&gt;
•	RPM Sensor&lt;br /&gt;
This code module is used to get current speed data from the RPM sensor. It is based on interrupts. When the wheel rotates once, we get one pulse due to the magnet installed. This pulse generates a falling edge interrupt during which we increment the pulse counter. Since, this code is run at 1Hz we collect the number of pulses generated every one second. This gives us the number of rotations per second using which we can calculate the speed in kph.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  float rpm__calculate_speed_kph() {&lt;br /&gt;
  uint16_t rotation_per_sec = pulse_count;&lt;br /&gt;
  pulse_count = 0;&lt;br /&gt;
  speed_kph = ((CIRCUMFERENCE_METER * rotation_per_sec) * (MPS_TO_KPH_CONVERSION_FACTOR)) / GEAR_RATIO;&lt;br /&gt;
  return speed_kph;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
•	Motor Wrapper&lt;br /&gt;
As mentioned above, the main function of this code module is to wrap all the other code modules and call the right functions at the appropriate frequency. The motor wrapper code also includes a state machine for ensuring a smooth transition between forward to backward state and vice versa. In order to achieve a smooth transition, a series of PWM pulses must be generated at the right time. For example, when the motor is moving from forward to backward state, a reverse value must be given first followed by at least three neutral values, and then continue with reverse values.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_Motor2.png|thumb|center|400px|  Motor Flowchart 2]]&lt;br /&gt;
&lt;br /&gt;
•	LIPO Battery Voltage:&lt;br /&gt;
The LIPO Battery Voltage was calculated using ADC in Burst Mode. A LIPO Hardware module was created for the same which contained two functions, &amp;lt;code&amp;gt;lipo__init&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lipo__get_voltage&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
LIPO Initialization&lt;br /&gt;
&lt;br /&gt;
The LIPO Initialization phase initializes the ADC, Enables Burst mode on the ADC pins and configures the Alternate Function Registers for the same.&lt;br /&gt;
&lt;br /&gt;
LIPO Get Voltage&lt;br /&gt;
&lt;br /&gt;
We read the raw ADC value from the LPC Hardware register. This value will be from 0 - 3.3V. However due to our voltage divider configuration the max voltage that we should theoretically get is 2.1V. This means that 2.1V corresponds to 7.4V of the LIPO Battery voltage.&lt;br /&gt;
&lt;br /&gt;
The formula used is&lt;br /&gt;
&amp;lt;code&amp;gt;(raw_adc_value * MAX_LIPO_BATTERY_VOLTAGE_VALUE) / MAX_LIPO_ADC_VALUE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Changing movements of the car from Forward to Backward and vice versa&lt;br /&gt;
If you just change the PWM value from say 16 (Forward) to 14(Backward), the DC motor will just stop and will not make wheels turn reverse. We discovered this problem quite late as during the initial testing we had always run the car from the start with either forward or reverse but never tried changing the direction during run-time. &lt;br /&gt;
Solution: The motor requires a series of PWM pulses which is specific to the car to transition from forward mode to reverse mode.  In our case we had to give the PWM pulses in the following sequence. Suppose,&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count=0)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Forward (16) (callback_count =1)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count =2)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 3)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 4)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Neutral (15) (callback_count = 5)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Reverse (14) (callback_count = 6)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; Continue reverse&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Similarly, the reverse to forward can also be implemented.&lt;br /&gt;
 &amp;lt;li&amp;gt;DC motor shooting off when there is an improper ground connection&lt;br /&gt;
When we connected the battery voltage circuit for reading the voltage from the battery, the motor would randomly shoot off every now and then. &lt;br /&gt;
Solution: Connect the voltage divider circuit to the common ground rather than taking the ground from the ESC.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Geological Controller''' ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Messages===&lt;br /&gt;
*GEO_HEARTBEAT: Used to check for MIA by other nodes. Highest priority message for GEO Node&lt;br /&gt;
&lt;br /&gt;
*GEO_DEGREE: Sends the current degree relative to the North Pole computed by the Compass and the Required degree relative to the North Pole computed by Bearing Angle using the Current Coordinate and Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
*GEO_DESTINATION_REACHED: Sets a flag, 0 for destination not reached and 1 for destination reached&lt;br /&gt;
&lt;br /&gt;
*GEO_CURRENT_COORDINATES: Debug Message used to send the Current GPS Coordinates&lt;br /&gt;
&lt;br /&gt;
*GEO_DISTANCE_FROM_DESTINATION: Debug message used to send the Distance from Destination&lt;br /&gt;
&lt;br /&gt;
*CURRENT_CHECKPOINT_DBG: Debug message used to check which checkpoint is being navigated to&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_GEO1.png|thumb|center|650px| Geological Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
=====Overview=====&lt;br /&gt;
*Inside the `periodic_callback__initialize`&lt;br /&gt;
**Initialize the CAN BUS&lt;br /&gt;
**Initialize the GPS&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__1hz`&lt;br /&gt;
**Handle all MIA (from other Nodes)&lt;br /&gt;
**Update GPS LED when init and in case of failure&lt;br /&gt;
**Compute the GEOLOGIC for Waypoints algorithm once every second (1000 ms)&lt;br /&gt;
&lt;br /&gt;
*Inside the `periodic_callback__10hz`&lt;br /&gt;
**Handle CAN Incoming messages (Decode)&lt;br /&gt;
**Transmit CAN Geo messages (Encode and send)&lt;br /&gt;
**Compute the GPS Coordinate&lt;br /&gt;
&lt;br /&gt;
=====Compass I2C Driver=====&lt;br /&gt;
An online datasheet resource was used to work with the Compass (https://www.robot-electronics.co.uk/htm/cmps11i2c.htm)&lt;br /&gt;
Initially the Compass I2C Driver was tested using the Terminal I2C Helper built by our Professor Preetpal Kang. Using this resource we were quickly able to read various I2C Registers and display it onto the terminal.&lt;br /&gt;
&lt;br /&gt;
For our project the only required part of the Compass was the 16-bit Compass Bearing value (0-3599) i.e 0-359.9 degree values. These values were stored in the 2nd and 3rd register (Register 2 being the High Byte).&lt;br /&gt;
Once the raw data was received over I2C we could easily combine the data&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint16_t  bearing_value = (Reg2 &amp;lt;&amp;lt; 8) | Reg3;&lt;br /&gt;
float rval = bearing_value / 10.0;&lt;br /&gt;
return rval;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The returned value were transmitted to the Driver Node to compute its steering based on the required Bearing Angle.&lt;br /&gt;
&lt;br /&gt;
=====GPS Initialization=====&lt;br /&gt;
GPS Initialization activates the Hardware GPIO (RX and TX), FreeRTOS Queue for UART Interrupts (UART Module) and Line Buffer Module to parse each GPS line.&lt;br /&gt;
&lt;br /&gt;
=====GPS Data Parsing=====&lt;br /&gt;
The GPS Hardware module transmits an NMEA string over UART to the SJTwo Board. We read each character one by one and add it to the Line Buffer module.&lt;br /&gt;
Inside its computation loop, the Line Buffer module checks if a newline character has been received.&lt;br /&gt;
When a newline character has been received the entire string is extracted from the line buffer module and parsed according to its identifier ($GPRMC, $GPGGA) received and parsed into individual tokens.&lt;br /&gt;
For our purposes the $GPRMC NMEA string was the most appropriate and it helped us extract the Current Latitude Longitude as well as the Valid/Invalid tag for the Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=====GPS LED Indication for debugging=====&lt;br /&gt;
&lt;br /&gt;
A simple module that checks for the GPRMC GPS Message and extracts the A or V valid (Tag). If $GPRMC NMEA string is valid, LED is set, else LED is reset. This gives us onsite debugging capabilities to know if GPS has locked onto a satellite signal.&lt;br /&gt;
&lt;br /&gt;
=====GEO Logic Module Computation=====&lt;br /&gt;
The GEO Logic Module computes the Bearing Angle, Haversine Distance as well as the Waypoints algorithm.&lt;br /&gt;
&lt;br /&gt;
'''Bearing Angle:'''&lt;br /&gt;
&lt;br /&gt;
Formula:	θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )&lt;br /&gt;
&lt;br /&gt;
where	φ1,λ1 is the start point, φ2,λ2 the endpoint (Δλ is the difference in longitude)&lt;br /&gt;
&lt;br /&gt;
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalize the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.&lt;br /&gt;
For final bearing, simply take the initial bearing from the endpoint to the start point and reverse it (using θ = (θ+180) % 360).&lt;br /&gt;
&lt;br /&gt;
The above article reference gives us the required bearing angle that our car must align itself to, to reach a particular destination coordinate from its current coordinate.&lt;br /&gt;
The Steering of the Canster Truck depends on the above-computed angle values.&lt;br /&gt;
&lt;br /&gt;
'''Haversine Distance Formula:'''&lt;br /&gt;
&lt;br /&gt;
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).&lt;br /&gt;
&lt;br /&gt;
	a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)&lt;br /&gt;
&lt;br /&gt;
	c = 2 ⋅ atan2( √a, √(1−a) )&lt;br /&gt;
&lt;br /&gt;
	d = R ⋅ c&lt;br /&gt;
&lt;br /&gt;
where	φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);&lt;br /&gt;
note that angles need to be in radians to pass to trig functions!&lt;br /&gt;
&lt;br /&gt;
The above formula is used to calculate the distance between the source coordinate (received via GPS) and the destination coordinate.&lt;br /&gt;
Later this was used to compute the distance between source coordinate and each individual checkpoint to traverse the shortest distance.&lt;br /&gt;
&lt;br /&gt;
'''Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
The Waypoints algorithm that was chosen was a slightly modified version of Djikstra’s Algorithm.&lt;br /&gt;
3 values were calculated before the final computation&lt;br /&gt;
-	Distance between source and final destination (DISTsd)&lt;br /&gt;
-	Distance between source and each individual checkpoint (DISTsc)&lt;br /&gt;
-	Distance between each individual checkpoint and the final destination. (DISTcd)&lt;br /&gt;
If DISTsd was lesser than DISTcd, this checkpoint was discarded (we continue in the loop). Since we would be moving in the opposite direction, rather than towards the final destination.&lt;br /&gt;
If DISTsd was greater than DISTcd, then we checked the nearest checkpoint to the source.&lt;br /&gt;
The minimum value was set initial that was equal to DISTsd.&lt;br /&gt;
If DISTsc was lesser than the minimum value stored, DISTsc would become the new minimum value, and the checkpoint index and coordinates would be appropriately stored and returned from the function.&lt;br /&gt;
In this way we would navigate to the nearest checkpoint from the source, while also making sure NOT to travel in the opposite direction.&lt;br /&gt;
This logic is recomputed only when we reach the checkpoint selected and the algorithm runs again to find the next checkpoint that we need to navigate to.&lt;br /&gt;
&lt;br /&gt;
=====CAN Decode Destination Coordinates=====&lt;br /&gt;
Destination Coordinates are received from the Bridge and Sensor Node and transmitted over the CAN Bus. The value is decoded and stored in the GEO Logic Module.&lt;br /&gt;
This is a very important value since our entire GEO Logic calculations are based on the Destination Coordinate.&lt;br /&gt;
&lt;br /&gt;
=====CAN Encode and Send=====&lt;br /&gt;
&lt;br /&gt;
The main messages that were transmitter are&lt;br /&gt;
#Geo Degree&lt;br /&gt;
#Geo Destination Reached&lt;br /&gt;
#Distance from Destination Debug and Checkpoint Index debug&lt;br /&gt;
&lt;br /&gt;
'''Geo Degree Computation as per Waypoints Algorithm:'''&lt;br /&gt;
&lt;br /&gt;
Geo Degree was computed as per the current coordinates and the most recently computed checkpoint coordinates. This bearing angle calculation w.r.t computed checkpoint would continue till we do not reach that particular checkpoint.&lt;br /&gt;
Once we reach the computed checkpoint, Waypoint algorithm is recomputed as per the process mentioned above and the algorithm runs again.&lt;br /&gt;
&lt;br /&gt;
'''Geo Destination Reached:'''&lt;br /&gt;
&lt;br /&gt;
An Area of around 4 meters was set around the destination coordinate to check if the destination had been reached. &lt;br /&gt;
This measurement was taken into consideration to allow for the loss in precision when transmitting data over CAN as well as any irregularities that might occur when getting values from the GPS.&lt;br /&gt;
Having an area of 4 meters was very accurate for all of our test runs.&lt;br /&gt;
&lt;br /&gt;
'''Geo Distance from Destination Debug and Checkpoint Index Debug:'''&lt;br /&gt;
&lt;br /&gt;
Getting debug information was very critical to speed up our development process. In this case we could actively see if our algorithm worked properly.&lt;br /&gt;
The Geo Distance from Destination was used to see if we were moving closer to our destination or veering further away from it.&lt;br /&gt;
The Checkpoint Index was used to see which checkpoint index we were traveling to. By knowing the placements of the Individual checkpoints we could manually as well as programmatically (via Android application) verify the working of our Canster Truck.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
#DBC Challenge for GEO Coordinates -&amp;gt; Could not encode more than 5-6 decimal places at a time, on later investigation we found that the 10000 is an int value, however 100000 overflows the int value. &lt;br /&gt;
#Creating an efficient algorithm for Waypoints, O(n) complexity.&lt;br /&gt;
#Getting appropriate fixes for GPS when not in a completely open space.&lt;br /&gt;
#GPS used to fluctuate or stop giving values when Battery voltage went below a particular threshold. Always supply 3.3V constantly at a good amperage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Sensor  [Bridge and Sensor Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Ultrasonic Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
This sensor uses an ultrasonic beam to measure the distances. Based on the time taken between when the beam is sent and received back to the sensor, the distance is calculated in the node.&lt;br /&gt;
Apart from 5v and GND, this sensor has 2 pins ECHO and TRIG which are interfaced with the SJ-Two board via GPIO.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_CansterTruck_ultrasonic_sensor.jpg|thumb|center|300px| Ultrasonic Sensor Diagram]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
* Init the GPIO pin connected to TRIG of the sensor as output and for ECHO as an input port.&lt;br /&gt;
* Attach the interrupt on the ECHO input port.&lt;br /&gt;
* Store the system_clock_count before setting the trigger pulse and then set the pulse. Also keep monitoring the input port.&lt;br /&gt;
* Take the system_clock_count at the instant of receiving the interrupt.&lt;br /&gt;
Distance = (system_clock_count_at_trig - system_clock_count_after_at_echo) / 57.14&lt;br /&gt;
&lt;br /&gt;
==='''Lidar Sensor'''===&lt;br /&gt;
====Hardware Design====&lt;br /&gt;
The RPLidar sensor can be powered from a 5-volt source and uses UART communication to receive commands and transmit data. It has seven pins to interface with. Two sets of the pins (four total) are for power and ground. The remaining three are for UART receive and transmit, and for making the lidar’s motor spin.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster_Truck_RPLidar_A1.JPG|thumb|center|300px| RPLidar A1]]&lt;br /&gt;
&lt;br /&gt;
====Software Design====&lt;br /&gt;
In terms of the lidar, the SJ2 initializes GPIO, UART, and memory for storing the measurement values. After initialization, the command to begin scanning is sent. Here, we wait for the lidar to send a response packet, letting the host (SJ2 board) know it received the command. The response packet the lidar sends will be 7 bytes. If the correct 7 bytes are not received, the command will be sent again. &lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Lidar_flow.jpeg|thumb|center|200px| Lidar Flow]]&lt;br /&gt;
&lt;br /&gt;
Following the response packet, the lidar begins sending 5-byte measurement data. Each sample contains a distance measurement (in millimeters) and the angle (with respect to the lidar) in which it was taken. The data packet structure is shown in the following figure. In addition to containing the distance and angle, the packet includes a quality value, to indicate the reliability of the measurement, and three check bits (S, ~S, and C). As the data is received via UART, we wait until we have 5 bytes before continuing to process. Before processing the 5 bytes after receiving them, the check bits are confirmed to be correct. If they are incorrect, it will not be processed and we will wait for another sample to be received.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_DataPacketStructure.JPG|thumb|center|200px| Data Packet Structure]]&lt;br /&gt;
&lt;br /&gt;
In the case the sample is correct, each measurement value that is in a direction of interest will be placed in an array designated to one of four directions (left, right, front, rear). Each of these directions have their own sector in the lidar’s 360-degree view. &lt;br /&gt;
*Right sector: 11°-30°&lt;br /&gt;
*Rear sector: 170°-190°&lt;br /&gt;
*Left sector: 330°-349°&lt;br /&gt;
*Front sector: 350°-370° (or 10°)&lt;br /&gt;
&lt;br /&gt;
The arrays mentioned will hold roughly 20 measurements, which are every degree in the sector. In the event, objects are too far to measure, the lidar will report 0 mm. distance. Since there is no measurable obstacle, a “large” distance value of 3000 mm. is placed in the array. The smallest distance value will be taken from each array and reported to the driver node for obstacle avoidance.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
====Ultrasonic====&lt;br /&gt;
====Lidar====&lt;br /&gt;
*'''Datasheet not 100% clear:'''  The correct datasheet for the was a bit difficult to obtain, and the manufacturer needed to be contacted. The first document found online was high level and general information about the sensor, but the manufacturer did provide another document that contained the information of the commands and responses to and from the lidar, and their packet structure. The documents did not clearly state the angles with respect to the lidar are fixed, which left me wondering if the lidar will think the direction it is facing when powered on will become the new “zeroth” angle. &lt;br /&gt;
&lt;br /&gt;
*'''UART Buffer Overflow:''' When first interfacing with the sensor, the incoming bytes of the lidar were printed on to the terminal to make sure there was a response and to make sense of the information. Since the command we sent results in 5 bytes of data per measurement samples from the lidar and the lidar measured 2000 times per second, there are will be roughly 10k Bytes per second of data incoming that need to be handled continuously. With an improperly sized UART buffer and print statements it is guaranteed to occur, making the lidar data look like random values. &lt;br /&gt;
&lt;br /&gt;
*'''Proper Parsing of Measurement Data:''' After sending a command to the lidar, the sensor will send a response packet, followed by the measurement data. The initial response from the lidar is a 7-byte packet, followed by continuous 5-byte measurement samples. I needed to make sure however I handled the response would be independent of how the measurement is handled, so as not to create a potential unwanted offset when receiving measurements. &lt;br /&gt;
&lt;br /&gt;
*'''Object Detection with Received Data:''' Once proper communication was set up with the lidar and measurement data was getting decoded, there needed to be a way to measure when obstacles were present. If ~360 measurements are handled entirely independently from one another, it could become a complex and confusing code. To achieve a simple approach, four sectors about 20 degrees in size were used to represent the front, left, right, and rear directions. &lt;br /&gt;
&lt;br /&gt;
*'''Bugs in Code:'''  When first implementing the code, there were a few bugs from typos, incorrect numbers, and some faulty logic that were found with the use of unit testing. Unit testing helped find these issues and verified the logic was correct, and I would say gave me 90% confidence in my lidar handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Bridge  [Bridge and Sensor Controller]'''==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bridge functionality of the Bridge and Sensor Controller is to establish wireless communication between the SJ-2 Board and the android mobile device using the HC-05 Bluetooth module. The Bridge controller will be receiving start command with destination GEO coordinates and stop command. The Bridge controller will be transmitting the required sensor data and debug information to be displayed on the android application.&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BRIDGE.png|thumb|center|500px| Bridge Diagram]]&lt;br /&gt;
&lt;br /&gt;
===Bluetooth===&lt;br /&gt;
&lt;br /&gt;
==== Software Design ====&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Low-Level Layer&lt;br /&gt;
In this layer, similar to the GPS the UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupts and the line buffer module was initialized to parse strings.&lt;br /&gt;
&lt;br /&gt;
Two basic functions '''bt__read''' and '''bt__write''' were implemented.&lt;br /&gt;
As the name suggested, '''bt__write''' took a string as its input parameter and transmitted that data to the Android application. '''bt__read''' stored the incoming characters into the line buffer, parsed the line received into its identifier and tokens, and invoked a callback function.&lt;br /&gt;
&lt;br /&gt;
Since this was a low-level layer the User would not be directly invoking this library. Instead a '''Bluetooth Wrapper''' module was created which would be invoked and used by the user.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;li&amp;gt;Application Layer&lt;br /&gt;
&lt;br /&gt;
The Bluetooth Wrapper module had the appropriate '''read_once''' and '''write_once''' functions.&lt;br /&gt;
&lt;br /&gt;
The `read_once` function internally just called the '''bt__read''' function. All of the decodings was done inside the Callback Function. &lt;br /&gt;
To get the Destination coordinate the string received from the Android Application was in the form of &lt;br /&gt;
&amp;lt;pre&amp;gt;$loc,&amp;lt;destination_latitude&amp;gt;,&amp;lt;destination_longitude&amp;gt;.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Upon receiving this data we parsed the destination_latitude and destination_longitude, which could later be accessed using getters.&lt;br /&gt;
We also set a start flag to notify the Driver Node that destination has been received and we can start steering towards our checkpoints.&lt;br /&gt;
Another command implemented was the stop command. &lt;br /&gt;
&amp;lt;pre&amp;gt;$stop&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was used to send a stop flag to the Driver node.  &lt;br /&gt;
&lt;br /&gt;
The '''write_once''' function used the getter methods from each CAN Decode message and update its internal state variables. A CSV String was created using the &amp;lt;pre&amp;gt;$canster&amp;lt;/pre&amp;gt; identifier and various debugging points were appended to this message using a comma.&lt;br /&gt;
On the Android application side this CSV string was tokenized and displayed onto the Application Debug screen appropriately.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Technical Challenges ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Driver  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_Canster Truck_Driver_Flowchart.png|thumb|center|750px|Driver Flowchart]]&lt;br /&gt;
&lt;br /&gt;
The above block diagram explains the process flow of obstacle detection for the car. The LIDAR detects&lt;br /&gt;
the obstacle and depending on the distance of obstacle the car takes a slight right and slight left or a&lt;br /&gt;
hard right and hard left. The state of the car also depends on the value of the LIDAR and ultrasonic sensor.&lt;br /&gt;
The loose ends of the LIDAR for the reverse condition are checked by the ultrasonic sensors. The&lt;br /&gt;
The ultrasonic sensor works on the principle of trigger and echo and can detect the obstacles very close by.&lt;br /&gt;
The range of the Ultrasonic sensor is lower than the LIDAR. Finally, if no obstacle is detected the car goes&lt;br /&gt;
straight until the destination is reached. The speed of the car is also various when an obstacle is detected to&lt;br /&gt;
avoid the crash and the car’s smooth transition from one state to another. The key to the android&lt;br /&gt;
application controls the start and stop the process of the car. If the key is not pressed, then the stays in the&lt;br /&gt;
&lt;br /&gt;
neutral state. The speed of the car is controlled by the changing duty cycle of the input voltage. There&lt;br /&gt;
are seven-speed levels in which the motor can run on. These speed levels are Forward Slow, Medium,&lt;br /&gt;
Fast, Reverse Slow, Medium, Fast, and Neutral. The Neutral is the stop condition with a 0% duty cycle.&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''LCD  [Driver and LCD Controller]''' ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
The GLCD used was created by 4DSystems, using their IDE a UI was created. Each UI component could be controlled by sending UART data targeted at the widget address.&lt;br /&gt;
The best part about this GLCD was that we had a lot of interactive widgets to display debugging information in real-time.&lt;br /&gt;
The GLCD code was divided into 3 parts:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Low-Level Initialization'''&lt;br /&gt;
Initialize the low-level hardware interfaces to send and receive data from the GLCD.&lt;br /&gt;
Similar to the GPS and Bluetooth, The UART GPIO was initialized (RX, TX), FreeRTOS Queue was initialized for UART Interrupt and line buffer was used to get a stream of data for parsing.&lt;br /&gt;
&lt;br /&gt;
Low-level '''read''' and '''write''' commands were used as per the working of the GLCD Module.&lt;br /&gt;
When Reading data pertaining to a widget on the GLCD we would need to send a particular response packet.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__read(lcd_object_e object_id, uint8_t object_index, uint8_t *response, uint16_t *response_data) {&lt;br /&gt;
&lt;br /&gt;
  uint8_t checksum = READ_OBJ ^ object_id ^ object_index;&lt;br /&gt;
  uint8_t buffer[] = {READ_OBJ, object_id, object_index, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
  lcd__read_response_data(response_data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The response_data returned contains the Widget ID as well as the current value stored on that widget.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
When Writing data pertaining to a widget on a GLCD the process is similar to the above mentioned code.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void lcd__write(lcd_object_e object_id, uint8_t object_index, uint8_t msb, uint8_t lsb, uint8_t *response) {&lt;br /&gt;
  uint8_t checksum = WRITE_OBJ ^ object_id ^ object_index ^ msb ^ lsb;&lt;br /&gt;
  uint8_t buffer[] = {WRITE_OBJ, object_id, object_index, msb, lsb, checksum};&lt;br /&gt;
&lt;br /&gt;
  lcd__write_data(buffer, sizeof(buffer) / sizeof(uint8_t));&lt;br /&gt;
  lcd__read_response_id(response);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However in this case we receive only an ACK or NACK from the system. ACK would mean that the write to GLCD widget was successful and the widget now stored appropriate values. NACK would mean that a particular error has occurred. The errors could be regarding baud rate, incorrect bit format, incorrect index values, etc.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD Wrapper for Widgets'''&lt;br /&gt;
The above low-level code had generic read and write functions. However for our UI we were only using 3 Widgets. All of which had '''different Indexes''' and '''Widget IDs'''.&lt;br /&gt;
Therefore a very simple library was created to easily interface with those widgets&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool lcd_wrapper__read_led(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_meter(uint8_t index);&lt;br /&gt;
uint16_t lcd_wrapper__read_leddigit(uint8_t index);&lt;br /&gt;
&lt;br /&gt;
bool lcd_wrapper__write_led(uint8_t index, bool value);&lt;br /&gt;
bool lcd_wrapper__write_meter(uint8_t index, uint16_t value);&lt;br /&gt;
bool lcd_wrapper__write_leddigit(uint8_t index, uint16_t value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code is self-explanatory read and write functions for '''LED''', '''METER''', and '''LED DIGIT'''.&lt;br /&gt;
&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;'''GLCD UI'''&lt;br /&gt;
Now that we had our low level and Widget wrapper working properly, we wanted to create our Dynamic UI as well. The code would need to be robust enough to handle any UI that we create on the GLCD which could be reflected equivalently in our C Code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static void lcd_ui__update_ui(void) {&lt;br /&gt;
&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_DRIVER_MIA_INDEX, driver_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_SENSOR_MIA_INDEX, sensor_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_GEO_MIA_INDEX, geo_mia_led);&lt;br /&gt;
  lcd_wrapper__write_led(LCD_LED_MOTOR_MIA_INDEX, motor_mia_led);&lt;br /&gt;
&lt;br /&gt;
  // kph is always in the range of 0 - 10&lt;br /&gt;
  lcd_wrapper__write_meter(LCD_METER_KPH_INDEX, kph_meter % 11);&lt;br /&gt;
&lt;br /&gt;
  // These will be in the Range of 0-99&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_RPM_INDEX, rpm_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_CURRENTDEGREE_INDEX, cdegree_leddigit % 100);&lt;br /&gt;
  lcd_wrapper__write_leddigit(LCD_LEDDIGIT_REQUIREDDEGREE_INDEX, rdegree_leddigit % 100);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we can see the `lcd_ui__update_ui` function was called periodically inside the 1Hz function. It updated the screen in real time based on the static values that were stored AND updated inside the LCD UI module.&lt;br /&gt;
The Constant INDEX values stored were directly mapped onto the Index values were received from the 4DWorkshop UI Software.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Android Application''' ==&lt;br /&gt;
[https://gitlab.com/akhilcherukuri/can-ster_truck_application Gitlab]&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android1.jpg|thumb|none|250px|Splash Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android2.jpg|thumb|none|250px|Main Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android3.jpg|thumb|none|250px|Map Activity Screen]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android4.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android5.jpg|thumb|none|250px|Info Activity Screen 1]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:CMPE243_S20_T2_Canster Truck_Android6.jpg |thumb|none|250px|Debug Activity Screen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application consists of a total of 5 Activities:&lt;br /&gt;
&lt;br /&gt;
*'''Main Activity:'''&lt;br /&gt;
**This is the app launch display screen&lt;br /&gt;
**It will check for all the required permission onStart().&lt;br /&gt;
**Has search button for connecting from a paired device list view&lt;br /&gt;
**Once device is clicked, an intent will start the Map Activity &lt;br /&gt;
*'''Map Activity:'''&lt;br /&gt;
** For this requirement we are using the Google Maps Fragment, for the map fragment to function we must request an API key from Google and set the key in the manifest of the application.&lt;br /&gt;
** Destination marker(Red Marker) is set using setOnMapClickListener to which the car will navigate to, the destination can be changed by clicking elsewhere on the Map Fragment. The marker can be removed using setOnMarkerClickListener.&lt;br /&gt;
** When the start button is pressed, the start command identifier along with destination latitude and longitude is sent to the car via the write thread. A background thread is started along with it to indicate the current car's position(Green Marker) along with a plotline between the current position and destination.&lt;br /&gt;
** When the stop button is pressed, the stop command identifier is sent to the car, to stop and turn off the car.&lt;br /&gt;
*'''Info Activity:'''&lt;br /&gt;
** Messages from Geological, Driver, Motor coming from CAN bus are decoded by the Sensor and Bridge controller and sent to the Android application as a string. &lt;br /&gt;
** The received string is parsed and categorizes the data to store it in the required textView to be displayed. &lt;br /&gt;
** Bluetooth status, Lidar Values, Ultrasonic Sensor Values, Motor Speed, Motor RPM, Motor PWM, Cars' current location, Compass Heading, Distance till Destination, Checkpoint Index is displayed. This was useful for debugging purposes and allowed us to avoid scanning the mounted LCD or CAN Busmaster on PC during drives.&lt;br /&gt;
*'''Debug Activity:'''&lt;br /&gt;
**The main function of this activity is to check all RAW RX and RAW TX messages and create a log of all the data received and sent. &lt;br /&gt;
*'''Bluetooth Connection Service Activity''' :&lt;br /&gt;
**This is the background activity that handles all the threads required for transmission and receiving data using Bluetooth connections. It has 3 running threads which is called inside other activities using a handler:&lt;br /&gt;
** Accept Thread - Listens to BluetoothServerSocket using listenUsingRfcommWithServiceRecord. In order for the RF communication socket to connect to the HC-05, we used the following UUID: 00001101-0000-1000-8000-00805F9B34FB. This is a generic SSP Bluetooth UUID that enables the socket to directly connected to HC-05 and maintain the connection.&lt;br /&gt;
** Connect Thread - Creates a Bluetooth socket using createRfcommSocketToServiceRecord&lt;br /&gt;
** Connected Thread - Creates socket.getInputStream(); and socket.getOutputStream(); when bytes are available in input stream it will read them into a buffer. &lt;br /&gt;
***All messages for activities are done by Handler mHandler.obtainMessage(); mHandler.sendMessage();&lt;br /&gt;
&lt;br /&gt;
*'''Receieved string''':&lt;br /&gt;
** A String is sent to the Bluetooth app from HC-05 and when it receives a string with identifier &amp;quot;$canster&amp;quot;, the message is prased accordingly by using the string delimiter ',' and is ended by the newline character '\n' which will remove the data from StringBuffer.&lt;br /&gt;
** Example: $canster,37.339334,-121.881123,37.338713,-121.880685,10.123,20.133,30.123,10.5,88.1,99.2,-2,1,44,7,11,22,33,-3,23\n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CMPE243_S20_T2_BLUETOOTHFLOWCHART.png|thumb|center|650px| Android Application Flowchart]]&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Mangaement''' ==&lt;br /&gt;
===Team Management ===&lt;br /&gt;
===Git Management===&lt;br /&gt;
&lt;br /&gt;
Git Management amongst 6 team members was definitely a very challenging task. Depending on our initial design we could’ve had a lot of merge conflicts. However those risks were mitigated by spending a LOT of time in the initial stages to decide our pipeline and structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;There are certain components in our system that were COMMON. For example the CAN initialization, communication and decodes were all similar for the most part between all the 4 Controllers. The utility modules used were also similar in nature&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thus we made a common branch that contained the templates for CAN Nodes (not Controllers), Hardware code and Utility functions.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Later this common branch was forked into an individual Controller specific branch (SENSOR, GEO, MOTOR or DRIVER).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Only the Logic folder contained Controller specific code, specific to that controller.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This gave us a lot of flexibility since all the team members had similar APIs to work with on all 4 branches. This promoted easy understanding and learning.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Many team members frequently worked on 2 or more controllers at a time where can messages were concerned. Having a APIs also meant that just the can_handler needed to be updated regularly followed by the equivalent logic code. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Inside the logic folder, getters to the can node modules were frequently used.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
├───can_module&lt;br /&gt;
│   ├───can_bus_initializer&lt;br /&gt;
│   ├───can_constants&lt;br /&gt;
│   ├───can_driver_node&lt;br /&gt;
│   ├───can_geo_node&lt;br /&gt;
│   ├───can_handler&lt;br /&gt;
│   ├───can_motor_node&lt;br /&gt;
│   ├───can_sensor_node&lt;br /&gt;
│   └───test&lt;br /&gt;
├───hardware&lt;br /&gt;
│   ├───bt&lt;br /&gt;
│   ├───compass&lt;br /&gt;
│   ├───gps&lt;br /&gt;
│   ├───lcd&lt;br /&gt;
│   ├───test&lt;br /&gt;
│   └───ultrasonic&lt;br /&gt;
├───logic&lt;br /&gt;
│   ├───driver_obstacle&lt;br /&gt;
│   ├───driver_state&lt;br /&gt;
│   ├───geo_logic&lt;br /&gt;
│   └───test&lt;br /&gt;
├───periodics&lt;br /&gt;
│   └───test&lt;br /&gt;
└───utility&lt;br /&gt;
    ├───line_buffer&lt;br /&gt;
    └───test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Challenges'''&lt;br /&gt;
&amp;lt;li&amp;gt;It was initially a bit of a learning curve to understand the flow of the repository&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When using a git management system with different versions in each branch it became very tough when the number of branches suddenly exploded in size. A lot of relevant code was stuck in a lot of different branches.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This happened mainly due to assignment submissions and unclosed MRs that eventually became stale.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our strategy was to abandon these MRs and keep forking from these branches without merging it back into its final controller branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The latest branches that were kept were aptly named `&amp;lt;controller&amp;gt;_bleeding_edge_dev` branches since they were never merged back from where they were forked.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Since a lot of our code also depended on the DBC autogenerated code, we could not suddenly change the DBC Message names once they were established since it caused a change in the Struct name that was generated and used.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Our solution to this was to keep everything backward compatible. We added new function names without deleting old DBC messages.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In certain places where we wanted to modify a function name it was done one by one so that a lot of the code is not broken at one time.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Common Branches eventually became stale as our progress continued on the bleeding edge branches&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For example certain GPS features needed to be added which were done on the GEO_bleeding_edge_dev branch but never pushed or cherry-picked back into the COMMON branch.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This was a similar issue to our 2nd point but manageable since the goal of the COMMON branch was to provide a template for further work and nothing more.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;At the end of the day each controller is its own Individual Project and while the messages between them are same. The Hardware code does not need to be same.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also prompted team-members to ask if we could delete unused hardware or logic file code (which wasn’t being used and was imported from the template). This was also fine and can be done during cleanup stage. However we eventually got used to the Modular system of our project so much so that we did not worry about the additional modules that were present in each branched controller project.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Conclusion''' ==&lt;br /&gt;
CMPE243 gives one of the best experiences one could ever get in their academic life. The course is designed to give an insight into how the industry functions and enhances both technical and management skills. Apart from learning how to work and implement application of CAN protocol, one can get a hands-on experience with version control, unit-testing and software design. Overall it was a very great journey.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
'''GENERAL:'''&lt;br /&gt;
* Form your team and start the project as early as you can.&lt;br /&gt;
* Clearly discuss what role each individual should do and ensure that progress is regularly tracked so that the team doesn't fall back on any schedule.&lt;br /&gt;
* Since lot of code and hardware integration is involved with this project, make sure testing is thoroughly and periodically done and make note of all the issues found.&lt;br /&gt;
'''HARDWARE:'''&lt;br /&gt;
* Decide on how you would power up the peripherals. We had issues with Bluetooth (not connecting), GPS (lock not happening) and LIDAR (giving incorrect values). After lot of cycles of hardware and software debugging, we found that the issue was with power. Choose wisely as to which peripherals must be connected to which power bank.&lt;br /&gt;
* PCB design is time consuming as there is a lot of hardware components involved and a huge responsibility falls on the designer to know the about each component. Coordinating with multiple team members and verifying with them if their respective hardware is correct takes a lot of time. So start well ahead.&lt;br /&gt;
* Make sure to expose some extra GPIO and GND pins for future use.&lt;br /&gt;
'''MOTOR:'''&lt;br /&gt;
*You can use the LiPo battery to power the RPM and servo motor instead of using a separate power source. Use Vout from the ESC to get 6V.&lt;br /&gt;
*Start the PID control calibration early on as you will need to do extensive testing to get it working.&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
Firstly we would like to express our gratitude to Professor Preetpal Kang for his guidance throughout the semester and providing us with this opportunity. We would also like to thank the ISA members Vignesh Kumar Venkateshwar and Aakash Vrajlal Chitroda for being available whenever in need and guiding us to complete the project.&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
===Motor Controller===&lt;br /&gt;
===Geological Controller===&lt;br /&gt;
* Movable Scripts: [https://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points]&lt;br /&gt;
* CMPS11:[https://www.robot-electronics.co.uk/htm/cmps11i2c.htm     I2C Configuration]&lt;br /&gt;
&lt;br /&gt;
===Bridge and Sensor Controller===&lt;br /&gt;
===Driver and LCD Controller===&lt;br /&gt;
*LCD Software: [https://4dsystems.com.au/ulcd-32ptu 4Dsystems]&lt;br /&gt;
===Android===&lt;br /&gt;
*Youtube Channel: [https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw Coding with Mitch]&lt;br /&gt;
*Android Developers: [https://developer.android.com/guide/topics/connectivity/bluetooth Website][https://github.com/googlearchive/android-BluetoothChat Github]&lt;br /&gt;
*Udemy Course: [https://www.udemy.com/course/the-complete-android-oreo-developer-course/ Complete Android Oreo Developer Course]&lt;br /&gt;
===PCB Design===&lt;br /&gt;
*EDC Tool: [https://easyeda.com/ EasyEDA]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Industrial_Application_using_CAN_Bus&amp;diff=58854</id>
		<title>Industrial Application using CAN Bus</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=Industrial_Application_using_CAN_Bus&amp;diff=58854"/>
				<updated>2020-03-11T01:24:51Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /*  Spring 2020 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Class Information =&lt;br /&gt;
==Presentation on Autonomous Vehicles==&lt;br /&gt;
http://www.slideshare.net/ShantanuVashishtha1/autonomous-vehicles-70049669&lt;br /&gt;
&lt;br /&gt;
== Useful Topics ==&lt;br /&gt;
&lt;br /&gt;
=== Git ===&lt;br /&gt;
[[Basic Git Tutorial]]&lt;br /&gt;
&amp;lt;BR/ &amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CAN Bus ===&lt;br /&gt;
[[CAN BUS Tutorial | CAN BUS]]&lt;br /&gt;
&amp;lt;BR/ &amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[DBC Format]] ===&lt;br /&gt;
DBC format is a well known format to describe the format of a CAN message.  This is essentially the schema of the data that is communicated over the CAN bus.  Please view the linked [[DBC Format]] article for details before reading further.&lt;br /&gt;
&lt;br /&gt;
=== BusMaster Tutorial ===&lt;br /&gt;
[[BusMaster | BusMaster Tutorial]]&lt;br /&gt;
&lt;br /&gt;
== Class Assignments ==&lt;br /&gt;
=== [[Lab Assignments]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Class Project ==&lt;br /&gt;
=== [[Self-driving Car]] ===&lt;br /&gt;
In this class project, students accomplish a self-drivable RC car with the following learning objectives:&lt;br /&gt;
*  Learn CAN Bus and how to communicate in an industrial or  automotive environment.&lt;br /&gt;
*  Learn integration and testing across different controllers.&lt;br /&gt;
*  Learn how to work in teams.&lt;br /&gt;
*  Learn basics of an RTOS.&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Autonomous RC Car Project Report Template]]&lt;br /&gt;
&lt;br /&gt;
== Class Project Reports ==&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2020 | Spring 2020]] ===&lt;br /&gt;
*  [[S20: Nimble]]&lt;br /&gt;
*  [[S20: Bucephalus]]&lt;br /&gt;
*  [[S20: Canster Truck]]&lt;br /&gt;
*  [[S20: Tesla Model RC]]&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2019 | Spring 2019]] ===&lt;br /&gt;
*  [[S19: CANT Bus | S19: CANT Bus]]&lt;br /&gt;
*  [[S19: Tech Savy | S19: Tech Savy]]&lt;br /&gt;
*  [[S19: Mystery Machine | S19: Mystery Machine]]&lt;br /&gt;
*  [[S19: Run D.B.C | S19: Run D.B.C]]&lt;br /&gt;
*  [[S19: Hot Wheels | S19: Hot Wheels]]&lt;br /&gt;
*  [[S19: Zeus | S19: Zeus]]&lt;br /&gt;
*  [[S19: Automophiles | S19: Automophiles]]&lt;br /&gt;
*  [[S19: Lightfury | S19: Lightfury]]&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2017 | Fall 2017]] ===&lt;br /&gt;
*  [[F17: Alpha | F17: Alpha]]&lt;br /&gt;
*  [[F17: FoxP2 | F17 FoxP2]]&lt;br /&gt;
*  [[F17: Optimus | F17 Optimus]]&lt;br /&gt;
*  [[F17: Tata Nano | F17 Tata Nano]]&lt;br /&gt;
*  [[F17: Viserion | F17 Viserion]]&lt;br /&gt;
*  [[F17: Vindicators100 | F17 Vindicators100]]&lt;br /&gt;
*  [[F17: Rolling Thunder | F17: Rolling Thunder]]&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2016 | Fall 2016]] ===&lt;br /&gt;
*  [[F16: Spartan and Furious | F16: Spartan and Furious]]&lt;br /&gt;
*  [[F16: Titans | F16: Titans]]&lt;br /&gt;
*  [[F16: Kasper | F16: Kasper]]&lt;br /&gt;
*  [[F16: AutoNav | F16: AutoNav]]&lt;br /&gt;
*  [[F16: Thunderbolt| F16: Thunderbolt]]&lt;br /&gt;
*  [[F16: The-Nine| F16: The-Nine]]&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2015 | Fall 2015]] ===&lt;br /&gt;
* [[F15: Quadcopter by Thomas]]&lt;br /&gt;
* [[F15: Undergrads++]]&lt;br /&gt;
* [[F15: TopGun]]&lt;br /&gt;
* [[F15: Fury]]&lt;br /&gt;
* [[F15: Minion]]&lt;br /&gt;
* [[F15: ThunderBird]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE243 Fall 2014 | Fall 2014]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F14: Team2-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team3-Self Driving Car - Optimus Prime]]&lt;br /&gt;
* [[F14: Team4-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team5-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Self Driving Undergrad Team]]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_CAN-ster_Truck&amp;diff=58851</id>
		<title>S20: CAN-ster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_CAN-ster_Truck&amp;diff=58851"/>
				<updated>2020-03-11T01:04:22Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: Created page with &amp;quot;CAN-STER TRUCK LOGO  ==  CAN-STER TRUCK  ==  == Abstract == The CAN-STER Truck Project is an autonomous RC car with CAN Bus i...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:group_logo.jpg|thumb|795px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
==  CAN-STER TRUCK  ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The CAN-STER Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS and CAN modules) was divided among by six team members. The aim of the project is to develop an autonomous RC Car which can navigate from the source location to a selected destination by avoiding obstacles in its path using sensors and motors.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
The project was divided into N modules:&lt;br /&gt;
&lt;br /&gt;
* Sensor ...&lt;br /&gt;
* Motor..&lt;br /&gt;
* ...&lt;br /&gt;
* Android&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
&amp;lt;Team Picture&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab Project Link - [https://gitlab.com/coder137/can-ster_truck  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Provide ECU names and members responsible&amp;gt;&lt;br /&gt;
&amp;lt;One member may participate in more than one ECU&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
'''Team Roles are Pending'''&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
1) Niket Naidu [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
2) Ashish Anant Ladage [https://gitlab.com/ashishladage1  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
3) Ganesh Ram Pamadi [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
4) Nikhil Pabbisetty [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
5) Akhil Cherukuri [https://gitlab.com/akhilcherukuri  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
6) Jesus De Haro De Reza [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sensor&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Motor&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Geographical&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Communication Bridge Controller &amp;amp; LCD&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Android Application&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Testing Team&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 02/11/2020&lt;br /&gt;
| 02/17/2020&lt;br /&gt;
|&lt;br /&gt;
*Form teams and decide group name&lt;br /&gt;
*Review past projects&lt;br /&gt;
*Create Slack group and invite Preet&lt;br /&gt;
*Create groups Gitlab repository&lt;br /&gt;
*Analysis of component required&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 02/18/2020&lt;br /&gt;
| 02/24/2020&lt;br /&gt;
|&lt;br /&gt;
*Study CAN Communication&lt;br /&gt;
*Create Bill of Materials&lt;br /&gt;
*Order RC Car &lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 02/25/2020&lt;br /&gt;
| 03/02/2020&lt;br /&gt;
|&lt;br /&gt;
*Setup team finance management using Splitwise&lt;br /&gt;
*Complete Bill of Materials&lt;br /&gt;
*Order all other required components&lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 03/03/2020&lt;br /&gt;
| 03/09/2020&lt;br /&gt;
|&lt;br /&gt;
*Read the respective datasheets and manuals for each component&lt;br /&gt;
*Test each component for working conditions&lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 03/10/2020&lt;br /&gt;
| 03/16/2020&lt;br /&gt;
|&lt;br /&gt;
*Assign team responsibilities and roles&lt;br /&gt;
*Environmental setup of Android&lt;br /&gt;
*Decide PCB Editing Software (Kicad vs Eagle)&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 03/17/2020&lt;br /&gt;
| 03/23/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 03/24/2020&lt;br /&gt;
| 03/30/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 03/31/2020&lt;br /&gt;
| 04/06/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| 04/07/2020&lt;br /&gt;
| 04/13/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| 04/14/2020&lt;br /&gt;
| 04/20/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| 04/21/2020&lt;br /&gt;
| 04/27/2020&lt;br /&gt;
|&lt;br /&gt;
*Finalize RC Car For Project Proto 1&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| 04/28/2020&lt;br /&gt;
| 05/04/2020&lt;br /&gt;
|&lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*Finalize RC Car for Project Demo&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*Finalize RC Car for Project Proto 2&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| 05/14/2020&lt;br /&gt;
| 05/21/2020&lt;br /&gt;
|&lt;br /&gt;
* Complete Individual Contribution Peer Grading&lt;br /&gt;
* Review and Complete Wiki Project Page&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bill Of Materials ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Desciption&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| Microcontroller Boards&lt;br /&gt;
| SJ2 LPC 1758 (Purchased from Preet Kang)&lt;br /&gt;
| 5&lt;br /&gt;
| $250.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| CAN Transceivers &lt;br /&gt;
| [http://www.microchip.com/wwwproducts/en/en010405  Microchip MCP2551-I/P]&lt;br /&gt;
| 15&lt;br /&gt;
| Free Samples&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| RC Car &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| Lithium-Ion Battery&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| Lithium-Ion Battery Charger&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| Compass CMP11&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printed Circuit Board  ==&lt;br /&gt;
&amp;lt;Picture and information, including links to your PCB&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== CAN Communication ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&amp;lt;Gitlab link to your DBC file&amp;gt;&lt;br /&gt;
&amp;lt;You can optionally use an inline image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Sensor ECU ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Motor ECU ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Geographical Controller ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Communication Bridge Controller &amp;amp; LCD ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Master Module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Mobile Application ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&amp;lt;Organized summary of the project&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;What did you learn?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
&amp;lt;Bullet points and discussion&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Industrial_Application_using_CAN_Bus&amp;diff=58850</id>
		<title>Industrial Application using CAN Bus</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=Industrial_Application_using_CAN_Bus&amp;diff=58850"/>
				<updated>2020-03-11T01:01:09Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /*  Spring 2020 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Class Information =&lt;br /&gt;
==Presentation on Autonomous Vehicles==&lt;br /&gt;
http://www.slideshare.net/ShantanuVashishtha1/autonomous-vehicles-70049669&lt;br /&gt;
&lt;br /&gt;
== Useful Topics ==&lt;br /&gt;
&lt;br /&gt;
=== Git ===&lt;br /&gt;
[[Basic Git Tutorial]]&lt;br /&gt;
&amp;lt;BR/ &amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CAN Bus ===&lt;br /&gt;
[[CAN BUS Tutorial | CAN BUS]]&lt;br /&gt;
&amp;lt;BR/ &amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[DBC Format]] ===&lt;br /&gt;
DBC format is a well known format to describe the format of a CAN message.  This is essentially the schema of the data that is communicated over the CAN bus.  Please view the linked [[DBC Format]] article for details before reading further.&lt;br /&gt;
&lt;br /&gt;
=== BusMaster Tutorial ===&lt;br /&gt;
[[BusMaster | BusMaster Tutorial]]&lt;br /&gt;
&lt;br /&gt;
== Class Assignments ==&lt;br /&gt;
=== [[Lab Assignments]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Class Project ==&lt;br /&gt;
=== [[Self-driving Car]] ===&lt;br /&gt;
In this class project, students accomplish a self-drivable RC car with the following learning objectives:&lt;br /&gt;
*  Learn CAN Bus and how to communicate in an industrial or  automotive environment.&lt;br /&gt;
*  Learn integration and testing across different controllers.&lt;br /&gt;
*  Learn how to work in teams.&lt;br /&gt;
*  Learn basics of an RTOS.&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Autonomous RC Car Project Report Template]]&lt;br /&gt;
&lt;br /&gt;
== Class Project Reports ==&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2020 | Spring 2020]] ===&lt;br /&gt;
*  [[S20: Nimble]]&lt;br /&gt;
*  [[S20: Bucephalus]]&lt;br /&gt;
*  [[S20: CAN-ster Truck]]&lt;br /&gt;
*  [[S20: Tesla Model RC]]&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2019 | Spring 2019]] ===&lt;br /&gt;
*  [[S19: CANT Bus | S19: CANT Bus]]&lt;br /&gt;
*  [[S19: Tech Savy | S19: Tech Savy]]&lt;br /&gt;
*  [[S19: Mystery Machine | S19: Mystery Machine]]&lt;br /&gt;
*  [[S19: Run D.B.C | S19: Run D.B.C]]&lt;br /&gt;
*  [[S19: Hot Wheels | S19: Hot Wheels]]&lt;br /&gt;
*  [[S19: Zeus | S19: Zeus]]&lt;br /&gt;
*  [[S19: Automophiles | S19: Automophiles]]&lt;br /&gt;
*  [[S19: Lightfury | S19: Lightfury]]&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2017 | Fall 2017]] ===&lt;br /&gt;
*  [[F17: Alpha | F17: Alpha]]&lt;br /&gt;
*  [[F17: FoxP2 | F17 FoxP2]]&lt;br /&gt;
*  [[F17: Optimus | F17 Optimus]]&lt;br /&gt;
*  [[F17: Tata Nano | F17 Tata Nano]]&lt;br /&gt;
*  [[F17: Viserion | F17 Viserion]]&lt;br /&gt;
*  [[F17: Vindicators100 | F17 Vindicators100]]&lt;br /&gt;
*  [[F17: Rolling Thunder | F17: Rolling Thunder]]&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2016 | Fall 2016]] ===&lt;br /&gt;
*  [[F16: Spartan and Furious | F16: Spartan and Furious]]&lt;br /&gt;
*  [[F16: Titans | F16: Titans]]&lt;br /&gt;
*  [[F16: Kasper | F16: Kasper]]&lt;br /&gt;
*  [[F16: AutoNav | F16: AutoNav]]&lt;br /&gt;
*  [[F16: Thunderbolt| F16: Thunderbolt]]&lt;br /&gt;
*  [[F16: The-Nine| F16: The-Nine]]&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2015 | Fall 2015]] ===&lt;br /&gt;
* [[F15: Quadcopter by Thomas]]&lt;br /&gt;
* [[F15: Undergrads++]]&lt;br /&gt;
* [[F15: TopGun]]&lt;br /&gt;
* [[F15: Fury]]&lt;br /&gt;
* [[F15: Minion]]&lt;br /&gt;
* [[F15: ThunderBird]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE243 Fall 2014 | Fall 2014]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F14: Team2-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team3-Self Driving Car - Optimus Prime]]&lt;br /&gt;
* [[F14: Team4-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team5-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Self Driving Undergrad Team]]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=58848</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=58848"/>
				<updated>2020-03-11T00:53:25Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:group_logo.jpg|thumb|795px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
==  CAN-STER TRUCK  ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The CAN-STER Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the RC car's subsystem modules (Interfacing of Ultrasonic Sensor, LIDAR, Bluetooth, GPS and CAN modules) was divided among by six team members. The aim of the project is to develop an autonomous RC Car which can navigate from the source location to a selected destination by avoiding obstacles in its path using sensors and motors.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
The project was divided into N modules:&lt;br /&gt;
&lt;br /&gt;
* Sensor ...&lt;br /&gt;
* Motor..&lt;br /&gt;
* ...&lt;br /&gt;
* Android&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
&amp;lt;Team Picture&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab Project Link - [https://gitlab.com/coder137/can-ster_truck  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Provide ECU names and members responsible&amp;gt;&lt;br /&gt;
&amp;lt;One member may participate in more than one ECU&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
'''Team Roles are Pending'''&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
1) Niket Naidu [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
2) Ashish Anant Ladage [https://gitlab.com/ashishladage1  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
3) Ganesh Ram Pamadi [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
4) Nikhil Pabbisetty [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
5) Akhil Cherukuri [https://gitlab.com/akhilcherukuri  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
6) Jesus De Haro De Reza [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sensor&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Motor&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Geographical&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Communication Bridge Controller &amp;amp; LCD&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Android Application&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Testing Team&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 02/11/2020&lt;br /&gt;
| 02/17/2020&lt;br /&gt;
|&lt;br /&gt;
*Form teams and decide group name&lt;br /&gt;
*Review past projects&lt;br /&gt;
*Create Slack group and invite Preet&lt;br /&gt;
*Create groups Gitlab repository&lt;br /&gt;
*Analysis of component required&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 02/18/2020&lt;br /&gt;
| 02/24/2020&lt;br /&gt;
|&lt;br /&gt;
*Study CAN Communication&lt;br /&gt;
*Create Bill of Materials&lt;br /&gt;
*Order RC Car &lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 02/25/2020&lt;br /&gt;
| 03/02/2020&lt;br /&gt;
|&lt;br /&gt;
*Setup team finance management using Splitwise&lt;br /&gt;
*Complete Bill of Materials&lt;br /&gt;
*Order all other required components&lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 03/03/2020&lt;br /&gt;
| 03/09/2020&lt;br /&gt;
|&lt;br /&gt;
*Read the respective datasheets and manuals for each component&lt;br /&gt;
*Test each component for working conditions&lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 03/10/2020&lt;br /&gt;
| 03/16/2020&lt;br /&gt;
|&lt;br /&gt;
*Assign team responsibilities and roles&lt;br /&gt;
*Environmental setup of Android&lt;br /&gt;
*Decide PCB Editing Software (Kicad vs Eagle)&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 03/17/2020&lt;br /&gt;
| 03/23/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 03/24/2020&lt;br /&gt;
| 03/30/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 03/31/2020&lt;br /&gt;
| 04/06/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| 04/07/2020&lt;br /&gt;
| 04/13/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| 04/14/2020&lt;br /&gt;
| 04/20/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| 04/21/2020&lt;br /&gt;
| 04/27/2020&lt;br /&gt;
|&lt;br /&gt;
*Finalize RC Car For Project Proto 1&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| 04/28/2020&lt;br /&gt;
| 05/04/2020&lt;br /&gt;
|&lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*Finalize RC Car for Project Demo&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*Finalize RC Car for Project Proto 2&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| 05/14/2020&lt;br /&gt;
| 05/21/2020&lt;br /&gt;
|&lt;br /&gt;
* Complete Individual Contribution Peer Grading&lt;br /&gt;
* Review and Complete Wiki Project Page&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bill Of Materials ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Desciption&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| Microcontroller Boards&lt;br /&gt;
| SJ2 LPC 1758 (Purchased from Preet Kang)&lt;br /&gt;
| 5&lt;br /&gt;
| $250.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| CAN Transceivers &lt;br /&gt;
| [http://www.microchip.com/wwwproducts/en/en010405  Microchip MCP2551-I/P]&lt;br /&gt;
| 15&lt;br /&gt;
| Free Samples&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| RC Car &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| Lithium-Ion Battery&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| Lithium-Ion Battery Charger&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| Compass CMP11&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printed Circuit Board  ==&lt;br /&gt;
&amp;lt;Picture and information, including links to your PCB&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== CAN Communication ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&amp;lt;Gitlab link to your DBC file&amp;gt;&lt;br /&gt;
&amp;lt;You can optionally use an inline image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Sensor ECU ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Motor ECU ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Geographical Controller ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Communication Bridge Controller &amp;amp; LCD ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Master Module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Mobile Application ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&amp;lt;Organized summary of the project&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;What did you learn?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
&amp;lt;Bullet points and discussion&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=58846</id>
		<title>S20: Canster Truck</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S20:_Canster_Truck&amp;diff=58846"/>
				<updated>2020-03-11T00:51:13Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:group_logo.jpg|thumb|795px|caption|right|CAN-STER TRUCK LOGO]]&lt;br /&gt;
&lt;br /&gt;
==  CAN-STER TRUCK  ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The CAN-STER Truck Project is an autonomous RC car with CAN Bus interfaced controllers. The development of the R.C car's subsystem modules was divided amongst and performed by six team members. The aim of the project is to develop an autonomous RC Car which can navigate from the source location to a selected destination by avoiding obstacles in its path using sensors and motors.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
The project was divided into N modules:&lt;br /&gt;
&lt;br /&gt;
* Sensor ...&lt;br /&gt;
* Motor..&lt;br /&gt;
* ...&lt;br /&gt;
* Android&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
&amp;lt;Team Picture&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gitlab Project Link - [https://gitlab.com/coder137/can-ster_truck  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Provide ECU names and members responsible&amp;gt;&lt;br /&gt;
&amp;lt;One member may participate in more than one ECU&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
'''Team Roles are Pending'''&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
1) Niket Naidu [https://gitlab.com/coder137  Gitlab] &lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
2) Ashish Anant Ladage [https://gitlab.com/ashishladage1  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
3) Ganesh Ram Pamadi [https://gitlab.com/ganeshram2493  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
4) Nikhil Pabbisetty [https://gitlab.com/nikhilpeoria  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
5) Akhil Cherukuri [https://gitlab.com/akhilcherukuri  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
6) Jesus De Haro De Reza [https://gitlab.com/deharo27  Gitlab]&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sensor&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Motor&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Geographical&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Communication Bridge Controller &amp;amp; LCD&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Android Application&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
* Testing Team&lt;br /&gt;
** Link to Gitlab user1&lt;br /&gt;
** Link to Gitlab user2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 02/11/2020&lt;br /&gt;
| 02/17/2020&lt;br /&gt;
|&lt;br /&gt;
*Form teams and decide group name&lt;br /&gt;
*Review past projects&lt;br /&gt;
*Create Slack group and invite Preet&lt;br /&gt;
*Create groups Gitlab repository&lt;br /&gt;
*Analysis of component required&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 02/18/2020&lt;br /&gt;
| 02/24/2020&lt;br /&gt;
|&lt;br /&gt;
*Study CAN Communication&lt;br /&gt;
*Create Bill of Materials&lt;br /&gt;
*Order RC Car &lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 02/25/2020&lt;br /&gt;
| 03/02/2020&lt;br /&gt;
|&lt;br /&gt;
*Setup team finance management using Splitwise&lt;br /&gt;
*Complete Bill of Materials&lt;br /&gt;
*Order all other required components&lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 03/03/2020&lt;br /&gt;
| 03/09/2020&lt;br /&gt;
|&lt;br /&gt;
*Read the respective datasheets and manuals for each component&lt;br /&gt;
*Test each component for working conditions&lt;br /&gt;
|&lt;br /&gt;
*Completed&lt;br /&gt;
*Completed&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 03/10/2020&lt;br /&gt;
| 03/16/2020&lt;br /&gt;
|&lt;br /&gt;
*Assign team responsibilities and roles&lt;br /&gt;
*Environmental setup of Android&lt;br /&gt;
*Decide PCB Editing Software &lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 03/17/2020&lt;br /&gt;
| 03/23/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 03/24/2020&lt;br /&gt;
| 03/30/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 03/31/2020&lt;br /&gt;
| 04/06/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| 04/07/2020&lt;br /&gt;
| 04/13/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| 04/14/2020&lt;br /&gt;
| 04/20/2020&lt;br /&gt;
|&lt;br /&gt;
*Incomplete&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 11&lt;br /&gt;
| 04/21/2020&lt;br /&gt;
| 04/27/2020&lt;br /&gt;
|&lt;br /&gt;
*Finalize RC Car For Project Proto 1&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 12&lt;br /&gt;
| 04/28/2020&lt;br /&gt;
| 05/04/2020&lt;br /&gt;
|&lt;br /&gt;
*April 28th: Project Proto 1&lt;br /&gt;
*Finalize RC Car for Project Demo&lt;br /&gt;
*May 1st: Project Presentation&lt;br /&gt;
*Finalize RC Car for Project Proto 2&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 13&lt;br /&gt;
| 05/14/2020&lt;br /&gt;
| 05/21/2020&lt;br /&gt;
|&lt;br /&gt;
* Complete Individual Contribution Peer Grading&lt;br /&gt;
* Review and Complete Wiki Project Page&lt;br /&gt;
|&lt;br /&gt;
*Pending&lt;br /&gt;
*Pending&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bill Of Materials ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Desciption&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Part Model &amp;amp; Vendor&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Cost in USD&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| Microcontroller Boards&lt;br /&gt;
| SJ2 LPC 1758 (Purchased from Preet Kang)&lt;br /&gt;
| 5&lt;br /&gt;
| $250.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| CAN Transceivers &lt;br /&gt;
| [http://www.microchip.com/wwwproducts/en/en010405  Microchip MCP2551-I/P]&lt;br /&gt;
| 15&lt;br /&gt;
| Free Samples&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| RC Car &lt;br /&gt;
| [https://www.amazon.com/Traxxas-Slash-Course-2-4GHZ-Vehicle/dp/B01DU474B0/ref=sr_1_3?ie=UTF8&amp;amp;qid=1474747759&amp;amp;sr=8-3&amp;amp;keywords=Traxxas+1%2F10+slash+2wd   Traxxas 2WD RTR with 2.4Ghz Radio]&lt;br /&gt;
| 1&lt;br /&gt;
| $260.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| Lithium-Ion Battery&lt;br /&gt;
| [https://www.rcsuperstore.com/traxxas-7600mah-2s-7-4v-25c-id-lipo-battery-pack/  Traxxas 7600mAh 2S 7.4V 25C iD LiPo Battery Pack]&lt;br /&gt;
| 1&lt;br /&gt;
| $75.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| Lithium-Ion Battery Charger&lt;br /&gt;
| [https://www.amazon.com/Traxxas-2970-EZ-Peak-Charger-Identification/dp/B00OAFYLJC/ref=pd_bxgy_21_img_2?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=JVX791WVV9Y8T9DW92KW Traxxas 2970 EZ-Peak Plus 4-Amp NiMH/LiPo Fast Charger]&lt;br /&gt;
| 1&lt;br /&gt;
| $50.00&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| Compass CMP11&lt;br /&gt;
| [https://www.dfrobot.com/product-1275.html  DFRobot CMPS11 Compass]&lt;br /&gt;
| 1&lt;br /&gt;
| $29.99&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 9&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 10&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| 1&lt;br /&gt;
| $&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Printed Circuit Board  ==&lt;br /&gt;
&amp;lt;Picture and information, including links to your PCB&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== CAN Communication ==&lt;br /&gt;
&amp;lt;Talk about your message IDs or communication strategy, such as periodic transmission, MIA management etc.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&amp;lt;Show your CAN bus hardware design&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DBC File ===&lt;br /&gt;
&amp;lt;Gitlab link to your DBC file&amp;gt;&lt;br /&gt;
&amp;lt;You can optionally use an inline image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Sensor ECU ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Motor ECU ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Geographical Controller ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Communication Bridge Controller &amp;amp; LCD ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Master Module ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Mobile Application ==&lt;br /&gt;
&amp;lt;Picture and link to Gitlab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&amp;lt;List the code modules that are being called periodically.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical Challenges ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt; List of problems and their detailed resolutions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&amp;lt;Organized summary of the project&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;What did you learn?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
&lt;br /&gt;
=== Advise for Future Students ===&lt;br /&gt;
&amp;lt;Bullet points and discussion&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58282</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58282"/>
				<updated>2019-12-19T00:03:04Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Team Members &amp;amp; Technical Responsibilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
[[File:frequency_bands.png|800px|thumb|center|Frequency bands]]&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
[[File:Title Screen.jpeg|800px|thumb|center|Title Screen]]&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Integrating MP3 player with the Game&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Monitoring and controlling the CPU utilization&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
== Pin Configuration ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin Description&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R1&lt;br /&gt;
| Sets upper panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G1&lt;br /&gt;
| Sets upper panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B1&lt;br /&gt;
| Sets upper panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R2&lt;br /&gt;
| Sets lower panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G2&lt;br /&gt;
| Sets lower panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B2&lt;br /&gt;
| Sets lower panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| A&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B&lt;br /&gt;
|  Sets row bit 1&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| C&lt;br /&gt;
|  Sets row bit 2&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| D&lt;br /&gt;
|  Sets row bit 3&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| E&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| nOE&lt;br /&gt;
|  Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| LATCH&lt;br /&gt;
|  Set to mark completion of one row&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| CLK&lt;br /&gt;
|  Set to access each pixel&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GND&lt;br /&gt;
|  Ground pins to be connected with board's GND.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Spec&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Value&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Pitch&lt;br /&gt;
| 4mm&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Resolution&lt;br /&gt;
| 32 x 64 = 2048 dots&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Panel dimensions (l x b x h) in mm&lt;br /&gt;
| 256 x 128 x 13&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Working voltage/current rating&lt;br /&gt;
| 5v / 4A (max)&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Scan Rate&lt;br /&gt;
| 1 / 16&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Pixel component configuration (R,G,B)&lt;br /&gt;
| (1,1,1)&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Weight&lt;br /&gt;
|0.24 kg&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58273</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58273"/>
				<updated>2019-12-18T23:52:10Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Pin Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
[[File:frequency_bands.png|800px|thumb|center|Frequency bands]]&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
[[File:Title Screen.jpeg|800px|thumb|center|Title Screen]]&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
== Pin Configuration ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin Description&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R1&lt;br /&gt;
| Sets upper panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G1&lt;br /&gt;
| Sets upper panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B1&lt;br /&gt;
| Sets upper panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R2&lt;br /&gt;
| Sets lower panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G2&lt;br /&gt;
| Sets lower panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B2&lt;br /&gt;
| Sets lower panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| A&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B&lt;br /&gt;
|  Sets row bit 1&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| C&lt;br /&gt;
|  Sets row bit 2&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| D&lt;br /&gt;
|  Sets row bit 3&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| E&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| nOE&lt;br /&gt;
|  Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| LATCH&lt;br /&gt;
|  Set to mark completion of one row&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| CLK&lt;br /&gt;
|  Set to access each pixel&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GND&lt;br /&gt;
|  Ground pins to be connected with board's GND.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Spec&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Value&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Pitch&lt;br /&gt;
| 4mm&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Resolution&lt;br /&gt;
| 32 x 64 = 2048 dots&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Panel dimensions (l x b x h) in mm&lt;br /&gt;
| 256 x 128 x 13&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Working voltage/current rating&lt;br /&gt;
| 5v / 4A (max)&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Scan Rate&lt;br /&gt;
| 1 / 16&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Pixel component configuration (R,G,B)&lt;br /&gt;
| (1,1,1)&lt;br /&gt;
|-&lt;br /&gt;
| scope=&amp;quot;row&amp;quot;| Weight&lt;br /&gt;
|0.24 kg&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58269</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58269"/>
				<updated>2019-12-18T23:46:25Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Technical Challenges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
[[File:frequency_bands.png|800px|thumb|center|Frequency bands]]&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
[[File:Title Screen.jpeg|800px|thumb|center|Title Screen]]&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
== Pin Configuration ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin Desciption&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R1&lt;br /&gt;
| Sets upper panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G1&lt;br /&gt;
| Sets upper panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B1&lt;br /&gt;
| Sets upper panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R2&lt;br /&gt;
| Sets lower panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G2&lt;br /&gt;
| Sets lower panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B2&lt;br /&gt;
| Sets lower panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| A&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B&lt;br /&gt;
|  Sets row bit 1&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| C&lt;br /&gt;
|  Sets row bit 2&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| D&lt;br /&gt;
|  Sets row bit 3&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| E&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| nOE&lt;br /&gt;
|  Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| LATCH&lt;br /&gt;
|  Set to mark completion of one row&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| CLK&lt;br /&gt;
|  Set to access each pixel&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GND&lt;br /&gt;
|  Ground pins to be connected with board's GND.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58268</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58268"/>
				<updated>2019-12-18T23:46:24Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* RGB LED Matrix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
[[File:frequency_bands.png|800px|thumb|center|Frequency bands]]&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
[[File:Title Screen.jpeg|800px|thumb|center|Title Screen]]&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
== Pin Configuration ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Pin Desciption&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R1&lt;br /&gt;
| Sets upper panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G1&lt;br /&gt;
| Sets upper panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B1&lt;br /&gt;
| Sets upper panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| R2&lt;br /&gt;
| Sets lower panel's Red data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| G2&lt;br /&gt;
| Sets lower panel's Green data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B2&lt;br /&gt;
| Sets lower panel's Blue data&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| A&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| B&lt;br /&gt;
|  Sets row bit 1&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| C&lt;br /&gt;
|  Sets row bit 2&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| D&lt;br /&gt;
|  Sets row bit 3&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| E&lt;br /&gt;
|  Sets row bit 0&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| nOE&lt;br /&gt;
|  Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| LATCH&lt;br /&gt;
|  Set to mark completion of one row&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| CLK&lt;br /&gt;
|  Set to access each pixel&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| GND&lt;br /&gt;
|  Ground pins to be connected with board's GND.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58262</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58262"/>
				<updated>2019-12-18T23:40:08Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Introduction &amp;amp; Objectives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
[[File:frequency_bands.png|800px|thumb|center|Frequency bands]]&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
[[File:Title Screen.jpeg|800px|thumb|center|Title Screen]]&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Frequency_bands.png&amp;diff=58260</id>
		<title>File:Frequency bands.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Frequency_bands.png&amp;diff=58260"/>
				<updated>2019-12-18T23:39:42Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58253</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58253"/>
				<updated>2019-12-18T23:37:30Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Introduction &amp;amp; Objectives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
[[File:Title Screen.jpeg|800px|thumb|center|Title Screen]]&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58249</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58249"/>
				<updated>2019-12-18T23:35:42Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* OLED Screen */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
[[File:Oled_screen.jpeg|thumb|600x600px|center|Oled Screen Functionality]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Title_Screen.jpeg&amp;diff=58245</id>
		<title>File:Title Screen.jpeg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Title_Screen.jpeg&amp;diff=58245"/>
				<updated>2019-12-18T23:34:17Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: Proj user22 uploaded a new version of File:Title Screen.jpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Game Fury Title Screen&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Oled_screen.jpeg&amp;diff=58234</id>
		<title>File:Oled screen.jpeg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Oled_screen.jpeg&amp;diff=58234"/>
				<updated>2019-12-18T23:31:51Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Title_Screen.jpeg&amp;diff=58229</id>
		<title>File:Title Screen.jpeg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Title_Screen.jpeg&amp;diff=58229"/>
				<updated>2019-12-18T23:17:01Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: Game Fury Title Screen&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Game Fury Title Screen&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58223</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58223"/>
				<updated>2019-12-18T23:01:22Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Technical Challenges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
* Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
* Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
* Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''PCB Designing'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* We realized that using GPP for long term is not a good idea. Initially we spent time in debugging our hardware and later we have realized like we can’t take this for our final day.&lt;br /&gt;
* We did multiple reviews before ordering our final PCB as none of us did that earlier. We have faced issue in manual routing on Eagle Autodesk but our ISA Prashant helped us and he reviewed our PCB design twice.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Mobile Application'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main challenge of the Mobile application was to make the UI interactive while getting data asynchronously over the Bluetooth module.&lt;br /&gt;
* There was a global listener stream implemented that got the value and concatenate the string till we received the end frame (##).&lt;br /&gt;
* However the challenge still existed to know which screen has called what data which prompted us to create the key and ACK/NACK pair in the start.&lt;br /&gt;
* The Mobile app is completely data reactive, which means that the UI components render and change according to the data provided. This caused a lot of issues mainly since we tried polling methods to make sure that the UI remains up to date with the STATE of the SJ2 Board.&lt;br /&gt;
* A manual approach was opted for mainly to make the system more deterministic and for better debugging capabilities.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58147</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58147"/>
				<updated>2019-12-18T22:17:02Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
https://youtu.be/vVjHCoyWYz4&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58135</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58135"/>
				<updated>2019-12-18T22:06:15Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Suggestions for Future Students */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing a simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up the entire row/column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls, etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Tips for getting GOOD Grades and to remain in top 3 teams'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Select your teammates wisely, and make sure every one dedicates themself for this project.&lt;br /&gt;
* Be an active member of your team and review rubrics for the final DEMO.&lt;br /&gt;
* As soon as the professor mentions the project, please start working on the project otherwise, in the end, you have to struggle with finals and you will be left with less time for testing and you have to struggle in demo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''General tips'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
* Remember the KISS approach when you code. (Keep It Simple and Stupid).&lt;br /&gt;
* For this project, one should know the basics in C/ C++, FreeRTOS, and some good debugging skills. Because if you don't have one, you will eventually end up spending more time debugging your problem.&lt;br /&gt;
* Always give meaningful names to the variable or the function, so a third person reviewing the code gets an overall idea by just reading the name.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Cmpe244_F19_Infinity_Mirror_members.jpeg&amp;diff=58098</id>
		<title>File:Cmpe244 F19 Infinity Mirror members.jpeg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Cmpe244_F19_Infinity_Mirror_members.jpeg&amp;diff=58098"/>
				<updated>2019-12-18T21:29:50Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58092</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58092"/>
				<updated>2019-12-18T21:20:35Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58088</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58088"/>
				<updated>2019-12-18T21:17:43Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''. On the main screen we first connect to the bluetooth before establishing connection with any of the modes. The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58087</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58087"/>
				<updated>2019-12-18T21:16:42Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Android App */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Mobile Application'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
====1. Game Mode ====&lt;br /&gt;
&lt;br /&gt;
Wireless communication with the Entertainment box communication over Bluetooth protocol. Android Application is created which provides an interface to exchange data and configure the device.To enter the Game Mode screen we first check if the Bluetooth Connection is established. We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot; We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.If the fruit had appeared in any of the quadrant then will send data from BLE APP to SJTwo Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' First Quadrant (North-East): 0x71 &amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Second Quadrant (North-West): 0x72 &amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Third Quadrant (South-West): 0x73 &amp;lt;br&amp;gt;&lt;br /&gt;
'''4.''' Fourth Quadrant (South-East): 0x74 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====2. MP3 Mode ====&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0. These values are loaded into the MP3 Mode Screen as initial values for the current song playing. We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Playing and Pausing Song - We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&amp;lt;br&amp;gt;&lt;br /&gt;
'''2.''' Next Song and Previous Song - Command for the previous and next song is 0xC0 and 0xC2.&amp;lt;br&amp;gt;&lt;br /&gt;
'''3.''' Control Volume remotely - For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one step. This is parsed on the SJ2 Board and converted to an equivalent volume signal.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. MP3 Song List ====&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58073</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58073"/>
				<updated>2019-12-18T20:59:40Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Audio Frequency Analyzer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Audio Frequency Analyser====&lt;br /&gt;
Audio frequency analyser is working is most important task in order to get correct value. Incorrect initialisation and in efficient delays may cause error. In this project Init and reading of data at each frequncy band is implemented based on timing diagram shown as bellow: &lt;br /&gt;
&lt;br /&gt;
[[File:244 Spark TimingDiagram AudioAnalyser.jpeg|thumb|550x400px|centre|Timing Diagram of Audio Analyser]]&lt;br /&gt;
&lt;br /&gt;
The software Implementation to Init frequency analyser is as follow:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Select ADC pin&amp;lt;br&amp;gt;&lt;br /&gt;
2. Select GPIO pin direction for reset pin and STOBE pin&amp;lt;br&amp;gt;&lt;br /&gt;
3. Reset Audio frequency analyser&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58068</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58068"/>
				<updated>2019-12-18T20:55:10Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when Initialised.&lt;br /&gt;
* Uses of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning Optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilisation of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
* We realised that using GPP for long term is not a good idea, there were some breakdown in the wires and our MP3 stopped working. Initially we spent a lot of time debugging hardware and doing soldering. So we started designing the PCB, and when our PCB was done, we spent hardly any time debugging the hardware.&lt;br /&gt;
* Git : We learnt all the basic of GIT and it plays an important to role for source code versioning.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58064</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58064"/>
				<updated>2019-12-18T20:50:11Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Acknowledgement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
&lt;br /&gt;
We would like to express our gratitude to Professor Preetpal Kang for generously sharing his time and knowledge with us and guiding us through the completion of this project. We would also like to thank the Prashant Gandhi(ISA) for their valuable advice and constructive feedback.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58061</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58061"/>
				<updated>2019-12-18T20:47:52Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
// Task to send data to decoder(High priority)&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58058</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58058"/>
				<updated>2019-12-18T20:46:59Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
 static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58056</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58056"/>
				<updated>2019-12-18T20:45:28Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
We are interfacing MP3 Decoder on the SPI0 for reading the Audio Mp3 file from the SDCard and send Mp3 data to the Decoder. The purpose of this task is to send mp3 data to the mp3 decoder. This is a high priority as it is acting as a consumer. The producer task in our project is the task that reads songs that fill the freeRTOS queue with 4KB of data. The consumer task i.e the task that sends a song to the mp3 decoder that waits on an empty queue for portMAX_DELAY. Once the queue has data, the task starts sending 32 bytes at a time to the MP3 decoder. Once 32 bytes are sent, the task waits for the DREQ pin to get high. DREQ pin high indicates that the MP3 decoder unit is ready to take 32 bytes of data. For sending data, the task acquires the MUTEX so that no other task can use the SPI bus at the same time. Once the 32 bytes are sent, the MUTEX is released. This is the working of the task.&lt;br /&gt;
&lt;br /&gt;
static void task__high_priority_to_send_mp3_data_to_decoder(void *pvParam) { static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58054</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58054"/>
				<updated>2019-12-18T20:45:02Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* MP3 Decoder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
static void task__high_priority_to_send_mp3_data_to_decoder(void *pvParam) { static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Audio Frequency Analyzer'''==&lt;br /&gt;
&lt;br /&gt;
In the audio analyser, strobe and reset pins are used to select the DC peak output. Reset high resets the multiplexer. Reset low enables the strobe pin. At the leading edge of the first strobe, the first frequency band 63Hz is on the output. On each additional leading edge strobe the next frequency band(160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, 16kHz) is detected. &lt;br /&gt;
&lt;br /&gt;
This analyser takes input from Audio decoder for left and right side music. SJ2 controls the  RS and ST pins of the &amp;quot;Audio Frequency Analyzer&amp;quot; and reads input data from S pin which is connected to ADC pin (P0.26) of SJ2 board.&lt;br /&gt;
&lt;br /&gt;
*Audio Analyzer S pin  -&amp;gt; SJ2 ADC4 pin&lt;br /&gt;
*Audio Analyzer RS pin   -&amp;gt; SJ2 P0.11 pin &lt;br /&gt;
*Audio Analyzer ST pin   -&amp;gt; SJ2 P2.0 pin &lt;br /&gt;
*Audio Analyzer + pin    -&amp;gt; SJ2 VCC pin &lt;br /&gt;
*Audio Analyzer - pin    -&amp;gt; SJ2 GND pin&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58046</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58046"/>
				<updated>2019-12-18T20:36:38Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
static void task__high_priority_to_send_mp3_data_to_decoder(void *pvParam) { static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}}&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58045</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58045"/>
				<updated>2019-12-18T20:33:49Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
static void task__high_priority_to_send_mp3_data_to_decoder(void *pvParam) {&lt;br /&gt;
  static uint8_t bytes_to_be_sent_to_decoder[READ_BYTES_FROM_FILE];&lt;br /&gt;
  static uint8_t current_count = 0;&lt;br /&gt;
  uint32_t start = 0, end = 0;&lt;br /&gt;
  while (1) {&lt;br /&gt;
    if (0 == current_count) {&lt;br /&gt;
      xQueueReceive(mp3_queue, &amp;amp;bytes_to_be_sent_to_decoder[0], portMAX_DELAY);&lt;br /&gt;
    }&lt;br /&gt;
    start = (current_count * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    end = ((current_count + 1) * TRANSMIT_BYTES_TO_DECODER);&lt;br /&gt;
    while (!mp3__dreq_get_status()) {&lt;br /&gt;
      mp3__decoder_refresh();&lt;br /&gt;
      vTaskDelay(2);&lt;br /&gt;
    }&lt;br /&gt;
    if (xSemaphoreTake(mp3_mutex, portMAX_DELAY)) {&lt;br /&gt;
      mp3__data_cs();&lt;br /&gt;
      send_32_bytes_to_decoder_using_ssp(start, end,&lt;br /&gt;
                                         &amp;amp;bytes_to_be_sent_to_decoder[0]);&lt;br /&gt;
      mp3__data_ds();&lt;br /&gt;
      xSemaphoreGive(mp3_mutex);&lt;br /&gt;
      if (current_count == COUNT - 1) {&lt;br /&gt;
        current_count = start = end = 0;&lt;br /&gt;
      } else {&lt;br /&gt;
        current_count += 1;&lt;br /&gt;
      }}}}&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58044</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58044"/>
				<updated>2019-12-18T20:30:18Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* MP3 Decoder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
The Audio Decoder breakout board communicates with the SJ board over SPI and is interfaced with the SPI-0 pins of the SJ board as follows:&lt;br /&gt;
&lt;br /&gt;
*Clock Pin (Pin 13) - SJ SPI-0 Clock Pin&lt;br /&gt;
*MISO Pin (Pin 12) - SJ SPI-0 MISO Pin&lt;br /&gt;
*MOSI Pin (Pin 11)  - SJ SPI-0 MOSI Pin&lt;br /&gt;
*MP3 CS: Chip Select Pin for the audio decoder to be activated while sending control signals.&lt;br /&gt;
*MP3 DCS: Chip Select Pin for the audio decoder to be activated while sending audio data signals.&lt;br /&gt;
*MP3 RST: Reset pin for the audio decoder. &lt;br /&gt;
*MP3 DREQ: Data Request Pin. Audio decoder signals that it is ready to accept next 32 bytes of audio data.&lt;br /&gt;
*VCC pin - SJ 3.3V pin&lt;br /&gt;
*GND pin - SJ GND Pin&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:Mp3_fLow.png&amp;diff=58043</id>
		<title>File:Mp3 fLow.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:Mp3_fLow.png&amp;diff=58043"/>
				<updated>2019-12-18T20:26:25Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58042</id>
		<title>F19: Infinity Mirror</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F19:_Infinity_Mirror&amp;diff=58042"/>
				<updated>2019-12-18T20:26:06Z</updated>
		
		<summary type="html">&lt;p&gt;Proj user22: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Abstract''' ==&lt;br /&gt;
&lt;br /&gt;
The main theme of the project is to build an interactive embedded system consisting of two entertainment modes - Music and Gaming. On the music mode, the MP3 decoder module reads songs from an SD card on the MCU board and plays the music through a speaker. It deals with the convergence of various services such as playing a game with background music, control volume, switch and pause/play songs. While the song is being played, audio frequency spectrum bands based on music tune are displayed on the LED Matrix band visualization etc. On the game mode, a fruit smashing game called “Fruit Fury” is implemented where the user needs to orient the MCU board in a direction according to where the fruit appears on the LED matrix. Alongside, the user can listen and switch songs. To achieve the above functionalities, various elements such as Audio Decoder, Audio frequency analyzer, 32x64 RGB LED Matrix and HC-05 bluetooth module and Android application are integrated.&lt;br /&gt;
&lt;br /&gt;
[[File:High_level1.png|800px|thumb|center|Block Diagram of Infinity Mirror]]&lt;br /&gt;
&lt;br /&gt;
== '''Introduction &amp;amp; Objectives''' ==&lt;br /&gt;
&lt;br /&gt;
The key features supported by the system is real-time orientation recognition &amp;amp; trigger respective actions in 2 modes - MP3 mode and Game mode.&lt;br /&gt;
&lt;br /&gt;
MP3 MODE:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and perform music control such as play, pause, volume control and changing songs. &lt;br /&gt;
&lt;br /&gt;
2. In response, retrieve the data from the SD Card &amp;amp; communicate to the audio decoder for appropriate audio streaming.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and provide same operations.&lt;br /&gt;
&lt;br /&gt;
4. Display frequency spectrum bands in sync to the tune of the song played.&lt;br /&gt;
&lt;br /&gt;
GAME MODE - Fruit Fury:&lt;br /&gt;
&lt;br /&gt;
1. Determine the accelerometer sensor values based on the orientation of the board and hit the fruit in corresponding direction.&lt;br /&gt;
&lt;br /&gt;
2. Incorporating provision on the board's switches to change to next or previous song.&lt;br /&gt;
&lt;br /&gt;
3. Also implemented interaction with HC-05 bluetooth module through a customized mobile application and play the game through the same.&lt;br /&gt;
&lt;br /&gt;
'''Project Objectives'''&lt;br /&gt;
      '''1. Audio Decoder''' - Fetches song data from the SD card and plays it over a speaker.&lt;br /&gt;
      '''2. RGB LED Matrix''' - Display frequency bands on music mode or view the game on game mode.&lt;br /&gt;
      '''3. Audio Frequency Analyzer''' - To convert the audio data into 7 spectrum bands which is then displayed as individual colored bands on the LED matrix.&lt;br /&gt;
      '''4. Bluetooth HC-05''' - Interfaces the system using Bluetooth to an Android application. &lt;br /&gt;
&lt;br /&gt;
'''Team Objectives'''&lt;br /&gt;
      '''1.''' Learn each and every module as much as possible, in order to develop an overall product.&lt;br /&gt;
      '''2.''' Understand the proper use of queues and semaphores in order to send/receive the data between multiple tasks.&lt;br /&gt;
      '''3.''' Learn to integrate all modules and ensuring smooth transition, communication and context switching at desired time intervals.&lt;br /&gt;
      '''4.''' Document and track all the bugs encountered during development and learn to update git repository after every fix.&lt;br /&gt;
&lt;br /&gt;
== '''Team Members &amp;amp; Technical Responsibilities''' ==&lt;br /&gt;
[[File:cmpe244_F19_Infinity_Mirror_members.jpeg|thumb|500x500px|TEAM INFINITY MIRROR|right]]&lt;br /&gt;
&lt;br /&gt;
*'''''[http://linkedin.com/in/aakash-chitroda-17841740 Aakash Chitroda]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;MP3 Audio Encoder/Decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency Analyzer logic&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/ganeshram93 Ganesh Ram]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of LED Matrix and driver design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Game logic design&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Audio frequency spectrum logic on LED&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Packaging&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/niket-naidu-30090a134/ Niket Naidu]''''' &lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Android &amp;amp; Bluetooth Application&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;OLED Interfacing and Designing&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;PCB Design improvements&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Accelerometer Sensor integration with OLED Screen&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''''[https://www.linkedin.com/in/vidushi-jain-048b992a Vidushi Jain]'''''&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Bluetooth Communication&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Interfacing of Gesture &amp;amp; Accelerometer Sensors&amp;lt;/font&amp;gt;&lt;br /&gt;
** &amp;lt;font color=&amp;quot;BLACK&amp;quot;&amp;gt;Hardware Designing &amp;amp; PCB Integration&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Administrative Responsibilities''' ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: 0px; margin-right: auto;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#588ecc&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; Administrative Roles &amp;lt;/span&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Team Lead &amp;lt;/span&amp;gt; &lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Aakash Chitroda &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; |  &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Finance Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Niket Naidu &amp;lt;/font&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Git Repository Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Wiki Report Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Vidushi Jain &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left;&amp;quot; | &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:#000000&amp;quot;&amp;gt;Bill of Materials Manager &amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Ganesh Ram &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Team Deliverables Schedule''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; WEEK&amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
START DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
END DATE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
TASK DETAILS &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
STATUS &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15 Oct 2019 || 22 Oct 2019 || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Create and establish GitLab repository&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Establish slack channel and invite Preet&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Look through previous years projects and study it&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Distribute major roles among team members&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Completed &amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  2  ||  23 Oct 2019  ||  29 Oct 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create a Bill of Materials &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Select and order Parts &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet and Interfacing Of LED Matrix(Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet for Gesture sensor(Vidushi) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Make Repo on Gitlab for all modules - Follow Naming Convention. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  3  ||  30 Oct 2019 ||  5 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Review Data-sheet of Audio MP3 shield(Aakash) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering for LED matrix and MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Start Soldering of Headers for MP3 Shield &amp;amp; decoder&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Environmental setup of Android &amp;amp; Web applications(Niket) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of Gesture Detection (Vidushi)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of displaying text and basic shapes on LED Matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  4  ||  6 Nov 2019 ||   12 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of OLED Driver(Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Initialization the Audio Decoder through SPI communication and read manufacturer ID &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of random frequency bands on LED matrix (Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Implementation of communication Between two task(gesture_detect &amp;amp; LED_Display) using queues and semaphores (Vidushi)&amp;lt;/font&amp;gt;	&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Display Gesture Sensor Directions on OLED in a Text (Vidushi &amp;amp; Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  5  ||  13 Nov 2019 ||  19 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Circuit Simulation in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; PCB Layout Design in Diptrace/Eagle Tool. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Finalize Components placement on PCB. &amp;lt;/font&amp;gt; &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Read Song from SD Card and send to MP3 Shield &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Receive Values from audio spectrum and send to display task to display on LED Matrix.(Aakash &amp;amp; Ganesh) &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interface OLED with onboard buttons to access the list of songs (Niket)&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Developing logic for the ball movement and translating hand-gesture control into LED movement.(Ganesh)&amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|  6  ||  20 Nov 2019 ||  26 Nov 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Interfacing of all modules sensors, bluetooth , MP3 and LED Matrix&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test whole implementation after integration of all modules&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Test for stack overflow and system crash&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Debug and Test the Play/Pause/Stop functionality of MP3 player &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;  Integrate fruit Fury game logic&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Final Wiki Schedule. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  8  ||  27 Nov 2019 ||   3 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Additional Feature week&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish Bluetooth communication of Device and Mobile APP &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Develop UI on Android application. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Add Play/Pause/Stop and Song selection functionality to the APP. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update Wiki with new details and information. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Enhanced game logic and integrated song play feature in game &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;   &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  9   ||  4 Dec 2019 ||   10 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; TESTING - CRITICAL WEEK  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Packaging of hardware board and related components. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check overall robustness of the complete system. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Establish complete connection on PCB &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update wiki with details. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  10  ||  11 Dec 2019 ||   17 Dec 2019  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; All hands on testing and final bug fixes. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Check for tuning or calibration of sensors if required. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Complete end-to-end testing for various scenarios and conditions. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Create the semester long project activity video and upload to YouTube. &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; Update and finalize wiki. &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt;  &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  11  ||  18 Dec 2019 ||  || &lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''DEMO: Final Project'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''SUBMISSION: Final Project Wiki''' &amp;lt;/font&amp;gt;&lt;br /&gt;
|| &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; Completed &amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Bill of Materials (General Parts)''' ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt; PART NAME &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
PART MODEL &amp;amp; SOURCE &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
QUANTITY &amp;lt;/span&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align: left;&amp;quot; style=&amp;quot;background:#588ecc;&amp;quot; | &amp;lt;span style=&amp;quot;color:#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
COST PER UNIT (USD) &amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Micro-Controller Eval-Boards&lt;br /&gt;
| &lt;br /&gt;
* LPC 4078 (Purchased from Preet Kang)&lt;br /&gt;
|&lt;br /&gt;
* 1&lt;br /&gt;
|&lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio decoder Breakout Board&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/12660 SparkFun MP3 Player Shield]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 26.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Analyzer&lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/dp/B074T9H8JV/ DFR0126 Audio Analyzer]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 19.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* RGB LED matrix&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/14718 32 x 64 RGB LED Matrix Panel]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 49.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Power supply&lt;br /&gt;
| &lt;br /&gt;
* [https://www.sparkfun.com/products/15352 5V / 4A Power Supply]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 12.95&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* Audio Speakers&lt;br /&gt;
| &lt;br /&gt;
* 3.5mm Jack Stereo Speakers&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* Own&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB parts and other Miscellaneous parts&lt;br /&gt;
| &lt;br /&gt;
* Anchor Electronics and Digikey '''&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 50.00&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* 2 way mirror &lt;br /&gt;
| &lt;br /&gt;
* [https://www.amazon.com/gp/product/B06Y2C79FC/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&amp;amp;psc=1 2-way mirror ]&lt;br /&gt;
| &lt;br /&gt;
* 1&lt;br /&gt;
| &lt;br /&gt;
* 7.64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* PCB Fabrication&lt;br /&gt;
| &lt;br /&gt;
* [https://jlcpcb.com/quote JLCPCB]&lt;br /&gt;
| &lt;br /&gt;
* 5&lt;br /&gt;
| &lt;br /&gt;
* 29.53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Printed Circuit Board''' ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Design And Architecture ===&lt;br /&gt;
&lt;br /&gt;
We have designed the custom PCB using Eagle Software and as well as one prototype board in which we have connected all the modules with SJ-Two board. PCB was sent to fabrication to JLCPCB China which provided PCB with lead time of 1 week. We have implemented 2 layers of PCB with all of the parts in top layer.&lt;br /&gt;
&lt;br /&gt;
'''Components Placements on PCB and on Prototype Board'''&lt;br /&gt;
      '''1.''' One SJ-Two board is fitted onto the top of the 3D printed lid cover which with a slot opening for 2x40 IDC cable.&lt;br /&gt;
      '''2.''' MP3 Decoder is connected with SJ-Two board and will be place on the right side of PCB and as well as on Prototype board.&lt;br /&gt;
      '''3.''' Bluetooth Module needs only 4 pins to connect with SJ-Two and goes to UART3 and placed on the top left of the board.&lt;br /&gt;
      '''4.''' LED Matrix is connected using 2x8 IDC cable pins on the top left side of the board.&lt;br /&gt;
      '''5.''' Audio Frequency Analyzer is placed on the bottom side of PCB.&lt;br /&gt;
      '''6.''' Power supply of 5v and 3.3v provisions are made on the bottom left side of PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_Layout.png|500x600px|thumb|left|Top Layer PCB Design On Eagle Software]]&lt;br /&gt;
|[[File:Bottom_Layout.png|500x600px|thumb|right|Bottom Layer PCB Design on Eagle Software]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[File:Top_View.png|500x600px|thumb|left|PCB Top Layer]]&lt;br /&gt;
|[[File:Bottom_View.png|500x600px|thumb|right|PCB Bottom Layer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Infinity Mirror's Internal Circuit'''&lt;br /&gt;
&lt;br /&gt;
[[File:Setup.jpeg|thumb|350x350px|center|Infinity Mirror: Internal Circuit of Embedded Entertainment Box]]&lt;br /&gt;
&lt;br /&gt;
=='''Product Enclosure''' ==&lt;br /&gt;
&lt;br /&gt;
To facilitate easy and convenient gaming experience and also act as an effective audio controller, a single 3D printed enclosure was designed which is spacious enough to accommodate the MCU modules like bluetooth, audio frequency analyzer and MP3 decoder on the PCB.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Top.jpeg|470px|thumb|left|Top View]]&lt;br /&gt;
|[[File:3D.png|430px|thumb|right|3D View]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Final 3D Package===&lt;br /&gt;
[[File:Final_Setup.jpeg|thumb|600x600px|center|Infinity Mirror: Final Setup]]&lt;br /&gt;
&lt;br /&gt;
=='''RGB LED Matrix'''==&lt;br /&gt;
A 32 x 64 RGB LED Matrix will be powered up through a 5V/4A DC adapter and is interfaced with the board to play the game 'Fruit Fury' with desired background song in the game-mode and to display the frequency bands and other relevant messages such as &amp;quot;Next&amp;quot;, &amp;quot;Previous&amp;quot; and &amp;quot;Pause&amp;quot; in the music-mode. Only the INPUT IDC connector will be used because we are not cascading multiple matrices. The matrix has 2 planes (upper and lower), both of which will be programmed separately. In order to set RGB color data for each pixel in plane 1 (top half of the display) we use R1, G1 and B1 pins and for plane 2 we use R2, G2 and B2. By setting and resetting the CLOCK pulse, color data is set for every pixel in the row. Then the LATCH is set to mark end of the row and reset to move to next row. All of these steps are repeated at very less time intervals so that the human eye perceives it as one complete frame (Persistence of Vision).&lt;br /&gt;
&lt;br /&gt;
Below is the description of the pins:&lt;br /&gt;
&lt;br /&gt;
*R1 -&amp;gt; Sets upper panel's Red data&lt;br /&gt;
*G1 -&amp;gt; Sets upper panel's Green data&lt;br /&gt;
*B1 -&amp;gt; Sets upper panel's Blue data&lt;br /&gt;
*R2 -&amp;gt; Sets lower panel's Red data&lt;br /&gt;
*G2 -&amp;gt; Sets lower panel's Green data&lt;br /&gt;
*B2 -&amp;gt; Sets lower panel's Blue data&lt;br /&gt;
*A -&amp;gt; Sets row bit 0&lt;br /&gt;
*B -&amp;gt; Sets row bit 1&lt;br /&gt;
*C -&amp;gt; Sets row bit 2&lt;br /&gt;
*D -&amp;gt; Sets row bit 3 &lt;br /&gt;
*CLK (Clock) -&amp;gt; Set to access each pixel&lt;br /&gt;
*LAT (Latch) -&amp;gt; Set to mark comletion of one row&lt;br /&gt;
*nOE (Output Enable) -&amp;gt; Set to switch the LEDs off when transitioning from one row to the next&lt;br /&gt;
*GND -&amp;gt; Ground pins to be connected with board's GND.&lt;br /&gt;
&lt;br /&gt;
Below are the technical specifications:&lt;br /&gt;
&lt;br /&gt;
*Pitch -&amp;gt; 4 mm&lt;br /&gt;
*Resolution -&amp;gt; 32 x 64 = 2048 dots&lt;br /&gt;
*Panel dimensions (l x b x h) in mm -&amp;gt; 256 x 128 x 13&lt;br /&gt;
*Working voltage/current rating -&amp;gt; 5v / 4A (max)&lt;br /&gt;
*Scan rate - 1/16&lt;br /&gt;
*Pixel component configuration (R,G,B) -&amp;gt; 1,1,1&lt;br /&gt;
*Weight -&amp;gt; 0.24 kg&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
The hardware involves 5V/4A DC power supply adapter, barrel jack connectors and IDC cables to power up the LED matrix and communicate with the board. Below is the pin interfacing diagram.&lt;br /&gt;
[[File:Slide2.png|700x900px|thumb|center|LED Matrix Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Fruit Fury - Game mode''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 2 tasks involved to ensure functioning of the game.&lt;br /&gt;
&lt;br /&gt;
a) Task 1: &lt;br /&gt;
*Display the game's title screen. On pressing the onboard switch (SW1), game begins.&lt;br /&gt;
*Also used to display game over screen / win screen.&lt;br /&gt;
b) Task 2:&lt;br /&gt;
*Enter into game mode to play the game.&lt;br /&gt;
*Read accelerometer values (board orientation) and render game frame.&lt;br /&gt;
*Detect the player's board movement, compare it with fruit's location.&lt;br /&gt;
*Display score, lives and smash effects.&lt;br /&gt;
*Press another switch (SW0) to stop game and return to title screen or to restart the game once it is over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Game rules:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Game comprises of 3 levels (level 2 on reaching score 15 and level 3 on reaching score 30) and 5 lives in total.&lt;br /&gt;
&lt;br /&gt;
b) Primary objective is to tilt the board to the direction (North West, North East, South West or South East) in which the fruit appears in order to smash it.&lt;br /&gt;
&lt;br /&gt;
c) Score increases by 1 point for smashing each fruit.&lt;br /&gt;
&lt;br /&gt;
d) Bombs start appearing after completion of level 1, which costs a life when hit.&lt;br /&gt;
&lt;br /&gt;
e) Level 3 is faster so make sure you tune your reflexes up.&lt;br /&gt;
&lt;br /&gt;
f) Reach score 50 to win the game.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Bonus:''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Streaks are rewarding. Smash 10 fruits straight up to win an extra life.&lt;br /&gt;
&lt;br /&gt;
b) Look out for star fruits. Hit them to gain +2 points.&lt;br /&gt;
&lt;br /&gt;
Choose your song to take all the inspiration you can and start smashing!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''2. Music mode'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Press the button to enjoy music-only mode. Graceful audio spectrum bands are displayed that dance to the tune of the chosen song.&lt;br /&gt;
&lt;br /&gt;
b) A display is prompted to the user whenever music is paused or changed to next or previous song.&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
'''LED Driver'''&lt;br /&gt;
&lt;br /&gt;
1. Initialize the LED matrix by configuring necessary pin directions.&lt;br /&gt;
&lt;br /&gt;
2. Disable Output Enable (OE) GPIO before feeding matrix data.&lt;br /&gt;
&lt;br /&gt;
3. Select the required row by setting bits on A, B, C, D GPIO pins.&lt;br /&gt;
&lt;br /&gt;
4. Loop through the pixels (columns) in the selected row and set the pixel color on R, G, B GPIO pins.&lt;br /&gt;
&lt;br /&gt;
5. Set zero on R, G, B GPIO pins to mask that particular pixel.&lt;br /&gt;
&lt;br /&gt;
6. Set and Reset the clock for pushing the R, G, B bits for each column.&lt;br /&gt;
&lt;br /&gt;
7. Issue latch to mark the row's completion and reset latch before going to next row.&lt;br /&gt;
&lt;br /&gt;
8. Follow the steps 2 to 7 for other rows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    for (uint8_t row = 0; row &amp;lt; (MAX_ROW / 2); row++) {&lt;br /&gt;
      disableOE();&lt;br /&gt;
      set_row(row);&lt;br /&gt;
      for (uint8_t col = 0; col &amp;lt; MAX_COL; col++) {&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
        set_color_bottom(game_matrix[row + (MAX_ROW / 2)][col]);&lt;br /&gt;
        set_color_top(game_matrix[row][col]);&lt;br /&gt;
        LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; CLK);&lt;br /&gt;
      }&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN |= (1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      LPC_GPIO0-&amp;gt;PIN &amp;amp;= ~(1 &amp;lt;&amp;lt; LAT);&lt;br /&gt;
      enableOE();&lt;br /&gt;
      vTaskDelay(1);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Fruit Fury - Game mode'''&lt;br /&gt;
&lt;br /&gt;
1. Generate the fruit's initial coordinate using random function (used srand() with time value as seed to get random pattern sets).&lt;br /&gt;
&lt;br /&gt;
2. Construct the LED matrix array by drawing the fruit and borders.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Then read the player's orientation and match with fruit's direction.&lt;br /&gt;
&lt;br /&gt;
5. Modify game parameters (score, lives and level) based on player's results.&lt;br /&gt;
&lt;br /&gt;
6. Stop game if all lives are over and display game over screen by switching to game init task (Task 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    /* Push button to exit game */&lt;br /&gt;
    if (LPC_GPIO0-&amp;gt;PIN &amp;amp; (1 &amp;lt;&amp;lt; SW0))&lt;br /&gt;
      is_start_game = false;&lt;br /&gt;
&lt;br /&gt;
    if (is_start_game == true) {&lt;br /&gt;
      /* Generate fruit's initial coordinate position */&lt;br /&gt;
      get_fruit_begin_coord(&amp;amp;row_pt, &amp;amp;col_pt, &amp;amp;quadrant);&lt;br /&gt;
      /* Generate final frame by considering fruit object at that position */&lt;br /&gt;
      construct_game_matrix(row_pt, col_pt);&lt;br /&gt;
      /* Draw final frame matrix of the game */&lt;br /&gt;
      draw_final_game_frame();&lt;br /&gt;
      /* Get the board direction from the user and increment score count */&lt;br /&gt;
      compute_game_params(row_pt, col_pt, quadrant);&lt;br /&gt;
    } else&lt;br /&gt;
      vTaskResume(display_game_init_screen_t);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Spectrum display - Music mode'''&lt;br /&gt;
&lt;br /&gt;
1. Read the audio frequency values from the graphic equalizer task and store it as an array.&lt;br /&gt;
&lt;br /&gt;
2. Based on value of each frequency band, assign a height of the band (in pixels) to be drawn on the LED matrix.&lt;br /&gt;
&lt;br /&gt;
3. Set a unique color for each band.&lt;br /&gt;
&lt;br /&gt;
3. Push the entire matrix data to LED driver to display the constructed matrix frame.&lt;br /&gt;
&lt;br /&gt;
4. Repeat steps 1 to 3 at required intervals to display repeating bands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for (row = MAX_ROW - 1; row &amp;gt;= 1; row--) {&lt;br /&gt;
    for (col = 7; col &amp;lt;= 62; col++) {&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[0])) &amp;amp;&amp;amp; col &amp;gt;= 7 &amp;amp;&amp;amp; col &amp;lt;= 13 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 0) {&lt;br /&gt;
        band_matrix[row][col] = RED;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[1])) &amp;amp;&amp;amp; col &amp;gt;= 14 &amp;amp;&amp;amp; col &amp;lt;= 20 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 1) {&lt;br /&gt;
        band_matrix[row][col] = GREEN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[2])) &amp;amp;&amp;amp; col &amp;gt;= 21 &amp;amp;&amp;amp; col &amp;lt;= 27 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 2) {&lt;br /&gt;
        band_matrix[row][col] = YELLOW;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[3])) &amp;amp;&amp;amp; col &amp;gt;= 28 &amp;amp;&amp;amp; col &amp;lt;= 34 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 3) {&lt;br /&gt;
        band_matrix[row][col] = BLUE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[4])) &amp;amp;&amp;amp; col &amp;gt;= 35 &amp;amp;&amp;amp; col &amp;lt;= 41 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 4) {&lt;br /&gt;
        band_matrix[row][col] = PURPLE;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[5])) &amp;amp;&amp;amp; col &amp;gt;= 42 &amp;amp;&amp;amp; col &amp;lt;= 48 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 5) {&lt;br /&gt;
        band_matrix[row][col] = CYAN;&lt;br /&gt;
      }&lt;br /&gt;
      if ((row &amp;gt;= (MAX_ROW - band_height[6])) &amp;amp;&amp;amp; col &amp;gt;= 49 &amp;amp;&amp;amp; col &amp;lt;= 55 &amp;amp;&amp;amp;&lt;br /&gt;
          band_num &amp;lt;= 6) {&lt;br /&gt;
        band_matrix[row][col] = WHITE;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''MP3 Decoder'''==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
[[File:Slide1.png|800x900px|thumb|center|MP3 Decoder Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mp3_fLow.png|600x500px|thumb|center|MP3 Decoder Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
=='''Sensors Interface'''==&lt;br /&gt;
&lt;br /&gt;
We have worked on two sensors for accessing our entertainment box i.e. Gesture Sensor and Accelerometer. The SJ-Two board has both sensors on board sensor which is interfaced on the I2C bus. Accelerometers are electromechanical devices that sense either static or dynamic forces of acceleration. Static forces include gravity, while dynamic forces can include vibrations and movement. The measurements are on 3-axis and these values can be calibrated to find the desired values.&lt;br /&gt;
&lt;br /&gt;
In our project, an accelerometer is for controlling Controls in the MP3 Mode like PLAY,PAUSE,PLAY Next Song and Back to Previous Song.However in Game Mode we are playing our fruit fury game using Orientation sensor for Smashing fruits coming in Directions South East, South West ,North East and North West and We were using Gesture on SJ-Two Board for gesture recognitions Left, Right, UP and Down to change the configuration in MP3 Mode but after implementation we have realised that giving gesture is more complicated then getting signals from orientation.  &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor.png|800x900px|thumb|center|APDS9960 &amp;amp; MMA8452Q on board Sensors]]&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sensor_FLow.png|600x500px|thumb|center|MMA8452Q Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
The MMA8452Q has an orientation detection algorithm with the ability to detect all six orientations but we are using only 4 orientations i.e. Portrait Up, Portrait Down,Landscape Left and Landscape Right .The transition from portrait to landscape is fixed with a 45° threshold angle and a ±14° hysteresis angle. This allows the for a smooth transition from portrait to landscape at approximately 30° and then from landscape to portrait at approximately 60°.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:accel_orient.png|800x900px|thumb|center|Portrait Orientation]]&lt;br /&gt;
&lt;br /&gt;
We have used the following register settings to configure the sensors and getting all 4 directions and Orientation.&lt;br /&gt;
&lt;br /&gt;
[[File:APDS_Register.png|800x900px|thumb|center|Registers of APDS9960]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After reading the registers we are just performing the actions as per the Orientation detected.&lt;br /&gt;
&lt;br /&gt;
[[File:Accel_register.png|800x900px|thumb|center|Registers of MMA8452Q]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 void perform_action_on_orientation(void *p) &lt;br /&gt;
 {&lt;br /&gt;
  orientation_e value;&lt;br /&gt;
  while (1) &lt;br /&gt;
  {&lt;br /&gt;
    value = GetOrientation();&lt;br /&gt;
    switch (value)&lt;br /&gt;
    {&lt;br /&gt;
    case Portrait_UP: // Prev Song&lt;br /&gt;
      printf(&amp;quot;Direction Left\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__prev_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Portrait_DOWN: // Next Song&lt;br /&gt;
      printf(&amp;quot;Direction Right\n&amp;quot;);&lt;br /&gt;
      xSemaphoreGive(sem__next_song);&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_LEFT: // Resume/Play/&lt;br /&gt;
      printf(&amp;quot;Direction Up\n&amp;quot;);&lt;br /&gt;
      vTaskSuspend(handle__play_song);&lt;br /&gt;
      vTaskSuspend(handle__freq_bands);&lt;br /&gt;
      song_status = PLAY;&lt;br /&gt;
      break;&lt;br /&gt;
    case Landscape_RIGHT: // Pause/Stop/Volume Decrease&lt;br /&gt;
      printf(&amp;quot;Direction Down\n&amp;quot;);&lt;br /&gt;
      vTaskResume(handle__play_song);&lt;br /&gt;
      vTaskResume(handle__freq_bands);&lt;br /&gt;
      song_status = PAUSE;&lt;br /&gt;
      break;&lt;br /&gt;
    default:&lt;br /&gt;
      break;&lt;br /&gt;
    }&lt;br /&gt;
    vTaskDelay(50);&lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
=='''OLED Screen'''==&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The open source package [https://github.com/olikraus/u8g2 u8g2] has been used.&lt;br /&gt;
There are already ready made functions for various OLED Drivers. The indepth setup guide can be found [https://github.com/olikraus/u8g2/wiki/u8g2setupc here]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
The u8g2 library is a very robust library which means that this code can be extended for any microcontroller as long as the interface is written properly.&lt;br /&gt;
&lt;br /&gt;
We needed to write 2 main functions, outlined below, i.e byte_cb and gpio_and_delay_cb using the function prototype `uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)`.&lt;br /&gt;
&lt;br /&gt;
Since the SJ2 Board is connected to the OLED Screen on the SPI1 Bus we also need to write the SPI1 driver, mainly a method to that sends data over SPI to the Slave device i.e the OLED Screen&lt;br /&gt;
&lt;br /&gt;
=== Initializing the u8g2 for LPC4078 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Created a file `u8g2_wrapper.h&lt;br /&gt;
&lt;br /&gt;
static gpio_s dc;&lt;br /&gt;
static u8g2_t u8g2;&lt;br /&gt;
&lt;br /&gt;
void u8g2_wrapper__init(gpio_s *dc_pin) {&lt;br /&gt;
  u8g2_Setup_ssd1306_128x64_vcomh0_1(&amp;amp;u8g2, U8G2_R0, u8x8_byte_4wire_hw_spi, u8x8_lpc_gpio_and_delay);&lt;br /&gt;
  u8g2_InitDisplay(&amp;amp;u8g2);&lt;br /&gt;
  u8g2_SetPowerSave(&amp;amp;u8g2, 0);&lt;br /&gt;
&lt;br /&gt;
  dc.pin_number = dc_pin-&amp;gt;pin_number;&lt;br /&gt;
  dc.port_number = dc_pin-&amp;gt;port_number;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
u8g2_t *u8g2_wrapper__get_instance() { return &amp;amp;u8g2; }&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_lpc_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_GPIO_AND_DELAY_INIT:&lt;br /&gt;
    delay__ms(1);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_DELAY_MILLI:&lt;br /&gt;
    delay__ms(arg_int);&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_DC:&lt;br /&gt;
    // DONE, Write to the GPIO_DC Pin&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_GPIO_RESET:&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint8_t u8x8_byte_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {&lt;br /&gt;
  uint8_t *data;&lt;br /&gt;
  switch (msg) {&lt;br /&gt;
  case U8X8_MSG_BYTE_SEND:&lt;br /&gt;
    data = (uint8_t *)arg_ptr;&lt;br /&gt;
    while (arg_int &amp;gt; 0) {&lt;br /&gt;
      ussp1__exchange_byte((uint8_t)*data);&lt;br /&gt;
      data++;&lt;br /&gt;
      arg_int--;&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_INIT:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_SET_DC:&lt;br /&gt;
    if (arg_int == 0) {&lt;br /&gt;
      gpio__reset(dc);&lt;br /&gt;
    } else {&lt;br /&gt;
      gpio__set(dc);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_START_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  case U8X8_MSG_BYTE_END_TRANSFER:&lt;br /&gt;
    break;&lt;br /&gt;
  default:&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Android App'''==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Modes.jpeg|230px|thumb|List Of Feature in the APP]]&lt;br /&gt;
|[[File:GAME.jpeg|230px|thumb|Game Mode]]&lt;br /&gt;
|[[File:Mp3_song.jpeg|230px|thumb|MP3 Mode]]&lt;br /&gt;
|[[File:SongList.jpeg|230px|thumb|List Of Songs in SD Card]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
The Android app has been built using the cross platform framework [https://flutter.dev/ Flutter]&lt;br /&gt;
&lt;br /&gt;
The app is composed of 3 parts, '''Game Mode''', '''MP3 Mode''' and '''MP3 Song List'''.&lt;br /&gt;
On the main screen we first connect to the bluetooth before establishing connection with any of the modes.&lt;br /&gt;
The working of each mode is explained in each subsection below.&lt;br /&gt;
&lt;br /&gt;
A few variables to note in advance&lt;br /&gt;
ACK = 0x00, sent when successful&lt;br /&gt;
NACK = 0xFF, sent incase there is any error&lt;br /&gt;
&lt;br /&gt;
=== Game Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the Game Mode screen we first check if the Bluetooth Connection is established.&lt;br /&gt;
We send in a one byte data 0xa1 over bluetooth to the SJ2 Board and get back the response &amp;quot;a1$ack/nack$##&amp;quot;&lt;br /&gt;
&lt;br /&gt;
We then enter the game mode which displays a joystick that can be oriented to a direction wherever the fruit appears on the LED matrix. The corresponding orientation value is then transmitted.&lt;br /&gt;
&lt;br /&gt;
If the fruit had appeared in the First Quadrant (North-East), then 0x71 is sent from BLE app to sjtwo board. Likewise for Second Quadrant (North-West): 0x72, Third Quadrant (South-West): 0x73, Fourth Quadrant (South-East): 0x74.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Mode ===&lt;br /&gt;
&lt;br /&gt;
To enter the MP3 Mode screen we first check if the Bluetooth Connection is established similar to the Game Mode. We send in one byte of data 0xa2 over bluetooth to the SJ2 Board and get back the response &amp;quot;a2$ack/nack$volumeInfo$currentSong$isPlaying/isPaused$##&amp;quot; where isPlaying is 1 and isPaused is 0.&lt;br /&gt;
&lt;br /&gt;
These values are loaded into the MP3 Mode Screen as initial values for the current song playing.&lt;br /&gt;
&lt;br /&gt;
We can then see a screen where we can control the various aspects of playing songs i.e Playing and Pausing the song, Go to next song and and Go to the previous song. We can also control the volume remotely.&lt;br /&gt;
&lt;br /&gt;
Controlling each part of this interface is the same as sending a single byte of data over bluetooth to the SJ2 Board.&lt;br /&gt;
&lt;br /&gt;
'''Playing and Pausing Song'''&lt;br /&gt;
&lt;br /&gt;
We just toggle the state of the Song. We issue this command by sending 0xc1 which is the Toggle State command.&lt;br /&gt;
&lt;br /&gt;
'''Next Song and Previous Song'''&lt;br /&gt;
&lt;br /&gt;
Command for the previous song is 0xc0&lt;br /&gt;
Command for the next song is 0xc2&lt;br /&gt;
&lt;br /&gt;
'''Control Volume remotely'''&lt;br /&gt;
&lt;br /&gt;
For volume we divide the percentage 100 percent in 16 parts. We can send the value between 0xb0 to 0xbf in increments of one ste-p.&lt;br /&gt;
This is parsed on the SJ2 Board and converted to an equivalent volume signal.&lt;br /&gt;
&lt;br /&gt;
=== MP3 Song List ===&lt;br /&gt;
&lt;br /&gt;
To get the list of MP3 Songs which are present in the SD card, we first check if the Bluetooth Connection is established similar to the Game Mode and MP3 Song mode. We send in one byte of data 0xa3 over bluetooth to the SJ2 Board and get back the response &amp;quot;a3$ack/nack$data$data$...$##&amp;quot;. APIs that were designed to read song information and data by Audio Decoder, will be used for achieving this functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Bluetooth Interface'''==&lt;br /&gt;
The SJ-two is connected to the Bluetooth module through the Serial interface (UART3) and we have configured it at 38400 baud rate with 8-bit data and 1 stop bit using the Communication Mode. It is used to send and receive the Game and Music data from our entertainment device to an android application. &lt;br /&gt;
&lt;br /&gt;
=== Hardware Design === &lt;br /&gt;
&lt;br /&gt;
[[File:Slide3.png|700x900px|thumb|center|Bluetooth Interface Pin Diagram]]&lt;br /&gt;
&lt;br /&gt;
===HC-05 Bluetooth module===&lt;br /&gt;
HC-05 Bluetooth Module is used to set up wireless communication between the entertainment device and the Android phone. The right section of the Bluetooth Board has connection pins for power and signals as well as a 5V to 3.3V Regulator, LED, and level shifting. &lt;br /&gt;
&lt;br /&gt;
'''HC-05 PinOut''' &lt;br /&gt;
 * EN: N/A&lt;br /&gt;
 * VCC: 5V Power &lt;br /&gt;
 * GND: Ground &lt;br /&gt;
 * TXD: Serial Transmit pin connected to RXD3 of SJ board&lt;br /&gt;
 * RXD: Serial Receive  pin connected to TXD3 of SJ board &lt;br /&gt;
 * STATE: States if connected or not&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:Bluetooth_Sw_diagram.png|600x500px|thumb|center|Bluetooth Software Design]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
An accelerometer is used in the MP3 Mode to implement functionalities such as play, pause, switch to next and previous songs and volume control. In the game mode the “Fruit fury” game is played by smashing fruits appearing in the directions South East, South West, North East and North West. UART3 is used as communication protocol.The Bluetooth commands that we are using to interact with Mobile app and Device are as follows:&lt;br /&gt;
&lt;br /&gt;
  GAMING = 0xA1,&lt;br /&gt;
  NORTH_EAST = 0x71,&lt;br /&gt;
  NORTH_WEST = 0x72,&lt;br /&gt;
  SOUTH_WEST = 0x73,&lt;br /&gt;
  SOUTH_EAST = 0x74,&lt;br /&gt;
  MUSIC = 0xA2,&lt;br /&gt;
  SONG_LIST = 0xA3,&lt;br /&gt;
  NEXT_SONG = 0xC2,&lt;br /&gt;
  TOGGLE_SONG = 0xC1,&lt;br /&gt;
  PREV_SONG = 0xC0,&lt;br /&gt;
  ACK = 0x00,&lt;br /&gt;
  NACK = 0xFF,&lt;br /&gt;
  VOL_INC = 0xB1,&lt;br /&gt;
  VOL_DEC = 0xB0&lt;br /&gt;
&lt;br /&gt;
=='''Technical Challenges'''==&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) Getting control of the matrix was challenging as it needs to follow specific sequence of pin enabling/disabling at appropriate timing.&lt;br /&gt;
&lt;br /&gt;
b) Setting right delays to avoid flickers and get smooth transitioning between frames by using delays or for loops.&lt;br /&gt;
&lt;br /&gt;
c) Fixing high CPU utilization by changing delay__us to vTaskDelay.&lt;br /&gt;
&lt;br /&gt;
d) Designing elements of the game (title screen and fruit objects) which required careful plotting of pixel data.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''Audio Decoder'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a) The CPU utilization for sending a song task was very high (80% +). &lt;br /&gt;
* In order to reduce the utilization, we gave the vTaskDelay(1) while waiting for the DREQ to be high. The high DREQ indicates that the decoder is ready to receive next 32 bytes of data. So meanwhile, when the DREQ pin is low, we made task to sleep for vTaskDelay(1). After doing this, we significantly reduced the CPU utilization to 15%. We tried with vTaskDelay(2) to get CPU utilization of 10%.&lt;br /&gt;
* We further tried to make the CPU utilization below 10%. This was really a tough challenge, and figured out that the actual SPI clock is 1Mhz which is too slow as SPI is meant to operate at much higher speed. We changed the clock rate of SPI to 12MHz but the song speed was too slow.  We checked the datasheet of the Mp3 decoder and set the internal clock multiplier to 4.5x. This make the shield operate at high clock rates at 12.XX Mhz. So keeping this in mind we made the SPI speed to 12MHz which is safe. We successfully achieved CPU utilization of 5-6% which is very much in the acceptable range.&lt;br /&gt;
&lt;br /&gt;
=='''Suggestions for Future Students'''==&lt;br /&gt;
&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt; '''RGB LED Matrix'''  &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To begin with, focus on writing simple driver to get control of 1 pixel at a targeted location and then use appropriate loops to light up entire row / column.&lt;br /&gt;
&lt;br /&gt;
* Make sure all pixels are able to light up with all possible colors to eliminate hardware defects.&lt;br /&gt;
&lt;br /&gt;
* Try with minimum / no delays, print tick counts and then come up with meaningful delay numbers.&lt;br /&gt;
&lt;br /&gt;
* Optimize the code (minimum delays, avoiding repetitive function calls etc.) to bring down the CPU usage level.&lt;br /&gt;
&lt;br /&gt;
* Use the link in the references to draw desired elements and generate the matrix.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
It was a really great working experience for all of us. We were really thrilled from the beginning that we will be working on something that is quite relevant in the industries. We worked as a team of four which helped us all to know the importance of team-work and co-ordination. We learned many great stuff like&lt;br /&gt;
&lt;br /&gt;
* State Design using FreeRTOS&lt;br /&gt;
* FreeRTOS APIS when task handles are NULL vs when initialized&lt;br /&gt;
* Used of extern and global variables as opposed to encapsulation i.e static inside private 'c' files.&lt;br /&gt;
* Learning optimization through the integration of our peer's individual modules&lt;br /&gt;
* Improving CPU utilization of the main LED and MP3 tasks.&lt;br /&gt;
* Workload sharing and cooperation amongst peers.&lt;br /&gt;
* Sharing ideas and debugging a common problem together i.e team building.&lt;br /&gt;
&lt;br /&gt;
There were a lot of problems while doing this project but it was a steep learning curve. In the end we were able to achieve our objective with really good results.&lt;br /&gt;
&lt;br /&gt;
=='''Project Video'''==&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=='''Project Source Code'''==&lt;br /&gt;
* Git Project Link (Individual Modules): &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/Infinity_Mirror/infinity_mirror-cmpe-244]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
* Git Project Link: &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://gitlab.com/ganeshram2493/infi_mirror]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Presentation File'''==&lt;br /&gt;
* &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;U&amp;gt;[https://drive.google.com/file/d/1Q_Xvs-a2feQcr-FbPEKbwmlhi35hqNxX/view?usp=sharing Presentation Link]&amp;lt;/U&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
We would like to thank professor Preet for giving us the opportunity to incorporate the course curriculum into practical model and supporting us whenever needed. Availability of slack channel and weekly reviews ensured us to clarify bottlenecks in the project, keep things organized and track progress of each tasks. We would also extend our gratitude towards ISA members who have taken their time in clearing our queries throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
====== Flutter Android GUI ======&lt;br /&gt;
*  [https://material.io/resources/icons/?style=baseline Material Design Icons]&lt;br /&gt;
*  [https://flutter.dev/ Building a Dynamic UI with Flutter]&lt;br /&gt;
*  [https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw Flutter Youtube Channel]&lt;br /&gt;
&lt;br /&gt;
====== RGB LED Matrix Interfacing and Designing ======&lt;br /&gt;
*  [https://www.sparkfun.com/products/14718 Datasheet and Hookup guide]&lt;br /&gt;
*  [https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf?timestamp=1543806512/ Wiring and pin information]&lt;br /&gt;
*  [https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html Hex code generator to build LED matrix models]&lt;br /&gt;
&lt;br /&gt;
====== MP3 Decoder and Frequency Analyzer ======&lt;br /&gt;
*  [https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf Seven Band Graphic Equalizer MSGEQ7 Data Sheet]&lt;br /&gt;
*  [https://www.kr4.us/SparkFun-MP3-Player-Shield.html?gclid=EAIaIQobChMIov3f7PWc2wIVDtVkCh0-rgStEAYYASABEgIEgPD_BwE SparkFun-MP3-Player-Shield Datasheet]&lt;br /&gt;
&lt;br /&gt;
====== Gesture &amp;amp; Orientation Sensors  ======&lt;br /&gt;
*  [https://cdn.sparkfun.com/assets/learn_tutorials/3/2/1/Avago-APDS-9960-datasheet.pdf Gesture Sensor Data Sheet]&lt;br /&gt;
*  [https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide/all Accelerometer Sensor Data]&lt;br /&gt;
&lt;br /&gt;
====== General/Miscellaneous ======&lt;br /&gt;
*  [http://socialledge.com/sjsu/index.php/FreeRTOS_Tutorial FreeRTOS Tutorial]&lt;br /&gt;
*  [https://sjsu-dev2.readthedocs.io/en/latest/?badge=latest SJTwo-c Documentation]&lt;/div&gt;</summary>
		<author><name>Proj user22</name></author>	</entry>

	</feed>