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
const int motor1A = 9; // H-bridge (pin 2, 1A) | |
const int motor2A = 8; // H-bridge (pin 7, 2A) | |
const int motor3A = 13; // H-bridge (pin 14, 3A) | |
const int motor4A = 12; // H-bridge (pin 10, 4A) | |
const int enablePin1 = 10; // H-bridge enable pin | |
const int enablePin2 = 11; // H-bridge enable pin |
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
#include "LedControl.h" | |
LedControl lc=LedControl(12,11,10,1); | |
void setup(){ | |
Serial.begin(9600); | |
lc.shutdown(0,false); | |
lc.setIntensity(0,10); | |
lc.clearDisplay(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
/* | |
Sample Code to run the Sparkfun TB6612FNG 1A Dual Motor Driver using Arduino UNO R3 | |
This code conducts a few simple manoeuvres to illustrate the functions: | |
- motorDrive(motorNumber, motorDirection, motorSpeed) | |
- motorBrake(motorNumber) | |
- motorStop(motorNumber) | |
- motorsStandby | |
// Connections: |
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
#include <Servo.h> | |
Servo myServo; | |
int pos = 0; | |
int joystick1 = 7; | |
int joystick2 = 8; | |
const byte PIN_ANALOG_X = 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
int sensorPin = 0; | |
int ledPin = 4; | |
int ledState = LOW; | |
unsigned long previousMillis = 0; | |
void setup() { |
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
/* | |
Example sketch for the Xbox Wireless Reciver library - developed by Kristian Lauszus | |
It supports up to four controllers wirelessly | |
For more information see the blog post: http://blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/ or | |
send me an e-mail: kristianl@tkjelectronics.com | |
*/ | |
#include <XBOXRECV.h> | |
// Satisfy IDE, which only needs to see the include statment in the ino. | |
#ifdef dobogusinclude |
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
#include <XBOXRECV.h> | |
// Satisfy IDE, which only needs to see the include statment in the ino. | |
#ifdef dobogusinclude | |
#include <spi4teensy3.h>u | |
#endif | |
USB Usb; | |
XBOXRECV Xbox(&Usb); | |
void setup() { |
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
#include <PWMServo.h> | |
//servos | |
int pos1 = 50; //myservo1 pin 6; | |
int pos2 = 30; //myservo2 pin 7; | |
PWMServo myservo1; | |
PWMServo myservo2; | |
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
import java.util.Scanner; | |
import java.util.Stack; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
//System.out.println("Enter the size of the stack: "); | |
int size = scan.nextInt(); |
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
public static double birthday(int n) { | |
int dups = 0; | |
double value = 0.0; | |
for (int i = 0; i < n; i++) { | |
boolean foundDup = false; | |
int[] bday = new int[n]; | |
// assign birthdays to n people |
OlderNewer