Oct 16 2008

ASP.NET MVC Beta Released!

Tag: ASP.NET, MVCTyrone @ 9:34 pm

Scott Gu has all the details.  I’ve been waiting for the beta release before I really started digging into this MVC framework.  I am a Web Forms guy; but I have been waiting for a “structured framework” to come instead of dropping controls on a page and writing UI code behind each page. Based on all of the reading that I have seen, I like what I see.

For a purely web forms developer, which I am not, don’t expect to get all the fancy controls like GridViews, Validation controls, Login Controls, etc, like you would get out of the box in a web forms project. With ASP.NET MVC, HTML is your friend and if you are intimidated by writing HTML, then you probably shouldn’t be a web developer in the first place. However, this is the concept of HTML Helpers that you can use to assist you in generating pretty much all of the HTML input controls just by using some script code; but it is not mandatory. 

So, this will be a breath of fresh air for me. I am working on a  project now and I will be developing it using the MVC framework. I like working with new stuff and hopefully I will be able to share my experience as I go along. Until next time…

 

Happy Coding!


Sep 18 2008

Heartache! Microsoft to cancel Seinfeld ads

Tag: MicrosoftTyrone @ 9:33 am

I never thought they were that good anyway.  At times, it was very hard to catch the joke and if you compare it to the Apple commercials, there was a big, big difference. 

http://valleywag.com/5051455/microsoft-to-announce-jerry-seinfeld-ads-cancelled-tomorrow

 

Until next time…

 

Happy coding!


Sep 14 2008

FYI…

Tag: PersonalTyrone @ 9:47 pm

I’m still alive. Yes, I haven’t posted anything in a while; but that’s just because I have had a lot going on. I’m working on a few projects and I took a vacation recently, so I guess that explains it. I’ve been learning some new stuff for a change and once I get something together I’ll give you a quick update on it. Until next time…

 

Happy coding!


Jul 10 2008

Traffic Light Simulation using the Basic Stamp 2

Tag: Basic Stamp, Electronics, MicrocontrollersTyrone @ 1:11 pm

So, it took me long enough right? I know in my last post I left off by saying that I would try to have at least 1 project that is build with the Basic Stamp 2 and include it on my next post. I came up with a Traffic Light simulation which I thought was a very practical application and I am very confident that everyone reading this blog is familiar on how a traffic signal works.

Initially, I thought about posting screenshots of the Homework Board circuit; but I felt that these types of projects would be best to demonstrate with a video.

 

 

Here is the circuit schematic that I have constructed using ExpressPCB which is absolutely FREE!

 

SimpleTrafficLight

 

As you can see, the connections on the left represents the I/O pins of the Basic Stamp. Then there is a series connection of a 220 ohm resistor and the LED for the traffic signals and cathode or the minus (-) or the flat end of the LED is connected to GRND.  I think it’s worth mentioning that when an I/O pin goes HIGH each circuit would have a source voltage of +5 volts and when the I/O pin goes LOW then the source voltage goes down to 0 volts. In this circuit configuration, the LED is configured as Active High which means that when I send a HIGH signal to an I/O pin, the LED is turned on and a LOW turns the LED off.  According to the documentation for the Basic Stamp, each I/O pin can only source up to 20 mA of current if only 1 pin is connected to a circuit. However, if we are using a group of pins, we can only source up to 40 mA. So, we have to be careful not to supply our circuit with too much current or we can risk damaging our Basic Stamp that is the reason I included a 220 ohm resister to limit the current flowing through the circuit. Also, take into the account that the Basic Stamp Homework Board has built-in 220 ohm resistors as a safety feature but I didn’t want to take any changes so I added my own. But, if you don’t decide to use the resistor, then you LED would light up more brightly than in the video. Good. That is out of the way.

Ok. Now here is the code that I used to get all of this done. Remember, the Basic Stamp is programmed using PBASIC so the code should be very easy to read.

 

‘ =========================================================================
‘   {$STAMP BS2}
‘   {$PBASIC 2.5}
‘ =========================================================================

‘ —–[ Program Description ]———————————————
‘ SIMPLE TRAFFIC LIGHT CIRCUIT SIMULATION
‘ Traffic Light Transition:
‘                       RED
‘                       GREEN
‘                       YELLOW

‘ —–[ I/O Definitions ]————————————————-

RedLED          PIN     15
YellowLED       PIN     10
GreenLED        PIN     5

RedDuration     CON     20000           ‘– 20 sec
GreenDuration   CON     20000           ‘– 20 sec
YellowDuration  CON     10000           ‘– 10 sec

‘ —–[ Constants ]——————————————————-

‘ —–[ Variables ]——————————————————-

‘ —–[ EEPROM Data ]—————————————————–

‘ —–[ Initialization ]————————————————–

Reset:

‘ —–[ Program Code ]—————————————————-

Main:

  DO

‘– turn only Red light on for 20sec
    HIGH  RedLED
    LOW   YellowLED
    LOW   GreenLED

    PAUSE RedDuration

‘– turn only Green light on for 20sec
    LOW   RedLED
    HIGH  GreenLED

    PAUSE GreenDuration

‘– turn only Yellow light on for 10sec
    LOW   GreenLED
    HIGH  YellowLED

    PAUSE YellowDuration

  LOOP

  END
‘ —–[ Subroutines ]—————————————————–

 

Hopefully, the code is strait forward.  As you can see I set up some variables to hold the numbers of the I/O pins I am using. Then I have some variables to represent the duration that each LED will be turned on. Then if you jump down to the main body of the code, you would see that this code would run in a continuous loop and will never end until the battery is disconnected or runs out.

Then, you can see that I first turn on the Red LED by sending a HIGH to that I/O pin while setting all the other pins to LOW. Then I pause for the duration specified in the variable and then everything else is pretty cut and dry. I just turn on and off the other lights in the sequence that I want. Pretty simple huh?

Hopefully, this was helpful to you and you can see how easy Microcontrollers are to work with these days. I welcome any questions or comments you may have. Until next time…

 

Happy Coding!


Jun 28 2008

What I have been up to lately…

Tag: Basic Stamp, Electronics, MicrocontrollersTyrone @ 5:53 pm

board_homework_bread

 

What is this? It’s a Basic Stamp Microcontroller board that is manufactured by Parallax, Inc.  Some of you may not know; but I originally got started with Programming as a Electronics Engineering student in college. Electronics was my first love.  However, when I graduated the market demands were for programmers and not electronic engineers so I decided to go where the demands were. This was over  6 years ago and I pretty much forgot everything, so I figured I would re-teach myself the basics of electronics and learn how to program microcontrollers in the process. I did have some experience programming the Motorola 68000 which were found in the early Apple computers. But, I wanted something that was a little easier to set up and have a better programming environment. The 68000 chip had to be programmed using Assembly Language and a EEPROM programmer. But of course, I didn’t want to go back to using Assembly Language after writing C# for all these years. To program the Basic Stamp all you need is a PC and a serial port. I do have to learn a new language called PBASIC, which looks as feel a lot like the original BASIC language. To start of with, I would advise anyone to purchase the Basic Stamp Activity Kit as it includes everything (except the 9V battery) you need to get started with.  The documentation is very easy to read and they have a great forum you can use to post any questions that you may have.

In my next post, I would like to have at least 1 project completed and I will take some pictures of the circuit board layout and post the code for you to see how easy it is. Obviously, the more complex circuit you have, the more code you have to write. So, I will start off with something simple.  Hopefully, this post has inspired you to start a new adventure in any area of your life. This is one adventure that I hope I can keep up with until something else comes along :-).  Until next time…

 

Happy Coding!


Next Page »