Skip to content

Instantly share code, notes, and snippets.

View haashimrehan's full-sized avatar

Haashim Rehan haashimrehan

  • iTalkRobot
  • Milton, Ontario
View GitHub Profile
@haashimrehan
haashimrehan / StepperTest.ino
Created October 27, 2023 21:50
Stepper motor testing (with buttons)
#include "FastAccelStepper.h"
 
// As in StepperDemo for Motor 1 on AVR
#define dirPinStepper    2
#define enablePinStepper 6
#define stepPinStepper   9  // OC1A in case of AVR
 
FastAccelStepperEngine engine = FastAccelStepperEngine();
FastAccelStepper *stepper = NULL;
 
public class VolumeCalc {
public static void main(String []args){
// Declare Variables
double radius = 10;
double volume = 0;
//While the radius is less than 200
@haashimrehan
haashimrehan / ThreeSphereCalc.java
Created September 7, 2018 18:25
Calculate the volume of three spheres
public class ThreeSphereCalc{
public static void main(String []args){
final double PI = 3.14159265358979;
double radius = 10;
double volume = 4.0/3.0*PI*radius*radius*radius;
System.out.println("The sphere with a radius of "+radius+" has a volume of " + volume);
radius = 20;
volume = 4.0/3.0*PI*radius*radius*radius;
System.out.println("The sphere with a radius of "+radius+" has a volume of " + volume);