Värmland, Sweden
Offline
Full Member
Karma: 6
Posts: 221
|
 |
« Reply #15 on: April 30, 2011, 03:12:27 pm » |
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
Edison Member
Karma: 7
Posts: 1176
RAWR! ^,..,^
|
 |
« Reply #16 on: April 30, 2011, 03:22:01 pm » |
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
|
|
|
|
|
Copenhagen, Denmark
Offline
God Member
Karma: 17
Posts: 827
Have you testrun your PDE file today?
|
 |
« Reply #17 on: April 30, 2011, 03:25:37 pm » |
bld: Undskyld.
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen, Denmark
Offline
God Member
Karma: 17
Posts: 827
Have you testrun your PDE file today?
|
 |
« Reply #18 on: April 30, 2011, 04:13:38 pm » |
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
Brattain Member
Karma: 240
Posts: 16455
Available for Design & Build services
|
 |
« Reply #19 on: April 30, 2011, 05:40:28 pm » |
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
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #20 on: April 30, 2011, 05:46:35 pm » |
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16455
Available for Design & Build services
|
 |
« Reply #21 on: April 30, 2011, 05:56:26 pm » |
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
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #22 on: April 30, 2011, 06:01:20 pm » |
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.
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16455
Available for Design & Build services
|
 |
« Reply #23 on: April 30, 2011, 07:27:51 pm » |
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
|
|
|
|
|
0
Offline
Full Member
Karma: 1
Posts: 150
It was all digital
|
 |
« Reply #24 on: May 01, 2011, 04:41:54 pm » |
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  Same compiler size (694 bytes) but less writeing: void setup(){}void loop(){digitalWrite(13,1);} Smaller compiler size (440 bytes) and less writeing: void setup(){}void loop(){PORTB=B100000;} Smaller compiler size (440 bytes) and even lesser writeing: 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
Faraday Member
Karma: 104
Posts: 5531
|
 |
« Reply #25 on: May 01, 2011, 04:44:37 pm » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
Georgia, US
Offline
Sr. Member
Karma: 4
Posts: 372
Arduino makes my head hurt :(
|
 |
« Reply #26 on: May 01, 2011, 09:10:03 pm » |
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  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
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #27 on: May 02, 2011, 02:32:12 am » |
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: int main(){PORTB=1<<5;} Now that's short! (180 bytes).
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 1
Posts: 150
It was all digital
|
 |
« Reply #28 on: May 02, 2011, 03:21:38 pm » |
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: 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
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #29 on: May 02, 2011, 03:57:04 pm » |
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? 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 ... 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: int main(){DDRB=PORTB=32;}
Rather than taking less memory it takes more (184 bytes). Somehow that defeated some compiler optimization.
|
|
|
|
|
Logged
|
|
|
|
|
|