ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

#1  

If dj doesn't have this func in ARC it be easy as all to add it: You could do it already in c# sdk using datetime();

#3  

I tried it in the c#scripting place. It said that it did not recognize datetime() or Say. I tried it many ways including

Say("datetime()")

and Say(datetime())

and datetime().

Errors in all. I don't really know how to make much of the SDK. When I try to go to MSVisualStudio, My head starts to hurt.

sorry.

PRO
Synthiam
#4  

Here is sample file: Example-Script-CSpeakTimeDate.EZB

This will work in the C# Script


using System;
using System.IO;
using System.Windows.Forms;
using EZ_B;

namespace VName {

  public class VClass {

    public void Main(EZB ezb0, EZB ezb1, EZB ezb2, EZB ezb3, EZB ezb4) {

      ezb0.SpeechSynth.Say("The Date and Time is " + DateTime.Now.ToString());
    }
  }
}

#5  

God Bless You,D.J.!!

I am doing fine with the robot. I have taking care of MOST of the stuff. It all works fine when a person tells it what it needs to hear. I sure thank you for that script.

When I finish the robot, I will take a picture and post it to add to the many EZ success stories. I have completely taken my turtle-bots apart and are concentrating on finishing this one.

The reason that I have not finished is that I am waiting for the PS2 adapter to come from HongKong. At first, I was afraid to shop in China. But, after several good deals, I only have to do with the wait. I understand that they mostly sale rejects, but on some products like the little ps2 connector, no problem.

God Bless!

PRO
Synthiam
#6  

@MovieMaker great to hear success stories. that's awesome:)

As for the ps2 connector, i'm certain it'll be fine. I feel the reject concerns are with assembled items like servos and complete circuits that you'd need to worry about.

Do you have an electronic store near your house to get supplies? Even radio shack might carry a ps2 connector. I personally get old mice or keyboards and cut the ends off. Value Village/Salvation Army are good for that:D

#7  

I checked at Radio-Shack which is the ONLY place near me and they did not have them. I don't know if you looked on the cloud, But I saved TimeDate to the cloud. I also modified it to give me the Day of the week. It does a pretty good job, but when it said FRIDAY it said FRIDAY-EEE.

Thanks For Your Help.

Mel

#9  

Greetings robot community, I would like to run DJ's example of time and date using C#Script ...or...the .EZB file. I thought at one time there was a control script for C# ......and the Example-Script-CSpeakTimeDate.EZB is not found in the Cloud....I have searched the Forum hi and low for the answer..to no avail. I know the answer will be very simple! ...its the questions that are hard:)

United Kingdom
#10  

It may be due to lack of sleep and being borderline exhausted but what are you trying to do? Have the robot speak the time and date?

If so it's pretty simple using EZ-Script, there are variables for the hour, minute, second, dayName, month, day, year etc.

A simple script of;

SayWait($dayName)

Will have the robot speak the day name, i.e. "Sunday"

Or use the hour and minute to say the time, with some ifs to get it to say it correctly (so rather than saying 11 10 pm it would say 10 past 11 pm), just use the $hour and $minute variables.

# Work out correct formatting for speaking the time

# 24 hour to 12 hour conversion
IF($hour >12)
  $12hour = $hour - 12
  $ampm = "PM"
Else
  $12hour = $hour
  $ampm = "AM"
EndIf

IF($minute < 30)
  SayWait("It is "+$minute+" past "+$12hour+" "+$ampm)
Else
  SayWait("It is "+$12hour+" "+$minute+" "+$ampm)
EndIF

The code would need some more work (probably at midnight and on the hour when there are 0s involved), it was just knocked up in about 3 minutes as an example but hopefully it gives you an idea.

#11  

It does give me an idea( a good one) and go to bed!.....thank you so much..go to bed....:) When you back awake .....where does the script "find" the time to be able to output it? or how does the script "acquire" the time from the pc? ...Thanks so much Rich, as always:) EDIT: Found the answer to... where does the script " find " the time ..................!Variable Constants/Reserved Words! within EZ Script functions:)