Hey guys i'm wondering if there would be a way to connect a tilt sensor to scratch. I want this because think of all the possiblilities! realistic steering, labyrnith games, and other stuff! So if anyone could help me I'd really appreciate it
PS I heard that on scratch sensor boards there is resistance sensors. Do you think theres a electronic component like a "tilt resistor"?
Offline
Making tilt sensor is very interesting. Simply you can buy an acceleration sensor and connect it to PicoBoard or Arduino but it's easy enough and a little expensive.
For example, imagine a small sound box that loudness is changing by angle. You can handle it by a mic and "loudness" block.
I know an university student who made a tilt sensor with two paper cups and confetti.
Cheers,
Kazuhiro Abe
Offline
You could fill one container with salt water. Then insert a lead rod (or other cumulative resistor) into it, so as when the apparatus is tilted, the water moves away, and less of the rod is in the water.
Now, connect the dry end of the rod to one end of a resistance sensor, and the other to an electrode in the water. This way, the more it tilts, the more resistance.
Offline
Hi andrewcevery,
Well, there are some "poor man's" accelerometers you can buy for only a few bucks.
This one <http://www.ladyada.net/learn/sensors/tilt.html> you can buy for U$ 2.00 at Adafruit store <www.adafruit.com>. I think you can use it as a "tilt switch".
I do not have one to test. but I've attached a Force Sensitive Resistor (FSR) <http://www.ladyada.net/learn/sensors/fsr.html> to the PicoBoard's resistance sensor and it worked like a charm
I hope this can help.
Offline
I don't understand how you can't have three sprites; a box, and two little squares being sensors. For sensor 1: forever: if touching color __, set {variable name1} to 1, else, set {variable name1} to 0. For sensor 2: forever: if touching color __, set {variable name 2} to 1, else, set {variable name 2} to 0. For box sprite: Forever: if {variable name 1} = 1 and {variable name2} = 0, rotate [right/left] 1, if {variable name1} = 0 and {variable name2} = 1, rotate [right/left] 1. Oh, and the sensors go at the bottom portion of the box sprite. The box can move left and right, and the sensors are still at the same spot. Now WHY WONT IT WORK!?!?!? Replies will be appreciated.
Offline
EpicGuy22 wrote:
I don't understand how you can't have three sprites; a box, and two little squares being sensors. For sensor 1: forever: if touching color __, set {variable name1} to 1, else, set {variable name1} to 0. For sensor 2: forever: if touching color __, set {variable name 2} to 1, else, set {variable name 2} to 0. For box sprite: Forever: if {variable name 1} = 1 and {variable name2} = 0, rotate [right/left] 1, if {variable name1} = 0 and {variable name2} = 1, rotate [right/left] 1. Oh, and the sensors go at the bottom portion of the box sprite. The box can move left and right, and the sensors are still at the same spot. Now WHY WONT IT WORK!?!?!? Replies will be appreciated.
ummm.... you realize we're not talking about THAT kind of sensor, right? we're talking about the thingamagigs you plug into your computer.
Offline