LED i/o help needed.

126 views
Skip to first unread message

carl

unread,
Oct 7, 2013, 11:55:00 AM10/7/13
to fign...@googlegroups.com
Hi, I hate to be a serial topic starter here but I need help with this... if anyone can.

As a follow on to this thread, making use of those 4 I/O ports


Is there a laymans method on using the port codes to turn an led on or off?

Also how many pins and what pin numbers can we use if we have a keyboard and audio to perform this? 

If I were to connect an LED to the audio socket could I turn it on with aud and beep?

I have been using Meltwaters Tri-Colour LEDS on my RaspI and thought how nice it would be to do similar in Forth, I feel that it would be straightforward to code.


I know we could only use one of the LEDS but again a little kit and Method could really show people hoe powerful forth is and how similar it is to python in some respects.

Regards,


Carl.


http://figgi.boards.net 



carl

unread,
Oct 13, 2013, 1:42:43 PM10/13/13
to fign...@googlegroups.com
Well Progress!

Here are some ways of toggling the I/O ports.

  • PD 6 
  • assign by 64 191 39 >port> drop
  • turn on 64 191 42 >port> drop
  • turn off 0 191 42 >port> drop
  • PD5
  • assign by 32 223 39 >port> drop
  • on 32 223 40 >port> drop
  • off 0 223 40 >port> drop
  • PD4
  • assign 16 239 39 >port> drop
  • on 16 239 40 >port> drop
  • off 0 239 40 >port> drop

you can get to PD0 by following 8 247, 4 251, 2 253 ... but this will interfere with your figypad.

I have wired mine up to a tri colour diode and got many effects by turning on all or a combination of pins at one time. If the pause command is added, you can have blinking and tonal colours too! ( this s why I coloured the above code)

I will follow up with the LED circuit at some point.

some questions at this point to be answered... if PD 6 is toggled to 40 not 42, the intensity of light is half, but this is not applicable to 5 thru to 1, is this a Digital, analogue pwm thing?

carl

unread,
Oct 13, 2013, 1:55:50 PM10/13/13
to fign...@googlegroups.com

carl

unread,
Oct 20, 2013, 5:58:17 AM10/20/13
to fign...@googlegroups.com
more progress, the >port> command to turn PD6 on and off is different to the commands of PD5/4 

  • PD 6 
  • turn on 64 191 42 >port> drop
  • turn on and off off 0 191 42 >port> drop ... thereafter
I have made a kit and a 12 page guide with some example programs,  here 

here is an early test video.

gfh

unread,
May 1, 2014, 12:44:52 AM5/1/14
to fign...@googlegroups.com

April 30, 2014

I've a hankering to blink some LED's.

Having read a bit in the posts, I belive I understand that the available Discrete I/O's are PD 4, PD 5, and PD 6.

I think I understand the programming required - as in:

https://groups.google.com/forum/#!topic/fignition/VcWvKKv5ZjU

I have reviewed schematic information:

https://14403060414466717264.googlegroups.com/attach/650d6a286df47080/FIGleds_circuit2.png?part=5&view=1&vt=ANaJVrH_T5JT7MAI8_axAIE1Iwvueq96r7nD1TF4wxKk2memsSn4y6MILv6R7nOe0CoCHDOUEaYOTkQWFHj-rrSi9SC5UKCgZLf9ZOwCalhX5R1EfCc3WoU

I have examined the Fignition circuit board and I note pins identified as follows:

PD01        PC32

PD45         PC10

PD67        GND

PB01         5V

PB23         3.6V

PB45

GND         (LK1)

AREF

I understand LED's, polarity, current limiting resistors and how one calculates the needed resistance.

What I don't know is:

Which Fignition pins are the 3 discrete outputs

The discrete output voltage (5V or 3.6V)

Help !!!


Carl Attrill

unread,
May 1, 2014, 3:14:38 AM5/1/14
to fign...@googlegroups.com
Hi GFH,

I have done a little bit about this, Alloow me to share what I know,

The output is 5V
You use PC6
PC5
PC4
GND

To prime all ports so they are all in the same state, i.e. all on.

With your Lights connected please type them in…

64 191 42 >port>  drop               ( turns on PD6 and lights up)

32 223 39 >port>  drop               ( sets PD5 to v out and lights up)

16 239 39 >port>  drop               (sets PD4 to v out but no light)

16 239 40 >port>  drop               (turns on PD4 and lights up)


To turn off each port you have to type the following…

64 191 41 >port>  drop  ( turns off PD6 or ‘red’)

0 223 40 >port> drop ( turns off PD5 ‘blue’)

0 239 40 >port> drop ( turns off PD4 ‘green’)


To turn them back on…

64 191 41 >port>  drop ( ‘red’)

32 223 40 >port>  drop ( ‘blue’)

16 239 40 >port>  drop ( ‘green’)

Notes…

You will notice that PC5 and PC4 behave in the same way; they turn on with one command and turn off with another.

PC6 behaves differently, one command ‘wakes up the light’ then another command turns it off but the same command again turns it back on. 


:  setup

64 191 42 >port>

32 223 39 >port>

16 239 39 >port>

16 239 40 >port>

drop drop drop drop ;


:   1red1   64 191 41 >port> drop ;       ( PC6 on)

:  1red0   64 191 41 >port> drop ;           ( PC6 off)

:  2blue1   32 223 40 >port> drop ;       ( PC5 on)

:  2blue0   0 223 40 >port> drop ;         ( PC5 off)

:  3green1   16 239 40 >port> drop ;    ( PC4 on)

:  3green0  0 239 40 >port> drop ;       ( PC4 off)

hope this helps so far,

Carl.


--
You received this message because you are subscribed to the Google Groups "FIGnition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fignition+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carl Attrill

unread,
May 1, 2014, 3:17:46 AM5/1/14
to fign...@googlegroups.com
here is the layout.
fig_board.png

gfh

unread,
May 1, 2014, 4:30:07 PM5/1/14
to fign...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages