Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Flow code using switch

Status
Not open for further replies.

adamshaw_17

New Member
Hi,

Im currently trying to use flow code to simulate a digital gear indicator, this is basically two switches that are up and down counters and they have a range (neautral, 1st Gear, 2nd Gear, 3rd Gear, 4th Gear and 5th Gear). I have completed a example using seperate switches for every gear. I was jus wandering how i could use just two switches would i need to use the eeprom.
 
Hi,

Im currently trying to use flow code to simulate a digital gear indicator, this is basically two switches that are up and down counters and they have a range (neautral, 1st Gear, 2nd Gear, 3rd Gear, 4th Gear and 5th Gear). I have completed a example using seperate switches for every gear. I was jus wandering how i could use just two switches would i need to use the eeprom.

[robotic voice]insufficient information ... need more information[/robotic voice]

More details, please. How do the switch positions map to the gear positions? Are they "bumps" (each flip of a switch advances/decrements a count), or absolute positions (switch position = gear position)? Explain what exactly you're trying to do; then we have a better chance of being able to help you.
 
Last edited:
sorry about that in my current working example each switch has its on variable attached to it so if that switch is flipped it will print out to the LCD screen, what im wanting to do next is take away the need for individual switches and just use 2 switches a up and a down so if the up switch is pressed then there is an output to the lcd to the next gear position and the same for the down switch. The range is neutral, 1st gear, 2nd gear, 3rd gear, 4th gear and 5th gear.
 
sorry about that in my current working example each switch has its on variable attached to it so if that switch is flipped it will print out to the LCD screen, what im wanting to do next is take away the need for individual switches and just use 2 switches a up and a down so if the up switch is pressed then there is an output to the lcd to the next gear position and the same for the down switch. The range is neutral, 1st gear, 2nd gear, 3rd gear, 4th gear and 5th gear.

OK, so what you want are "elevator buttons", one for up, one for down, correct?

And I assume you don't want it to "wrap around" when you reach the top/bottom gear, right? just stay there?
 
yea thats what im after no wrap around, the way i was thinking was i mite need a count variable to monitor how many times the button/switch has been pressed, and with each pulse print out 2 the LCD. I hope ive explained it properly and you can help me figure it out.
thanks
 
i didnt get whether you look for mechanical part or electronic part. in my understanding, you need an electronic logic arrangement fed from two switches, when one is pressed it give a pulse to count up until it reaches to a certain point(5th gear) the same for the next switch to count down until neutral. if so let me know i can come up with some solution.
 
yes thats exactly the arrangement i am after, all developed using flow code and with each increment of the count this outputs to the LCD display. Thanks again for your help
 
It's like a flowchart system where you program events, inputs outputs by building a flowchart of the programs execution.

I expect a lot of engineers will hate it - I like it. If I need to prove a concept it can be done in minutes though I'd not recommend it for big projects.
 
So, basically, pseudocode? Is actually some kind of formalized system, or just drawing a flowchart?

I do find that sort of thing really useful before trying to code or design something.
 
looks something like this:

**broken link removed**

For something professionals might call academic, it is pretty powerful with 'drag and drop' features like LCD, RS232, SPI EEPROM etc

For quick concept testing and even prototyping it's quite capable. It supports c and assembly inserts as it translates everything into c then assembly as part of it's natual compilation system, they do one for pic's and one for avr's if I recall correctly.

It's a good tool to have on the shelf, I'm becoming a fan of C, but this will always get some use.
 
I like flow code its powerful stuff really u can put programs together in seconds if u prefer to code (C language) then i can transfer that into flow code any help really is good help. thanks
 
you basically need a two input encoder that will give you a 5 state logic output. when power up it will start with one status (neutral) and will show the rest of the status depends on the switches pressed. will hold when at both ends. i don't know whether you need some code or you need a logic circuit...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top