This file contains 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
//ARDUINO 2 MOTOR EXAMPLE - L298N | |
// This version does not include the potentiometer | |
int SPEED = 255; // 0 - NO SPEED, 255 - FULL SPEED | |
//motor 1 | |
#define enA 9 // should be pwm pin(~) | |
#define in1 6 | |
#define in2 7 |
This file contains 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
/* | |
* Code Next Arduino Robot club | |
* HC-06 Bluetooth drive control with mobile app | |
* Downoload an Android Bluetooth HC-06 app and | |
* set commands to match f (forward), r (reverse) | |
* l (left) , r (right) | |
* TODO: modify this code to improve remote driveing performance | |
*/ | |
#include <SoftwareSerial.h> |
This file contains 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
/* Code Next Arduino Robotics club | |
* Turn on LED via BT example | |
* Pair a device via Bluetooth to HC-06 | |
* Use a Bluetooth Terminal app to send characters | |
*/ | |
#include <SoftwareSerial.h> | |
SoftwareSerial BTserial(10, 11); // RX | TX | |
// Connect the HC-06 TX to the Arduino RX on pin 10. |
This file contains 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
/* Code Next Arduino Robotics club | |
* TEST your HC-06 with this sketch; | |
* - Give the Modle 5V of power (VCC) | |
* - Try some test commands: AT -> should reply OK | |
* - Rename it AT+NAMEyournewname -> should reply with OKsetname | |
* - Connecting to RX and TX pins (0, 1) gives an upload error if wired, use 10, 11 instead. | |
*/ | |
#include <SoftwareSerial.h> |
This file contains 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
/* 2 MOTOR L298N and Potentiometer | |
* with functions (forward, reverse, turnRight, turnLeft) | |
* motor rotation will vary depending on the DC motor wiring | |
* and the orientation of the motor relative to the car/surface. | |
* | |
*/ | |
//motor 2 | |
#define enA 9 | |
#define in1 6 |
This file contains 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
//Speed control with 2 motors and a potentiometer | |
//motor 2 | |
#define enA 9 // should be pwm pin(~) | |
#define in1 6 | |
#define in2 7 | |
////motor 2 |
This file contains 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
from gpiozero import LED, DistanceSensor | |
from time import sleep | |
# DisanceSensor(echo, trigger) | |
sensor = DistanceSensor(26, 20) | |
led = LED(14) | |
blink_rate = 0 | |
def blink(d): | |
if d < 1.0: |
This file contains 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
from gpiozero import Servo, AngularServo | |
from time import sleep | |
#servo = Servo(21) | |
servo = AngularServo(21, min_angle=0, max_angle=180, min_pulse_width=0.0006, max_pulse_width=0.0024) | |
while True: | |
""" | |
num = input("Enter a number between -1 and 1") | |
num = float(num) | |
if num <= 1 and num >= -1: |
This file contains 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
The Tyger | |
William Blake | |
Tyger! Tyger! burning bright | |
In the forests of the night, | |
What immortal hand or eye | |
Could frame thy fearful symmetry? | |
In what distant deeps or skies | |
Burnt the fire of thine eyes? |
This file contains 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
//make sure to add this to your package in the shell: $npm install readline-sync | |
const READLINE = require("readline-sync"); | |
//*********************** VARIABLES **************************** | |
let inputMsg ="" //an empty string to hold our user inputs | |
let gameIsOn = true | |
let currentRoom = null | |
let isFighting = false | |
let rooms = [] |
NewerOlder