8th Nov, 2018-Thursday
Alpha Test
- Keep continue doing our little props.
- Working on the mechanism, testing out the input and output is functioning correctly.
What can we improve?:
- Do more research about miniature .The props should be really look cute and real.
- Need to start working on interaction with audio.
Code for Alpha test:
const int BtnSmallMotor = 2;
const int TouchSense = 4;
const int TouchHorse = 12;
const int SmallMotorSpin = 6;
const int LargeMotorSpin = 8;
const int LightUp = 10;
int buttonState = 0;
int touchy =0;
int touchDaHorse =0;
void setup() {
// put your setup code here, to run once:
pinMode (BtnSmallMotor,INPUT);
pinMode (TouchSense,INPUT);
digitalWrite(TouchSense,HIGH);
pinMode (TouchHorse,INPUT);
digitalWrite(TouchHorse,HIGH);
pinMode (SmallMotorSpin,OUTPUT);
pinMode (LargeMotorSpin,OUTPUT);
pinMode (LightUp,OUTPUT);
//digitalWrite(SwitchPin, HIGH); VERY IMPORTANTTTT
Serial.begin (9600);
digitalWrite(LightUp,LOW);
}
void loop(){
buttonState = digitalRead(BtnSmallMotor);
if (buttonState == LOW){
digitalWrite (SmallMotorSpin,LOW);
} else
if (buttonState == HIGH){
digitalWrite (SmallMotorSpin, HIGH);
delay(1800);
}
touchy = digitalRead (TouchSense);
if(touchy == LOW){
digitalWrite(LightUp,LOW);
} else {
digitalWrite(LightUp,HIGH);
}
touchDaHorse = digitalRead (TouchHorse);
if(touchDaHorse == HIGH){
analogWrite(LargeMotorSpin,50);
}
else {
analogWrite (LargeMotorSpin,0);
}
}
// put your main code here, to run repeatedly:
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.