Login:
Pass:
Forgotten Pass?
Forums
Forum Home
Search
Today's Posts
Members List
Calendar




Search
Google
Search TBCS
Search the Web


Follow Us On




Go Back   TBCS Community Forums > Mod Walk > MicroCentral


Welcome to the TBCS Community Forums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Reply
 
Thread Tools
  #21  
Old 08-10-2012, 10:59 PM
crenn's Avatar
crenn crenn is offline
Posts: 4,043
Fox Furry
 
crenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supremecrenn Modder Supreme
My System
Default Re: arducyclo

Sorry I haven't replied in some time, just been busy with my first week of uni and getting back into my job. Also been getting new stuff of late so that's part of the reason, but anyway, let's take a look.

I did go through your code the other day and with minimal work it would work fine with the Arduino, no issues. There are a few things that need working such as doing the maths for the speedo (we'll go into that) and also how your blinking is done.
In the pseudo code, there isn't actually anything getting the time from the microcontroller to be able to process the blinking. There is a function defined in the Arduino library called millis() which can help with this, it returns a unsigned long value which represents the number of milli seconds since the microcontroller was turned on. In your main code, look at doing something like this:
Code:
if ((millis() - blinkertime) > 500) {
  byte buttonstate = (digitalRead(buttonLeft) | (digitalRead(buttonRight) << 1) );
  blinker(buttonstate);
  blinkertime = millis();
}
This way in your blinker function, you don't have to worry about timing, only what LEDs are flashing, and this could be done just by toggling the pin states. (Or remember what you wrote to the pins last)

I don't use google talk much but I can, you can PM me your talk address to me whenever you feel like you want to.
__________________
<IMAGED REMOVED: OMEGA MADE FOXY DISAPPEAR>
JDBNSN MADE FOXY CRY
Antec Sonata II |
Pioneer DVR-212
Good news! You can follow my website or follow me on twitter!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Translate This Page

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
thebestcasescenario.com