Jump to content
Sign in to follow this  
dakishman

Ok, Need help on a project

Recommended Posts

dakishman

I am just starting to build my program and I am already running into issues Early on.

What I am trying to make is a program that will open up a simple window asking for a 8 bit binary word (EX. 01101011) and saves it under a variable

It then takes the word and stores it into an array and separates it into each bit. (I am new to arrays any help with them is appreciated)

(EX. $Array = [1] 0 [2] 1 [3] 1 [4] 0 [5] 1 [6] 0 [7] 1 [8] 1)

I then would like to call each of these individually.

Extra help:

I need either a command or a simple program that does not require installation to create a "Beep". I need to be able to adjust the frequency of the "Beep" according to a variable.

The following is all I have so far:

#requireadmin;This Command is for Windows Vista to give admin rights to the program.
$Array = 0                     
$Array = InputBox("Digital to Analog Converter", "Input your Data Bit here:", 200, 300)
_ArraySort (ByRef $Array, $i_decending
Edited by dakishman

I love AutoIT! It doesn't talk back, it doesn't complain that ur on the computer, it loves to be ran over and over and over... but IT STILL DOESN'T DO THE DISHES... Gatta keep da pimp hand strong...

Share this post


Link to post
Share on other sites
Danny35d

dakishman welcome to autoit. This should get you start it.

#include <Array.au3>
#requireadmin  ;This Command is for Windows Vista to give admin rights to the program.

$Array = InputBox("Digital to Analog Converter", "Input your Data Bit here:")
If @error <> 0 Then Exit
$Array = StringSplit(StringStripWS($Array, 3), '')
_ArraySort ($Array, 1, 1)
_ArrayDisplay($Array, 'Data Bit')

For the Extra help:

you can use For...Next loop and Beep function().


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites
dakishman

dakishman welcome to autoit. This should get you start it.

#include <Array.au3>
#requireadmin  ;This Command is for Windows Vista to give admin rights to the program.

$Array = InputBox("Digital to Analog Converter", "Input your Data Bit here:")
If @error <> 0 Then Exit
$Array = StringSplit(StringStripWS($Array, 3), '')
_ArraySort ($Array, 1, 1)
_ArrayDisplay($Array, 'Data Bit')
oÝ÷ ØZ+¶ÆÚÚéiÊj{¬zêå

I love AutoIT! It doesn't talk back, it doesn't complain that ur on the computer, it loves to be ran over and over and over... but IT STILL DOESN'T DO THE DISHES... Gatta keep da pimp hand strong...

Share this post


Link to post
Share on other sites
Siddhartha

Cuddos

i 7h0u9h7 i7 w45 5p3113d...0h n3v3r mind...woah i did that without thinking

Share this post


Link to post
Share on other sites
dakishman

I need help on the Beep command. I dont hear anything when I use it. I even did this to make sure that the sound was turned on and up.

; plays back a beep noise, at the frequency 500 for 1 second
SoundSetWaveVolume ( 100 )
Beep(500, 100000)

Sound is not muted or turned down. I made sure by playing music in windows media player.

Any help on this would be greatly appreciated.

(The full code I am using is posted above.)


I love AutoIT! It doesn't talk back, it doesn't complain that ur on the computer, it loves to be ran over and over and over... but IT STILL DOESN'T DO THE DISHES... Gatta keep da pimp hand strong...

Share this post


Link to post
Share on other sites
Danny35d

I believe that plays through the pc speaker, rather than through the sound card. You may not have your pc speaker hooked up, or enabled in bios.

I improve you code by using for next loop.

#include <Array.au3>

Local $Frequancy = 0

Do                                            
    $Array = InputBox("Digital to Analog Converter", "Input your Data Bit here:")
    If @error <> 0 Then Exit
    $Array = StringSplit(StringStripWS($Array, 3), '')
    If $Array[0] <> 8 Then
        MsgBox(48, "Invalid", "Please enter ONLY a 8 bit word", 5)
    Else
        $Pass = 1
    EndIf
Until $Pass = 1

_ArrayReverse($Array, 1)
For $x = 1 To $Array[0]
    $Frequancy += $Array[$x] * Execute('2^($x - 1)')
Next
$Frequancy = $Frequancy * 100

MsgBox(48, "Frequancy", "The frequency for the OUTPUT bit: "& $Frequancy)
Beep ($Frequancy, 1000)

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.