EZ-Builder Release 2012.12.16.00

Download and install the latest EZ-Builder robot programming software to experience these updates.

Download EZ-Builder
This release includes a few new EZ-Script commands for file operations and GUI enhancements.

Changes:
- EZ-Script Edit Window now saves the size of the window you resize to

- Examples Menu has easier to read buttons

- New EZ-Script File Operations (FileReadClose, FileReadReset, FileExists, FileReadEnd, FileReadChar, FileReadLine, FileReadAll)

- New EZ-Script function for splitting string into fields - Split()

- Speech Recognition Control includes Audio Level Graph


The File Operations Example Project will demonstrate how to perform EZ-Script File Operations for Reading, Writing and Parsing. Choose Examples and select the File Operations project.

File Operation Example Project
User-inserted image



New Speech Recognition Control with Audio Level
User-inserted image



File Write Example

Code:


# This EZ-Script will log the positions of
# servos D3 and D4 in the specified file.
# The loop will repeat 10 times for 10 seconds

$filename = "c:\temp\myfile.txt"

FileDelete($filename)

$cnt = 0
$max = 10

:START

print("Writing line $cnt or $max")

FileWrite($filename, "Time: $time")
FileWrite($filename, ", Left Servo: GetServo(d3)")
FileWriteLine($filename, ", Right Servo: GetServo(d4)")

$cnt = $cnt + 1

if ($cnt = $max)
halt()

sleep(1000)

goto(START)



File Read Example

Code:


$filename = "c:\temp\myfile.txt"

if (FileExists($filename) = false)
print("File does not exist")
Halt()
Endif

FileReadReset($filename)

:START

$txt = FileReadLine($filename)

print("Read: $txt")

if (FileReadEnd($filename) = true)
print("End Of File")
halt()
endif

goto(START)



File Read with Splitting Fields By Coma Seperator Using SPLIT() Function

Code:


# Reads a file and seperates each field by a comma.
# The Split() function will return a
# specified field index

$filename = "c:\temp\myfile.txt"

if (FileExists($filename) = false)
print("File does not exist")
Halt()
Endif

FileReadReset($filename)

$cnt = 1

:START

$txt = FileReadLine($filename)

$DateField = Split($txt, ",", 0)
$LeftArmField = Split($txt, ",", 1)
$RightArmField = Split($txt, ",", 2)

print("Row: $cnt")
print("Date: $DateField")
print("Left Arm: $LeftArmField")
print("Right Arm: $RightArmField")
print()

if (FileReadEnd($filename) = true)
print("End Of File")
halt()
endif

$cnt = $cnt + 1
goto(START)



SPLIT() Example #1

Code:


$x="one, two, three"

$first=split($x, ",", 0)
$second=split($x, ",", 1)

print("First Field is: $first")
print("Second Field is: $second")



SPLIT() Example #2

Code:


$x="one - two - three"

$first=split($x, "-", 0)
$second=split($x, "-", 1)

print("First Field is: $first")
print("Second Field is: $second")
#7  
Thanks again DJ! Again wish I was not stuck in a hotel room and could be building and testing! Soon.
#8  
DJ looking at you file read command looks very good,i did have a question about adding my own jokes using text file ,but this will work,i know you can look up jokes on the internet with a script ,but not the same thing,good to put different jokes on a text file and random read them
GREAT JOB DJ
#9  
@Robotmaker...DJ has an example of script for random speech using varibles called nouns, verbs and adjectives and randomly mixes themup EXAMPLE 23!...sometimes they ARE very funny...you could do the same for you joke idea.. :)
#10  
yes i saw that before,i had plans to use it
i see this board EZB needs a lot and a lot of programming in scripts
United Kingdom
#11  
It doesn't NEED it, but it makes it better. Luckily writing the scripts is easy (or EZ):)
Synthiam
#12  
RobotMaker, you won't be asking as many questions once you start using it:)

To give you an idea, there are many thousand users of the EZB, and we only have a few ppl who ask questions on the forum:). The rest just use it, or learn from watching some of these questions. Everything you have ever asked is possible and easy within EZ-Builder, but you'll need to actually use it first lol:)

That is the reason our forum rules strictly limit posts to helpful EZ-Robot building information. We receive thousands of unique visitors viewing the forum daily, and they are mostly existing users. The forum is a knowledge of community support to help others and define new feature suggestions. There are many thousand existing forums online that will provide you're daily dose of drama - just not here:) we're building robots and changing the world!