In need of some assistance for BATMAN pov graphics

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Thu Oct 17, 2013 12:15 am

Been busy with other projects and contemplating what to do with code and how to implement. Ran across several bits of code dealing with TMR0 which IMO might be a better choice but ??
Going to mull this over as the code I posted does not seem to detect a button press if it is a brief quick press. Started over without using the sub routines but still thinking that TMR0 is the road to travel down. Before this I want to take a look at more code examples using a POV.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: In need of some assistance for BATMAN pov graphics

Post by bitfogav » Thu Oct 17, 2013 3:49 am

You could use an external interrupt event, such as the INT pins or the PORTB input change interrupt, I think that would be better than using a digital input pin for the wheel position trigger..

All ive done in this example is set PORTB.0 as an interrupt trigger and set a flag so we know when to turn on PORTB.1, which turns on a led for a few ms.

Example code:

Code: Select all

Device = 18F2550
Clock = 48

Dim flashLed As Boolean
Dim OrangeLed As PORTB.1

Interrupt ExternalInt0(1)
    flashLed = True              ' Set flag
    INTCON.1 = 0                 ' Clear INT0 interrupt flag  
End Interrupt

// init_pic() - setup IO pins and other req'd regs
Public Sub init_pic()
    TRISA = %11111111       ' all inputs
    TRISB = %00000001       ' all outputs apart from RB0
    TRISC = %10110011       ' RX input, TX output, D+ and D- are inputs, SW1 & SW2 input

    CMCON  = %00000111      ' disable comparator inputs (for the time being) 
    CVRCON = $00            ' and turn off reference
    
    ADCON0.0 = 1            ' enable ADC
    ADCON1 = %00001011      ' ADC volt-Rrf and AN0, AN1, AN3 and AN4 set as Analog
    ADCON2 = %10110101      ' Right justified, ADC conversion time
    INTCON2.7 = 1           ' PORTB pull-ups (1 = All PORTB pull-ups are disabled)
    
   INTCON2.6 = 1               ' Set INT0 to interrupt on rising edge
   INTCON.1 = 0                ' Clear INT0 interrupt flag
   INTCON.4 = 1                ' Enable INT0 interrupt
   Enable(ExternalInt0)
   flashLed = false
End Sub

// main entry point...
DelayMS(10)
init_pic()

While true
   If flashLed = true Then
      flashLed = false
      High(OrangeLed)
      DelayMS(100)
      Low(OrangeLed)
   EndIf
Wend
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Thu Oct 17, 2013 7:31 am

Looked over and you are probably right on using the PortB interrupt. Used similar for my bike turn signal. Will give it a whirl.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by brad » Thu Oct 17, 2013 9:01 pm

That's what I used for the retroball audio!

The audio chip was an 18f2550 and it had an interrupt on one of the PORTB pins. When the main micro wanted to play a sound it would send a pulse to the 2550 which would immediately activate an interrupt which would then play a certain sound. worked like a charm!

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Sat Oct 19, 2013 12:47 am

Going to set up using a portB interrupt but looking at doing two timing functions at one time using portB.
I see the TMR0 can be set to trigger on rising pulse or descending pulse. I wonder if this can be changed within the code?
the T0con.4 sets this transition.
Time between rising pulse at point A and rising pulse at point B and time descending pulse between point B to point A
sounds convoluted at best??

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by brad » Sat Oct 19, 2013 8:09 pm

Going to set up using a portB interrupt but looking at doing two timing functions at one time using portB.
I see the TMR0 can be set to trigger on rising pulse or descending pulse. I wonder if this can be changed within the code?
the T0con.4 sets this transition.
You certainly can change this within the code :) In fact, you can download the retroball files and checkout the audio chip code to see how I used the interrupt if you like.
Time between rising pulse at point A and rising pulse at point B and time descending pulse between point B to point A
sounds convoluted at best??
What do you mean exactly?

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Fri Oct 25, 2013 4:52 am

Here is a simple POV setup.
If I do the same but use a pic to control the leds might be kinda cool
http://www.instructables.com/id/Simple- ... el-lights/

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by brad » Fri Oct 25, 2013 8:48 pm

That link looks like it just flashes LED's / keeps them on constantly rather than flash them to create graphics / text etc...

I highly recommend you start out with the one chip POV and experiment from there. It comes complete with software!

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Sat Oct 26, 2013 10:25 pm

Thats the plan
just need to decipher the software creating download.
Been busy doing a bath remodel and getting ready for winter.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by brad » Tue Oct 29, 2013 7:39 pm

What do you mean by decipher the software creating download?

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Tue Nov 05, 2013 7:25 am

I was wanting to go with using an actual graphic but need to look at the code the download generates but for simplicity this year just go with simple LEDs on the wheels, no "graphics" just make patterns using Christmas Season colors (green, white, red maybe yellow).
Have a strip of clear plastic for each color but the colors are separated by say 3-4 inches. Then program the pic to turn on each color individually.
Say 3 colors so you need 9 pic outputs plus ground and resistor.
Use the metal spokes as ground and have a PCboard with a ring of copper (have spring loaded brush) to provide the 12v w/ 5v reg on board. The 12 volts for LED brightness etc.
Using the frame as ground and one 12 v battery to power all three wheels.
Will draw out a sketch of what I am thinking. A picture is worth a thousand words.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Tue Nov 05, 2013 7:27 am

Oh yea I almost forgot this Email link I got
https://app.getresponse.com/click.html? ... =JQmbx&y=8&

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Tue Nov 05, 2013 7:43 am

here is sketch of my idea for a simple bike POV
Attachments
pic setup.png
pic setup.png (27.5 KiB) Viewed 19562 times

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Thu Nov 07, 2013 1:29 am

Made some minor revisions and think I have eliminated the need for a Hall switch by using copper pcboard traces that when in line with trigger point it pulls the input HIGH. Could go LOW justy as easy.
Attachments
pic setup pov.jpg
pic setup pov.jpg (164.2 KiB) Viewed 19544 times

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: In need of some assistance for BATMAN pov graphics

Post by MrDEB » Thu Nov 07, 2013 3:20 pm

I ordered 200 5mm tri-color LEDs this week as I am contemplating "HOW TO CONNECT THE LEDs.but it dawned on me BAM! look at the leds as being in a matrix.
I have a 15 x 3 matrix. Might be easy to configure using my same basic circuit I used for my bike turn signal that used a 5 x 7 LED matrix.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 16 guests