This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LED.h> | |
LED led(13); // assign digital pin 13 to an LED | |
void setup() { | |
} | |
void loop() { | |
led.toggle(); | |
if (led.state()) { | |
delay(1000); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LED.h> | |
LED led(13); // assign digital pin 13 to an LED | |
void setup() { | |
} | |
void loop() { | |
led.on(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LED.cpp - Example library to manipulate LEDs - public domain | |
#include "LED.h" | |
// the constructor | |
LED::LED(byte pin) { | |
_pin = pin; // save the pin number | |
pinMode(pin, OUTPUT); // configure pin as output | |
} | |
// the public methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LED.h - Example library for manipulating LEDs - public domain | |
#ifndef LED_h | |
#define LED_h | |
#if ARDUINO < 100 | |
#include <WProgram.h> | |
#else | |
#include <Arduino.h> | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define F_CPU 16000000UL /* 16MHz Frequency Working Arduino UNO Clock */ | |
#include <avr/io.h> | |
#include <util/delay.h> /* Include a AVR LibC functions*/ | |
#include <avr/interrupt.h> /* this is the new library needed */ | |
/* Defining the basics macros*/ | |
#define LedOn PORTB |= (1<<PORTB0) | |
#define LedOff PORTB &= ~(1<<PORTB0) | |
#define LedToggle PINB |= (1<<PINB0) | |
#define SWITCH_PRESSED !(PIND & (1<<PIND7)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define F_CPU 16000000UL /* 16MHz Frequency Working Arduino UNO Clock */ | |
#include <avr/io.h> | |
#include <util/delay.h> /* Include a AVR LibC functions*/ | |
int main(void) | |
{ | |
/* PORTB Data Register - DS pg 92 */ | |
DDRB |= (1<<DDB5); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.AI; | |
public class AgentControl : MonoBehaviour { | |
public Transform home; | |
NavMeshAgent agent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class TheSimplestCoroutine : MonoBehaviour | |
{ | |
void Start () | |
{ | |
string[] messages = { "Welcome", "to", "this", "amazing", "game!" }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine.AI; | |
public class PlayerMovement : MonoBehaviour { | |
public Animator animator; | |
public NavMeshAgent agent; |