Arduino Extension

Scratch Extension enable you to control evive and Arduino in Scratch. Arduino Extension blocks control the basic input, output and communication of evive like digital and analog input/output, serial communication, PWM output, etc.

Arduino Program
Arduino Program
Arduino Program block is a Robot block and a Hat block. Scripts that wear this lock gets converted into Arduino code (when you right click and select upload code). This block is used when one has to upload a code into evive.
read digital pin ()
read digital pin ()
Read digital pin () block is a Robot block and a Boolean block. It reads the state of the digital pin on evive (“High” or “Low”). If the state of the pin is “High”, it returns True, else False.
read analog pin ()
read analog pin ()
Read analog pin () is a Robot block and a reporter block. It returns the value of analog pins available in evive. Analog reading is of 10 bit resolution, hence the range of value is 0 to 1023.
set digital pin () output as ()
set digital pin () output as ()
Set digital pin output is a Robot block and a stack block. It sets the digital state of specified digital pin either “High” or “Low”. If the output is High, the pin will be at 5V and if the output is Low the pin will be at 0V.
set PWM pin () output as ()
set PWM pin () output as ()
Set PWM pin output is a Robot block and a stack block. This block set PWM output on evive PWM pins. The user can select the output from a range of 0 to 255.  If the PWM output is 128, then half the time output will be High and for rest, output will be Low.
play tone pin () on note () beat ()
play tone pin () on note () beat ()
Play tone block is a Robot block and a stack block. When it is executed it plays the tone of specified frequency/note for a specific duration/beat.
set servo pin () angle as ()
set servo pin () angle as ()
Set servo block is a Robot block and a stack block. When it is executed, it sets the servo angle to the specified angle. The angle can vary from 0 to 180 degree.
serial write text ()
serial write text ()
Serial write block is a Robot block and a stack block. This block sends signal from evive to computer through serial monitor. This is used mainly for debugging in Arduino mode (that is, to print the values and commands). You can give string, numbers and anything else.
Serial available bytes
Serial available bytes
Serial available bytes block is a Robot and a reporter block. It is used to get number of bytes available on serial monitors to read. Here, the communication is from computer to evive. So through this command evive monitors if there any bytes available?
serial read byte
serial read byte
Serial read byte block is a Robot and a reporter block. It is used to read the commands available at serial monitor one by one (byte by byte). In this case, communication is from computer to evive.
read ultrasonic sensor trig pin () echo pin ()
read ultrasonic sensor trig pin () echo pin ()
Read ultrasonic sensor block is a Robot block and a reporter block. It’s used for measuring the distance from an ultrasonic sensor. It returns distance in cm.
Timer
Timer
Timer block is a Robot block and a reporter block. It returns the time passed since the device is turned ON or since the timer has be reset. This block returns time in milliseconds.
reset timer
reset timer
Reset timer block is a Robot block and a stack block. The block sets the timer's value back to 0.0. Usually the timer must be reset at the beginning of a project for the Timer block to hold the right value.