Pure radiance or how to use a Fork to light an LED

In this article, we will show Fork's abilities when working with LEDs. Thank you Anirudha Gaikwad(_ro.box_) for creating an interesting project
Here's how you can quickly set-up your Fork in 1 minute.

Fork is a test fixture device developed by @forktestlab,
It can be used as a node between your test devices and user providing a simple and reliable approach that doesn't necessarily require any programming.
You can toggle Digital pins, get analog data and everything else Directly over Ethernet or Wifi.
Second video demonstrates how you can program "Fork" over Ethernet and run a simple blink code written in python using the Fork-API.

The setup :
Python 3.8, Spyder IDE used,
Fork connected to Internet via Ethernet cable.
Pin DO-zero pulled up, and toggled every second.

# -*- coding: utf-8 -*-
Created on Sun May  9 20:37:42 2021
@author: Anirudha Gaikwad
import time
from forkapi.fork import Fork

myFork = Fork('')

time_unit = 0.2
value_dash = 3*time_unit
value_idle = 1*time_unit
value_space = 3*time_unit
value_words = 7*time_unit

def morse(txt):
    encrypt = {'A':'.-', 'B':'-...', 'C':'-.-.',
               'D':'-..', 'E':'.', 'F':'..-.',
               'G':'--.', 'H':'....', 'I':'..',
               'J':'.---', 'K':'-.-', 'L':'.-..',
               'M':'--', 'N':'-.', 'O':'---',
               'P':'.--.', 'Q':'--.-', 'R':'.-.',
               'S':'...', 'T':'-', 'U':'..-',
               'V':'...-', 'W':'.--', 'X':'-..-',
               'Y':'-.--', 'Z':'--..', ' ':'.....'}
    decrypt = {v: k for k, v in encrypt.items()}

    if '-' in txt:
        return ''.join(decrypt[i] for i in txt.split())
    return ' '.join(encrypt[i] for i in txt.upper())

def convert_morse_to_LED(morse_code):
    for i in range(len(morse_code)):
        print(morse_code[i],end ="")
        if(morse_code[i] == '.'):

            status = myFork.aoSet(0,10)
            status = myFork.aoSet(0,0)
        elif(morse_code[i] == '-'):
                status = myFork.aoSet(0,10)
                status = myFork.aoSet(0,0)

def Relay_init():
    status = myFork.aoSet(1,10)
        return "Relay init successful"
        return "Relay init unsuccessful"

while True:

    morse_value = morse("Hello World")
  #  convert_morse_to_LED(morse_value)
    ##status = myFork.aoSet(0,0)
   # time.sleep(value_idle)
Examples of testing on the Fork
Subscribe news
© All Rights Reserved, 2022 Privacy policy forktestlab@gmail.com
Click to order
Your order
Step #1:Leave contact details for delivery and feedback. Step #2: After adding your contacts, you will automatically be taken to the Paypal payment window, where you can pay for the board and delivery in two clicks.
Your Name
Your Email
Your Phone
On the same day, we will contact you to clarify the delivery details and specify the board configuration. Delivery from 7 to 30 days, depending on the recipient's address.