Jump to content

Ok, Need help on a project


Recommended Posts

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...

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...