Poll
Question: I need LED turn work
Yes, - 1 (33.3%)
Upload Program - 1 (33.3%)
All of the Above - 1 (33.3%)
Total Voters: 2

Pages: 1 [2] 3   Go Down
Author Topic: Please HELP me NOW!!!!!!  (Read 2494 times)
0 Members and 1 Guest are viewing this topic.
Värmland, Sweden
Offline Offline
Sr. Member
****
Karma: 9
Posts: 262
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure what your problem is, I am trying to help you, and instead you are bringing that stupid crap up.

And the fun thing is, we all understand each other over here, and we even understand everyone over where you are too, so where is the actual problem? Us over here, or people over there?

But all in all, I prefer not to waste my time like this, so this will probably be the last time trying to help you. Good luck

Cool down a bit.
This whole thread was a joke from the beginning. That's why it was posted in Bar Sport.
A lot of the stuff in the Bar Sport group is just waste of time. If you don't have time to waste, stop reading it.
Logged

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

bld, did you read the first post?
I did, but also thought there must be a reason to post something. Making a post just for making one, is... Well, don't even know what to call it, besides it might be because the author just needed some attention.

Cool down a bit.
This whole thread was a joke from the beginning. That's why it was posted in Bar Sport.
A lot of the stuff in the Bar Sport group is just waste of time. If you don't have time to waste, stop reading it.
No, because many of the things in bar sport actually got something in them, maybe not some productive, but they still got something in.

When looking back over this, I see nothing. I even asked what it was about, and instead of a reply, I get a video making fun of someone, not even sure who, because no one over here talks like that.

So maybe it was all just for fun, wonder when the part making it fun come.
Logged

captain-slow.dk | non contagious!

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 32
Posts: 1214
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

bld:  Undskyld.
Logged

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 32
Posts: 1214
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to set it as an output though or it's not properly turned on.
Well, there you go. All this chit chat and yet, another interesting fact creeps up. I thought from this (and some other stuff done previously) that all pins start as INPUT (re)boot, except #13 because of its LED wiring basically only is usable as OUTPUT.

Hmmm. digitalWrite to an input pin is supposed to put a 20K resistor to Vcc and if the other end of the LED is at GND then yes, I get 0.2mA through the LED. It glows a lot brighter than that. <Gets out the DVM> And measures 4.8V ... So I tried different INPUT, OUTPUT LOW and HIGH, and yes: With INPUT the 20K pullup just barley makes the onboard LED glow. It has to be OUTPUT. And that is what pin 13 is, by default. I think I am right here. Oh well, we could look at the init code at github, but I cant be bothered now.

Constructive critism is always welcome. If the worst happens I learn someting.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27081
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All IO pins are powered up as inputs at powerup, sketches must set it to Output. Including D13.
It is certainly usable as an input.  Anything driving it High just needs to supply maybe 3mA to overcome the current limit resistor and LED (assuming it has Vforward of ~2V for an 0805 LED).
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26285
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Including D13.
?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27081
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

D13 is not limited to an output only as thought my Msquare:
"I thought from this (and some other stuff done previously) that all pins start as INPUT (re)boot, except #13 because of its LED wiring basically only is usable as OUTPUT."
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26285
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
sketches must set it to Output. Including D13.
The bootloader leaves pin 13 as an output.
There is no need for a sketch to set it as an output.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27081
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, didn't know that.
I never assumed it was set to anything and made sure my sketches set it as an input or output as needed.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Full Member
***
Karma: 2
Posts: 156
It was all digital
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Tested as the shortest possible program to turn on LED13 (measured using normal Arduino source)
Code:

void setup(){}void loop(){digitalWrite(13,HIGH);}


I dosen't any smaller than this - I guess you say that to all the girls  smiley-razz


Same compiler size (694 bytes) but less writeing:
Code:
void setup(){}void loop(){digitalWrite(13,1);}

Smaller compiler size (440 bytes) and less writeing:
Code:
void setup(){}void loop(){PORTB=B100000;}
 
Smaller compiler size (440 bytes) and even lesser writeing:
Code:
void setup(){}void loop(){PORTB=1<<5;}

 -Fletcher
« Last Edit: May 01, 2011, 04:49:27 pm by Fletcher Chr » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
sketches must set it to Output. Including D13.
The bootloader leaves pin 13 as an output.
There is no need for a sketch to set it as an output.
Well I can't say I didn't learn anything today then smiley
Logged

Georgia, US
Offline Offline
Sr. Member
****
Karma: 5
Posts: 371
Arduino makes my head hurt :(
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
sketches must set it to Output. Including D13.
The bootloader leaves pin 13 as an output.
There is no need for a sketch to set it as an output.
Well I can't say I didn't learn anything today then smiley


Hmm... and I thought it was automatically input like all the others... /me tests


Just tested, and that is wrong, Pin 13 is no different than any other pin, it's set to Input unless programmed otherwise
« Last Edit: May 01, 2011, 09:14:03 pm by Valalvax » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18771
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The bootloader leaves pin 13 as an output.
There is no need for a sketch to set it as an output.

I'm glad I tested that. Because it doesn't (if you use setup and loop, which I assume you meant?).

But this *is* the Bar Sport section, right?

However *this* works:

Code:
int main(){PORTB=1<<5;}

Now that's short! (180 bytes).
Logged


0
Offline Offline
Full Member
***
Karma: 2
Posts: 156
It was all digital
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
However *this* works:

Code:

int main(){PORTB=1<<5;}

Now that's short! (180 bytes).

Does that count as Arduino code?

After a bit a thinking in the car to work this morning I can cook it down to:
Code:
void setup(){}void loop(){PORTB=32;}

That is 2 chars less than the privious code - still 440 bytes.
Unless there are some special woodoo bitwise operator that flip the intire PORTB from 0 to 1 I think we have hit the buttom. 36 chars of Arduino code to turn on led 13.

-Fletcher
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18771
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Does that count as Arduino code?

It compiles under the normal Arduino IDE. It uploads to the Uno. It lights the LED. Are there other requirements?

Quote
Code:
void setup(){}void loop(){PORTB=32;}

This only lights it faintly because you haven't set the port to be output. However you gave me a clue ...

Code:
int main(){DDRB=32;PORTB=32;}

(182 bytes).

Strangely, my earlier sketch stopped lighting the LED fully, so it would appear a bit undefined whether pin 13 stays in output mode or not. Hence adding in DDRB=32.

Oh, and if you try this:

Code:
int main(){DDRB=PORTB=32;}

Rather than taking less memory it takes more (184 bytes). Somehow that defeated some compiler optimization.
Logged


Pages: 1 [2] 3   Go Up
Jump to: