Hi Folks first time here and this will be an easy question. but my Gr 8 daughter nor I can rewrite one line of code.
We are trying to change the code in the tutorial video
from :
analog read pin P1
TO:
set voltage to 3.3 × analog read pin P1 / 1023
We are unfamiliar with how to manipulate the code blocks such that we get:
set voltage to 3.3 × analog read pin (0 / 1023)
the division formula in brackets or in purple in coding area does not give us what we need. The P1 is underneath of the purple division formula. If that is understandible to anyone(?)
We have servo working but struggle to get the mini solar panel voltage to be read on either the microbit led's or on the laptop. I have voltage tested output solar with a volt meter at the micro:bit , ranging from 1 to 3.4v using room lighting and/or flashlight.
Thx in advance Rob for Sofia my gr8'R
(Administrator note / project url: https://www.sciencebuddies.org/science- ... ar-tracker )
3.3V mini solar tracking system coding problem
Moderators: AmyCowen, kgudger, bfinio, MadelineB, Moderators
-
RobSieloff
- Posts: 1
- Joined: Tue Nov 26, 2024 4:29 pm
- Occupation: Parent
-
amyCC
- Site Admin
- Posts: 405
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: 3.3V mini solar tracking system coding problem
Hi - You are having trouble getting the blocks in place to create this, correct?
To do this, first add the "set voltage" variable (which it sounds like you have).
Add a math equation for the multiplication to the right side:
Then add another math equation for the division into the right side of the previous equation:
Drop the analog pin block (from the pins menu) into the left side of the division equation: If you are having trouble with that specific block, you might try putting the block on your screen separately. Then drag it onto the equation, watching for the left-side 0 to highlight in yellow so that you can drop it into that. Then update the other block in the equation (to change it to 1023).
We would love to hear how the project goes for your student!
Let us know if you have questions.
Amy
Science Buddies
Add a math equation for the multiplication to the right side:
Then add another math equation for the division into the right side of the previous equation:
Drop the analog pin block (from the pins menu) into the left side of the division equation: If you are having trouble with that specific block, you might try putting the block on your screen separately. Then drag it onto the equation, watching for the left-side 0 to highlight in yellow so that you can drop it into that. Then update the other block in the equation (to change it to 1023).
We would love to hear how the project goes for your student!
Let us know if you have questions.
Amy
Science Buddies

