» Electronics » Arduino »Transferring data from the accelerometer to the Scratch through Arduino

Accelerometer data transfer via Arduino to Scratch



Offered to Readers homemade author Instructables under the nickname akellyirl allows you to manage virtual objects in the educational programming environment Scratch using a real accelerometer.

First of all, the master switches to this site and downloads there a special version of the Scratch interpreter, supplemented by a function of interaction with Arduino (Scratch4Arduino, abbreviated S4A), as well as a sketch for this board that provides this interaction.

Acquires a board with a three-axis accelerometer ADXL335 or similar installed on it. This accelerometer is designed for power supply with a voltage of 3.3 V, from 5 V it fails. If your Arduino has a 3.3V stabilizer, nothing extra is needed. If this stabilizer produces 5 V, you will need another, external, for example, LM1117-3.3. You can also purchase a board with an accelerometer on which a stabilizer is already installed.

The accelerometer generates three analog signals corresponding to the X, Y, Z axes. The master sends these signals to the Arduino in the following order: X - A0, Y - A1, Z - A2. It is clear that an Arduino-compatible board with analog inputs is needed, but today they are almost all of them.




Flashes Arduino with the sketch indicated above, launches S4A, and if everything worked, sees that there is a reaction to the accelerometer tilt along all three axes:



Now, the interaction of both the accelerometer with Arduino and Arduino with the interpreter has been established, you can compile programs of any complexity in the Scratch language. But first, the wizard recommends trying the following two:




Taking a rather miniature Arduino clone and connecting an accelerometer to it without a breadboard like breadboard - soldering, and putting all this into the case, you can get such a controller for games in the Scratch language, on which there will be no buttons. You can control game objects by simply tilting it.
0
0
0

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose

We advise you to read:

Hand it for the smartphone ...