AutoHotkey Community

It is currently May 26th, 2012, 11:30 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: November 11th, 2008, 9:55 pm 
Offline

Joined: April 29th, 2008, 12:51 am
Posts: 13
Please read the comments in the code. They explain everything.
Code:
/*
Another nerdy experiment by me.
So the story behind this script is this:
  After closing my locker at school one day, I realized how plain and boring it was. So I thought I might spice it up a bit. Being the dork that I am, I thought it would be

awesome to have a magnetic array of LEDs, 7 LEDs tall by 42 LEDs wide, that would be programmable via a palm pilot or similar device. I chose 7x42 because every letter of the

alphabet can be made 7 LEDs tall and 5 LEDs wide (I think). So 7x42 would give me just enough room to spell short words, and possibly some small pictures. But what if I wanted

longer words? BINGO! I could have it scroll horizontally. I immediately started coming up with lots of ideas, such as the ability to scroll up, down, left, and right, blinking,

and all sorts of stuff. So when I got home that day I started writing this script as a sort of demo. Now I'm asking for your input, ideas, and/or contributions. Eventually, this

software will become hardware.
P.S. - I'm a sophomore in high school and I'm quite the noob. Please don't point and laugh.
Thanks =]
*/

IfNotExist, %A_ScriptDir%\Saved
{
 FileCreateDir, %A_ScriptDir%\Saved
}

Y11 = 10
Y2 = -1
Number = -1
Loop, 7{
x11 = 12
X2 = -1
Y11 += 11
Y2 += 1
Loop, 42{
  X11 += 11
  X2 += 1
  Number += 1
/*
  Gui, Add, Button, X%X11% Y0 W12 H16 vClrColumn%Number% gClrColumn, C ;These were supposed to clear the entire column below them, but they don't work
  Gui, Add, Button, X0 Y%Y11% W16 H12 vClrRow%Number% gClrRow, C       ;These were supposed to clear the entire row next to them, but they don't work
*/
  Gui, Add, Checkbox, X%X11% Y%Y11% W12 H12 -Wrap Check3 vChkBx%X2%%Y2% gFill
}
}
;Gui, Add, Button, X0 vLEDScroll gLEDScroll, LED Scroll ;Doesn't work
Gui, Add, Button, X0 vInvert gInvert, Invert
Gui, Add, Button, X0 vClrAll gClrAll, Clear All
/*
Gui, Add, Button, X0 vSave gSaveAs, Save As                  ;This sort of works. Not really.
Gui, Add, Button, X0 vLoadFile gLoadFile, Load File          ;I was going to have a GUI pop up with a list of files in the "Saved" folder.
Gui, Add, Button, X0 vLoadManualy gLoadManualy, Load Manualy ;I was goint to have a GUI pop up with relatively large text field where you could paste text.
*/
Gui, Show, Center AutoSize, LED Scroller
 
Fill:
MouseGetPos,,,,ChkBxNum
GuiControlGet, ChkBxStatus,, %ChkBxNum%
If ChkBxStatus=-1
GuiControl,, %ChkBxNum%, 0
Else If ChkBxStatus=1
GuiControl,, %ChkBxNum%, -1
Gui, Show, AutoSize, LED Scroller
Return
 
ClrAll:
Y3 = -1
Loop, 7{
 X3 = -1
 Y3 += 1
 Loop, 42{
  X3 += 1
  Number += 1
  GuiControl,, ChkBx%X3%%Y3%, 0
 }
}
Return

/*
ClrColumn:
ColumnControl = A_GuiControl
StringReplace, X4, ColumnControl, ClrColumn
Y4 = -1
Loop, 7{
 Y4 ++
 GuiControl,, ChkBx%X4%%Y4%
}
Return
*/

/*
ClrRow:
RowControl = A_GuiControl
StringReplace, Y5, RowControl, ClrRow
X5 = -1
Loop, 7{
 X5 ++
 GuiControl,, ChkBx%X5%%Y5%
}
Return
*/

Invert:
Y3 = -1
Loop, 7{
 X3 = -1
 Y3 += 1
 Loop, 42{
  X3 += 1
  GuiControlGet, ChkBxStatus,, ChkBx%X3%%Y3%
  If ChkBxStatus=-1
   GuiControl,, ChkBx%X3%%Y3%, 0
  Else If ChkBxStatus=0
   GuiControl,, ChkBx%X3%%Y3%, -1
}
}
Gui, Show, AutoSize, LED Scroller
Return

/*
SaveAs:
Gui, 2:Add, Text,, Save As:
Gui, 2:Add, Edit, vSaveAs
Gui, 2:Add, Button, vSave gSave, Save
Gui, 2:Show, Center AutoSize, Save As
Return
*/

/*
Save:
Gui, Submit
Y6 = -1
Loop, 7{
 X6 = -1
 Y6 += 1
 Loop, 42{
  X6 += 1
  Number += 1
  If ChkBx%X6%%Y6% = -1
   FileAppend, %X6%%Y6%`n, %A_ScriptDir%\Saved\%SaveAs%.txt
  Else If ChkBx%X6%%Y6% = 0
   Continue
 }
}
Return
*/

/*
LoadFile:
Return
*/

/*
LoadManualy:
Return
*/

/*
LEDScroll:                                      ;Obviously this could use some cleaning up. I probably could've used functions, but hey, I'm a noob.
Number = 0
Y7 = -1
Loop, 7{
 X7 = -1
 Y7 += 1
 Loop, 42{
  X7 += 1
  If ChkBx%X7%%Y7% = -1
  {
   Number ++
   Bit%Number% = %X7%%Y7%
   Bit%Number%X = %X7%
   Bit%Number%Y = %Y7%
  }
  Else If ChkBx%X7%%Y7% = 0
   Continue
 }
}
BitCount = %Number%
BitNum = 0
Loop{
 Loop, %BitCount%{
  BitNum ++
  Bit%BitNum%X --
  If Bit%BitNum%X < 0
   Bit%BitNum%X = 42
 }
 Y8 = -1
 Loop, 7{
  X8 = -1
  Y8 += 1
  Loop, 42{
   X8 += 1
   GuiControl,, ChkBx%X8%%Y8%, 0
  }
 }
 Number = 0
 Loop, %BitCount%{
  Number ++
  ChkBxBitX = Bit%Number%X
  ChkBxBitY = Bit%Number%Y
  ChkBx%ChkBxBitX%%ChkBxBitY% = -1
 }
 Gui, Show, AutoSize, LED Scroller
}
Return
*/

GuiClose:ExitApp


Last edited by psych0pat on November 11th, 2008, 11:50 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 10:52 pm 
Offline

Joined: May 2nd, 2006, 11:16 pm
Posts: 800
Location: Greeley, CO
At work and don't really have the time to scour over your code, but I like the idea and the grid that you've completed is pretty neat.

How do you intend to port this after you build the hardware?
How do you plan to create the hardware?... From a marquee kit?... From scratch?
How will you control this?... BASIC Stamp, maybe?

Anyway... Be sure to post schematics and details after you complete this project!

Some URLs that might interest you:
Link
Link
Link
Link

_________________
Image
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."


Last edited by SoggyDog on November 11th, 2008, 11:49 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 11:42 pm 
Offline

Joined: April 29th, 2008, 12:51 am
Posts: 13
Honestly I have no idea how I'm going to port it.
And I planned on getting the materials from RadioShack (LEDs, breadboard, etc.) and making it from scratch.
And AHK is really the only "programming language" I know well.
I've fooled around with BASIC, but nothing more than that.
Honestly I hardly have a clue what I'm talking about.
I'm the type of person that learns as they go along.
Sometimes I just get these random ideas that are mostly pointless, but I'll follow through with them, without any knowledge on the topic.
So we'll see what happens.

P.S.- One feature I forgot to mention in the code was something that I would really love to have: Manual Animation. It would allow you to switch between multiple frames and edit them, allowing endless possibilities. For example, you could manually create an animation of a smiley face winking. You get the idea. (I hope)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 11:56 pm 
Offline

Joined: May 2nd, 2006, 11:16 pm
Posts: 800
Location: Greeley, CO
psych0pat wrote:
You get the idea. (I hope)

Yup..
I get it...
Frame-by-frame.

_________________
Image
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2008, 11:07 pm 
Offline

Joined: April 29th, 2008, 12:51 am
Posts: 13
EXACTLY!
Jeez. Why did I go all in to detail?
:P


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2008, 4:37 am 
regarding the ahk-part, you might find this helpfull:
http://www.autohotkey.com/forum/viewtopic.php?p=107252#107252


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2008, 2:44 am 
Offline

Joined: April 29th, 2008, 12:51 am
Posts: 13
Thanks SO much Z_Gecko. That's exactly what I needed. Seclinix even mentioned a feature I had in mind: the ability to enter text into an edit control and have the grid of check boxes render it. And if the text was too long, it'll scroll it.
Quote:
what if you could make a gui and make it like an MD5 and ask the user to enter text and it will turn it into a string and then turn it into text on the matrix thingy....

also you could use the lock screen and make it a wallpaper when the screen locks to display a message


I'll get to work ASAP. Right after I finish my homework :roll:


Last edited by psych0pat on November 14th, 2008, 2:54 am, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2008, 2:44 am 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Very interesting project. Keep working on it!! :)

DataLife


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group