Went to Naza to have a look at some cars for the kick of it. We did it once before the end of F6 in an attempt to boost our morale to study hard, so we can get good jobs that can afford us one of these babes. LOL.
This time is just to have a look at the 458 and FF. Coz we have to.
First thing we saw was the 458 parked at the entrance.
Was porning all over the 458.
Ssad that the FF was shipped to Indonesia as it was actually on tour. Person-in-charge there say they will officially bring in the FF next year.
Similarities are drawn to the rear end of a fine female specimen.
It’s weird how I can identify the material as carbon-ceramic, despite having no knowledge about the 458 brakes in advance. Materials module did not fail me. Haha.
Part of the interior. Reflection was an issue so can’t capture much. Classy nonetheless.
Filtered away a few pics to be placed at my photography blog (they were, less journalistic). Click here to go there.
I tried to make a horizontal movement function and a vertical movement function, and call them in the loop function but it keeps failing to call them. Decided to leave the if- statements in the open like that.
This is the first project that I sortof created myself, combining what I’ve learnt so far about Arduino sketching and circuitry.
I am trying to make an on/off switch thingy. One click on the button should turn the LED on (and remain off), another click should turn it off (and remain off). However The code does not seem to stick, and random misconducts appear to happen. Sometimes the first few clicks would function as expected, then the behavior turns erratic. Other times even the first few click also does not turn the LED on (it blinks, or remains on even after a second click). I hope anyone with knowledge in the subject can help me out.
As you can see in this scenario the first few clicks function as expected, then it just doesn’t work well until after a few more clicks later.
The following is the sketch:
int ledPin = 12; int buttonPin = 2; int loopcount = 0;
My concept of making it a switch is based on counting the number of times the button has been pressed( loo[count++ ), calculating whether the n-th time is an even or odd number (loopcount%2 == 0 ), and assigning that when it is odd numbered to turn the LED on (if statement).
The circuitry is exactly the same as the interactive traffic light one, just that I pulled off all the excess LEDs and wires and resistors, leaving the button and the sole LED. This meant that the circuit is valid and closed.
UPDATE: having watched this video, I realise there's much more to think about when it comes to playing with arduino (or any electrical stuff for that matter).
The fixed code:
int switchPin = 8;
int ledPin = 13;
boolean lastButton = LOW;
boolean ledOn = false;
boolean currentButton = LOW;
void setup()
{
pinMode(switchPin, INPUT);
pinMode(ledPin, OUTPUT);
}
boolean debounce(boolean last)
{
boolean current = digitalRead(switchPin);
if (last != current)
{
delay(5);
current = digitalRead(switchPin);
}
return current;
}
void loop()
{
currentButton = debounce(lastButton);
if (lastButton == LOW && currentButton == HIGH)
{
ledOn = !ledOn;
}
lastButton = currentButton;
digitalWrite(ledPin, ledOn);
}
I do not fully understand the boolean parts of the code, so might need help there.
Glad that I finally made it thru making an on/off switch! Though not on my own efforts as initially hoped for.
There are a few tutorials that sadly, I am unable to perform due to the lack of components in my starter kit. I am trying to hunt down a thermistor and a servo motor. Before those 2 are obtained, I wanted to fully exploit the current components first. So in this post I connect a seven segment LED to the Arduino UNO board.
One of the additional exercises in the manual was to add codes so that the LED blinkings appear to bounce off each other in the middle. The original project (Project 6) was to make an LED chase effect where the LEDs blink one at a time in sequence from one end to the other, and back the opposite direction.
The picture of circuit:
The code in its entirety:
byte ledPin[] = {7, 8, 9, 10, 11, 12, 13}; int ledDelay; int Direction1 = 1; int Direction2 = -1; int currentLED = 0; int lastLED = 6; unsigned long changeTime; int x; int potPin = 2;
void changeLED(){ for (int x=0; x<7; x++){ digitalWrite(ledPin[x], LOW); digitalWrite(ledPin[6-x], LOW); } digitalWrite(ledPin[currentLED], HIGH); digitalWrite(ledPin[lastLED], HIGH); currentLED += Direction1; lastLED +=Direction2; if (currentLED == 3){Direction1 = -1;} if (currentLED == 0) {Direction1 = 1;} if (lastLED == 6){Direction2 = -1;} if (lastLED == 3){Direction2 = 1;} }
Basically what I did was I added another integer variable, lastLED and made it a 2nd output, since there will be 2 separate blinkings at one time. I duplicate whatever the code there is for currentLED for lastLED. Also added a second direction variable so that the new blinking can have an opposite direction to the first blinking. Made them start at different ends but end in the middle. I maintained the potentiometer-controlled ledDelay variable.
This is a pedestrian interactive traffic light made using Arduino UNO. This is project 4 from the manual that can be found at this link.
Photo of circuit:
The code is as follows:
int carRed = 12; int carYellow = 11; int carGreen = 10; int pedRed = 9; int pedGreen = 8; int button = 2; int crossTime = 5000; unsigned long changeTime;
In human language, the following describes what the traffic light was doing:
1. Traffic light waits for user input. The time since the circuit was turned on was continuously logged. 2. If button is pushed, and the last light change was more than 5 seconds ago (determined by subtracting the time recorded at end of last light change and time since circuit was turned on), the yellow light turns on for 2 seconds. 3. Then the red light turns on. 4. After 1 second, the green light for pedestrian turns on for 10 seconds. 5. Pedestrian green light starts blinking 10 times after that. 6. Pedestrian red light turns on. 7. After 0.5 seconds, yellow lights for cars turn on for 1 second. 8. Yellow and red lights for cars turn off, and green light turns on. 9. Traffic light listens for user input. Time since circuit was turned on was recorded at this point.
K so I’ve just gotten myself an Arduino UNO starter kit from myduino.com. The item that I bought can be found in this link. Downloaded the document from the same page and will be learning how to do shits with an Arduino board. I wish to eventually develop accessories using the Android ADK, so let’s hope I persevere till then.
Went to Lowyat Plaza to take part in the Biggest Angry Birds Playground thing.
Dude explaining the rules. Damn no time to explore Golden Eggs!!!
This shit is real. A real Guiness Book of World Records invigilator was present the whole time.
My contribution to the cause. Woohoo!!!
Pretty sure the attempt will be a success coz it's like the first time I hear anyone attempting this sort of thing. lol This badge is like a Pokemon badge after defeating the Gym Boss.
Took part in the Showdown to at least try to win a T-shirt.
Too bad my skills were crap today. DAMN. Won an RM10 Starbucks voucher though. :-D
There's a booth where there's this real angry birds slingshot game, of course using plush toys. Quite lame la coz the structure itself it like not destructible.
Kept stalking the staff members who were giving out the stickers.
Lunch time went to Jalan Alor to eat pork noodles. On the way saw a Nissan GTR R35 parked at the road side. iStim.
The journey back was hellish. Didn't know bunch of football fans would be mobilised around KL. They boarded from different stations to go to the National Stadium. Damn packed. Sardines wold have more space to breathe.