-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"board": "arduino:avr:mega", | ||
"configuration": "cpu=atmega2560", | ||
"port": "/dev/cu.usbmodem14201", | ||
"port": "/dev/cu.usbmodem14401", | ||
"sketch": "Arduino/OdysseyConController/OdysseyConController.ino" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CMakeLists.txt not found in /Users/graysonwen/projects/VML/OdysseyNowHAL/Arduino/OdysseyConController Select CMakeLists.txt file... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Player spot Read/Write | ||
|
||
The digital potentiometers are enabled or disabled | ||
- when disabled, you can read from that player spot | ||
- when enabled, that player spot is in write mode | ||
|
||
there are 2 potentiometers for each player spot: one for horizontal position and one for vertical position. | ||
|
||
(Levi) | ||
|
||
[to disable the potentiometers] Disconnect the ground of the digital potentiometer and leave it floating. By disconnecting their ground and +5V sides from ground and +5V. | ||
|
||
I do this using the GPIO pins of the arduino. When the pins are set to output, they provide ground or power to GND+VCC of the digital pot and GND of the Capacitor. But when the arduino pins are set to input, they go into a high impedance state essentially disconnection GND+VCC of the digital pot and GND of the capacitor, as if their wires were sticking up in the air. So then the digital pot and capacitor are connected to the Odyssey only on one end, there is no loop for current to flow through. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
void setup() { | ||
// put your setup code here, to run once: | ||
Serial.begin(115200); | ||
Serial.println("ready."); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
if (Serial.available()) { | ||
Serial.println(Serial.available()); | ||
while(Serial.available()) { | ||
Serial.print((char)Serial.read()); | ||
} | ||
Serial.println(""); | ||
Serial.flush(); | ||
} | ||
|
||
delay(1000); | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.AI; | ||
|
||
public class CatAI : MonoBehaviour | ||
{ | ||
|
||
public GameObject target; | ||
private NavMeshAgent agent; | ||
public bool stop; | ||
|
||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
// Agent tend to rotate game object, that can be | ||
// undesirable | ||
agent = GetComponent<NavMeshAgent>(); | ||
agent.updateRotation = false; | ||
agent.updateUpAxis = false; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
if ((transform.position - target.transform.position).magnitude < 1 && !stop) | ||
{ | ||
stop = true; | ||
//target.GetComponent<Navigate>().enabled = false; | ||
//Canvas canvas = FindObjectOfType<Canvas>(); | ||
//var gameOver = canvas.transform.Find("Panel"); | ||
//gameOver.gameObject.SetActive(true); | ||
//var score = canvas.transform.Find("Score"); | ||
//score.SendMessage("Stop", true); | ||
|
||
Debug.Log("Cat has the mouse."); | ||
} | ||
agent.SetDestination(target.transform.position); | ||
//Navigate.DebugDrawPath(agent.path.corners); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class GameLogic_CatAndMouse : MonoBehaviour | ||
{ | ||
public GameObject player_mouse; | ||
public GameObject player_cat; | ||
public Collider2D wall; | ||
|
||
public float p_distance; | ||
|
||
Collider2D cod_mouse; | ||
Collider2D cod_cat; | ||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
// Player collider assignments | ||
cod_cat = player_cat.GetComponentInChildren<Collider2D>(); | ||
cod_mouse = player_mouse.GetComponentInChildren<Collider2D>(); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
this.p_distance = cod_cat.Distance(cod_mouse).distance; | ||
if (this.p_distance < 0) | ||
{ | ||
Debug.Log("Cat have the Mouse"); | ||
} | ||
|
||
if (wall.Distance(cod_cat).distance < 0) | ||
{ | ||
Debug.Log("Cat collide with the stone"); | ||
} | ||
|
||
if (wall.Distance(cod_mouse).distance < 0) | ||
{ | ||
Debug.Log("Mouse collide with the stone"); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.